At the moment factors are indexed from 1 to K where K is the number of factor.
In some cases, there may be another indexing which the user may want to use. For example if the factors correspond to entries of a matrix, it's more convenient to refer to a factor using a tuple (i,j).
In order to do that the only thing we care about is to have a mapping from key to index. So I don't think it's necessary to modify Factor
In the definition of the FactorGraph there should be the possibility for the user to pass an array of keys
that should build a mapping which should then be used when required
I believe this should be rather easy to do although it's late and I need to think a bit more carefully about it.
[migrated from private repo]
At the moment factors are indexed from 1 to K where K is the number of factor.
In some cases, there may be another indexing which the user may want to use. For example if the factors correspond to entries of a matrix, it's more convenient to refer to a factor using a tuple
(i,j)
.In order to do that the only thing we care about is to have a mapping from
key
toindex
. So I don't think it's necessary to modifyFactor
FactorGraph
there should be the possibility for the user to pass an array of keysI believe this should be rather easy to do although it's late and I need to think a bit more carefully about it.