ve
Class FactorStoreIndexed
java.lang.Object
|
+--ve.FactorStore
|
+--ve.FactorStoreIndexed
- public class FactorStoreIndexed
- extends FactorStore
a place to store factors during computation. This indexesto find
the the muinimal deficiency variable or the min-size variable
efficiently.
Method Summary |
void |
addFactor(Factor fac)
adds the factor to the factor store. |
private void |
cleanUp(Factor fac)
|
FactorIterator |
emunFactorsRemaining()
returns an enumerator over the variables for the last variable
returned. |
FactorIterator |
emunFactorsRemoved()
returns an enumerator over the variables for the last variable
returned. |
boolean |
hasNext()
is true if there is a next variable to eliminate. |
Variable |
next()
returns the next variable to eliminate according to the
current heuristic. |
private void |
shuffleDown(int pos)
make into a heap by shuffling down the value at position
pos. |
private void |
shuffleUp(int pos)
make into a heap by shuffling up the value at position
pos. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
varsPQ
private FactorStoreIndexed.VariableToEliminate[] varsPQ
numVariables
private int numVariables
last
private FactorStoreIndexed.VariableToEliminate last
varToVarInQuery
java.util.Hashtable varToVarInQuery
finalFacs
private Factor[] finalFacs
numFinalFacs
private int numFinalFacs
FactorStoreIndexed
public FactorStoreIndexed(Variable[] toSumOut,
Factor[] initFactors,
int numInitFactors)
hasNext
public boolean hasNext()
- is true if there is a next variable to eliminate.
- Overrides:
hasNext
in class FactorStore
next
public Variable next()
- returns the next variable to eliminate according to the
current heuristic.
- Overrides:
next
in class FactorStore
addFactor
public void addFactor(Factor fac)
- adds the factor to the factor store. Note that this is only
used for computed factors.
- Overrides:
addFactor
in class FactorStore
cleanUp
private void cleanUp(Factor fac)
emunFactorsRemoved
public FactorIterator emunFactorsRemoved()
- returns an enumerator over the variables for the last variable
returned.
- Overrides:
emunFactorsRemoved
in class FactorStore
emunFactorsRemaining
public FactorIterator emunFactorsRemaining()
- returns an enumerator over the variables for the last variable
returned.
- Overrides:
emunFactorsRemaining
in class FactorStore
shuffleDown
private void shuffleDown(int pos)
- make into a heap by shuffling down the value at position
pos. This assumes that varsPQ is a heap except maybe that the
value at position pos is larger than it's children.
shuffleUp
private void shuffleUp(int pos)
- make into a heap by shuffling up the value at position
pos. This assumes that varsPQ is a heap except maybe that the
value at position pos is smallerer than it's parent.