eliminateOne returns empty graph if the "new" factor is empty.

release/4.3a0
Can Erdogan 2012-03-04 01:36:09 +00:00
parent 79b4b74930
commit 5bb1564a74
1 changed files with 3 additions and 2 deletions

View File

@ -104,8 +104,9 @@ typename Graph::FactorizationResult eliminate(const Graph& factorGraph, const st
remainingGraph.push_back(factorGraph[i]);
}
// Add remaining factor
remainingGraph.push_back(remainingFactor);
// Add the remaining factor if it is not empty.
if(remainingFactor->size() != 0)
remainingGraph.push_back(remainingFactor);
return typename Graph::FactorizationResult(conditional, remainingGraph);