fix a bug when checking of a set of log vars form a cartesian product

This commit is contained in:
Tiago Gomes 2012-05-15 16:46:21 +01:00
parent 1380adcfb5
commit 03f9df7dc3

View File

@ -622,12 +622,13 @@ ConstraintTree::getConditionalCounts (const LogVarSet& Ys)
bool bool
ConstraintTree::isCarteesianProduct (const LogVarSet& Xs) const ConstraintTree::isCarteesianProduct (const LogVarSet& Xs)
{ {
assert (logVarSet_.contains (Xs)); assert (logVarSet_.contains (Xs));
if (Xs.size() <= 1) { if (Xs.size() <= 1) {
return true; return true;
} }
moveToTop (Xs.elements());
for (unsigned i = 1; i < Xs.size(); i++) { for (unsigned i = 1; i < Xs.size(); i++) {
CTNodes nodes = getNodesAtLevel (i); CTNodes nodes = getNodesAtLevel (i);
for (unsigned j = 1; j < nodes.size(); j++) { for (unsigned j = 1; j < nodes.size(); j++) {