public int add (Variable var) { return variableAlphabet.lookupIndex (var, true); }
public int[] lookupIndices (Object[] objects, boolean addIfNotPresent) { int[] ret = new int[objects.length]; for (int i = 0; i < objects.length; i++) ret[i] = lookupIndex (objects[i], addIfNotPresent); return ret; }
public int[] lookupIndices (Object[] objects, boolean addIfNotPresent) { int[] ret = new int[objects.length]; for (int i = 0; i < objects.length; i++) ret[i] = lookupIndex (objects[i], addIfNotPresent); return ret; }
public int getIndex (Factor factor) { return factorsAlphabet.lookupIndex (factor, false); }
public int getIndex (Variable var) { return variableAlphabet.lookupIndex (var); }
public int[] lookupIndices (Object[] objects, boolean addIfNotPresent) { int[] ret = new int[objects.length]; for (int i = 0; i < objects.length; i++) ret[i] = lookupIndex (objects[i], addIfNotPresent); return ret; }
public int lookupIndex (Object entry) { return lookupIndex (entry, true); }
public int getIndex (Factor factor) { return factorsAlphabet.lookupIndex (factor, false); }
public int getIndex (Variable var) { return variableAlphabet.lookupIndex (var); }
public int lookupIndex (Object entry) { return lookupIndex (entry, true); }
public int add (Variable var) { return variableAlphabet.lookupIndex (var, true); }
public int getIndex (Variable var) { return variableAlphabet.lookupIndex (var); }
public int lookupIndex (Object entry) { return lookupIndex (entry, true); }
public int add (Variable var) { return variableAlphabet.lookupIndex (var, true); }
public int getIndex (Factor factor) { return factorsAlphabet.lookupIndex (factor, false); }
/** * Adds a factor to the model. * <P> * If a factor has already been added for the variables in the * given clique, the effects of this method are (currently) * undefined. * <p> * All convenience methods for adding factors eventually call through * to this one, so this is the method for subclasses to override if they * wish to perform additional actions when a factor is added to the graph. * * @param factor A factor over the variables in clique. */ public void addFactor (Factor factor) { beforeFactorAdd (factor); VarSet varSet = factor.varSet (); addVarsIfNecessary (varSet); factors.add (factor); factorsAlphabet.lookupIndex (factor); addToListMap (clique2ptl, varSet, factor); // cache the factor cacheFactor (varSet, factor); afterFactorAdd (factor); }
/** * Adds a factor to the model. * <P> * If a factor has already been added for the variables in the * given clique, the effects of this method are (currently) * undefined. * <p> * All convenience methods for adding factors eventually call through * to this one, so this is the method for subclasses to override if they * wish to perform additional actions when a factor is added to the graph. * * @param factor A factor over the variables in clique. */ public void addFactor (Factor factor) { beforeFactorAdd (factor); VarSet varSet = factor.varSet (); addVarsIfNecessary (varSet); factors.add (factor); factorsAlphabet.lookupIndex (factor); addToListMap (clique2ptl, varSet, factor); // cache the factor cacheFactor (varSet, factor); afterFactorAdd (factor); }
/** * Adds a factor to the model. * <P> * If a factor has already been added for the variables in the * given clique, the effects of this method are (currently) * undefined. * <p> * All convenience methods for adding factors eventually call through * to this one, so this is the method for subclasses to override if they * wish to perform additional actions when a factor is added to the graph. * * @param factor A factor over the variables in clique. */ public void addFactor (Factor factor) { beforeFactorAdd (factor); VarSet varSet = factor.varSet (); addVarsIfNecessary (varSet); factors.add (factor); factorsAlphabet.lookupIndex (factor); addToListMap (clique2ptl, varSet, factor); // cache the factor cacheFactor (varSet, factor); afterFactorAdd (factor); }