ve
Class FactorStoreRandom
java.lang.Object
|
+--ve.FactorStore
|
+--ve.FactorStoreRandom
- public class FactorStoreRandom
- extends FactorStore
a place to store factors during computation. This is a naive
implementation. A better implementation would do better indexing.
Constructor Summary |
FactorStoreRandom(Variable[] toSumOut,
Factor[] initialFactors,
int numInitFactors)
generate a factor store containing the given initial factors and initial variables. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
theFactors
private Factor[] theFactors
numFactors
private int numFactors
theVariables
private Variable[] theVariables
numVariables
private int numVariables
factorMaxSize
private int factorMaxSize
last
private Variable last
FactorStoreRandom
public FactorStoreRandom(Variable[] toSumOut,
Factor[] initialFactors,
int numInitFactors)
- generate a factor store containing the given initial factors and initial variables.
hasNext
public boolean hasNext()
- Overrides:
hasNext
in class FactorStore
next
public Variable next()
- Overrides:
next
in class FactorStore
addFactor
public void addFactor(Factor newFactor)
- Overrides:
addFactor
in class FactorStore
emunFactorsRemoved
public FactorIterator emunFactorsRemoved()
- Returns an iterator over the factors that contain the variable
var. Note that we remove the factors as we access them. We
should really index properly so that this can be done in time
proportional to the number of factors that contain the
variable, not linear in the total number of factors.
- Overrides:
emunFactorsRemoved
in class FactorStore
emunFactorsRemaining
public FactorIterator emunFactorsRemaining()
- Returns an iterator over the the remaining factors.
- Overrides:
emunFactorsRemaining
in class FactorStore