cve
Class FactorUpdatable

java.lang.Object
  |
  +--ve.Factor
        |
        +--ve.FactorStored
              |
              +--cve.FactorUpdatable

public class FactorUpdatable
extends FactorStored

This the the class of factors that can be updated from generalised rules.


Inner classes inherited from class ve.FactorStored
FactorStored.Itr
 
Field Summary
private  int[] base
          gives the number of elements to the right for each variable.
 
Fields inherited from class ve.FactorStored
factorValues
 
Fields inherited from class ve.Factor
BY_ASSIGN, BY_CPT, BY_DETERMINISTIC, BY_EXPANDING, BY_GENRULE, BY_MAXIMIZING, BY_MULTIPLYING, BY_NORMALIZING, BY_OBSERVED, BY_PLUS, BY_REORDERING, BY_SAVEIT, BY_SUM_OUT, BY_UNIFORM, BY_UPDATABLE, BY_V_ELIM, howCreatedVal, savingForTracing, thesize, variables
 
Constructor Summary
(package private) FactorUpdatable(Variable[] vars)
          constructs a factor with the given variables.
 
Method Summary
 void update(GenRule rule)
          updates every stored value corresponding to the rule.
private  void updatefrom(GenRule rule, int conpos, int facpos, int varpos, int valpos, EltsIterator ruleItr)
          when updating by a rule, updatefrom iterates over the variables in the current factor.
 
Methods inherited from class ve.FactorStored
iterator
 
Methods inherited from class ve.Factor
allOnes, contains, display, getName, getSavingForTracing, getVariables, howCreated, isRedundant, isRedundant, print, print, printVariables, setSavingForTracing, size, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

base

private int[] base
gives the number of elements to the right for each variable.
Constructor Detail

FactorUpdatable

FactorUpdatable(Variable[] vars)
constructs a factor with the given variables.
Parameters:
vars - the list of variables
Method Detail

update

public void update(GenRule rule)
updates every stored value corresponding to the rule. This must also update all of the values.

updatefrom

private void updatefrom(GenRule rule,
                        int conpos,
                        int facpos,
                        int varpos,
                        int valpos,
                        EltsIterator ruleItr)
when updating by a rule, updatefrom iterates over the variables in the current factor. For each variable it does different things depending on whether the variable is in the context, in the factor of the rule or isn't in the generalised rule.
Parameters:
rule - the rule to be updating from
conpos - the current position in the context of the rule
facpos - the current position in the variables of the rule
varpos - the current position in the varibales of the current factor
valpos - the current position in the values of the current factor
ruleItr - an iterator over the rule factor
Returns:
the updated position in the current factor