use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.Simplex in project aic-praise by aic-sri-international.
the class GradientAnytimeExactBP method getIndices.
private static Set<? extends Variable> getIndices(AtomicPolytope subAtomicPolytope) {
Set<Variable> result = new HashSet<>();
if (subAtomicPolytope instanceof Simplex) {
Simplex subSimplex = (Simplex) subAtomicPolytope;
result.add(subSimplex.getVariable());
} else if (subAtomicPolytope instanceof IntensionalConvexHullOfFactors) {
IntensionalConvexHullOfFactors subConvexHull = (IntensionalConvexHullOfFactors) subAtomicPolytope;
result.addAll(subConvexHull.getIndices());
} else {
throw new Error("New unsupported type of atomic polytope added");
}
return result;
}
use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.Simplex in project aic-praise by aic-sri-international.
the class AbstractAEBPTreeNode method addSimplexOrFactortoTheListOfProducts.
public void addSimplexOrFactortoTheListOfProducts(List<Polytope> polytopesToMultiply) {
if (isRootAFactor()) {
IntensionalConvexHullOfFactors singletonConvexHullOfFactorAtRoot = new IntensionalConvexHullOfFactors(list(), (Factor) this.getRoot());
polytopesToMultiply.add(singletonConvexHullOfFactorAtRoot);
} else if (!isExhausted.apply((Variable) this.getRoot())) {
polytopesToMultiply.add(new Simplex((Variable) this.getRoot()));
}
}
Aggregations