/** * Returns the factor for a given node. That is, this method returns the * factor whose domain is exactly this node. * <P> * This method is equivalent to calling {@link #factorOf} * with a clique object that contains only <tt>v</tt>. * <P> * @param var which the factor is over. * @throws RuntimeException If the model contains more than one factor over the given variable. Use allFactorsOf in this case. * @return The factor defined over the edge <tt>v</tt> * (such as by {@link #addFactor(Factor)}). Returns null if * no such factor exists. */ public Factor factorOf (Variable var) { List lst = allFactorsOf (var); return firstIfSingleton (lst, var.toString ()); }
/** * Returns the factor for a given node. That is, this method returns the * factor whose domain is exactly this node. * <P> * This method is equivalent to calling {@link #factorOf} * with a clique object that contains only <tt>v</tt>. * <P> * @param var which the factor is over. * @throws RuntimeException If the model contains more than one factor over the given variable. Use allFactorsOf in this case. * @return The factor defined over the edge <tt>v</tt> * (such as by {@link #addFactor(Factor)}). Returns null if * no such factor exists. */ public Factor factorOf (Variable var) { List lst = allFactorsOf (var); return firstIfSingleton (lst, var.toString ()); }
/** * Returns the factor for a given node. That is, this method returns the * factor whose domain is exactly this node. * <P> * This method is equivalent to calling {@link #factorOf} * with a clique object that contains only <tt>v</tt>. * <P> * @param var which the factor is over. * @throws RuntimeException If the model contains more than one factor over the given variable. Use allFactorsOf in this case. * @return The factor defined over the edge <tt>v</tt> * (such as by {@link #addFactor(Factor)}). Returns null if * no such factor exists. */ public Factor factorOf (Variable var) { List lst = allFactorsOf (var); return firstIfSingleton (lst, var.toString ()); }
for (int i = 0; i < vars.size(); i++) { Variable next = (Variable) vars.get(i); ret += next.toString() + "\n"; // " (" + mdl.getIndex(next) + ")\n ";
for (int i = 0; i < vars.size(); i++) { Variable next = (Variable) vars.get(i); ret += next.toString() + "\n"; // " (" + mdl.getIndex(next) + ")\n ";
for (int i = 0; i < vars.size(); i++) { Variable next = (Variable) vars.get(i); ret += next.toString() + "\n"; // " (" + mdl.getIndex(next) + ")\n ";