diff --git a/packages/CLPBN/clpbn/bp/ConstraintTree.cpp b/packages/CLPBN/clpbn/bp/ConstraintTree.cpp index c6d304135..0e900a683 100644 --- a/packages/CLPBN/clpbn/bp/ConstraintTree.cpp +++ b/packages/CLPBN/clpbn/bp/ConstraintTree.cpp @@ -622,12 +622,13 @@ ConstraintTree::getConditionalCounts (const LogVarSet& Ys) bool -ConstraintTree::isCarteesianProduct (const LogVarSet& Xs) const +ConstraintTree::isCarteesianProduct (const LogVarSet& Xs) { assert (logVarSet_.contains (Xs)); if (Xs.size() <= 1) { return true; } + moveToTop (Xs.elements()); for (unsigned i = 1; i < Xs.size(); i++) { CTNodes nodes = getNodesAtLevel (i); for (unsigned j = 1; j < nodes.size(); j++) {