add assignement operator to ConstraintTree

This commit is contained in:
Tiago Gomes 2012-10-30 00:15:40 +00:00
parent d07ea73050
commit b6df8a66b1
2 changed files with 16 additions and 3 deletions

View File

@ -187,9 +187,7 @@ ConstraintTree::ConstraintTree (
ConstraintTree::ConstraintTree (const ConstraintTree& ct)
{
root_ = CTNode::copySubtree (ct.root_);
logVars_ = ct.logVars_;
logVarSet_ = ct.logVarSet_;
*this = ct;
}
@ -875,6 +873,19 @@ ConstraintTree::copyLogVar (LogVar X_1, LogVar X_2)
ConstraintTree&
ConstraintTree::operator= (const ConstraintTree& ct)
{
if (this != &ct) {
root_ = CTNode::copySubtree (ct.root_);
logVars_ = ct.logVars_;
logVarSet_ = ct.logVarSet_;
}
return *this;
}
unsigned
ConstraintTree::countTuples (const CTNode* n) const
{

View File

@ -199,6 +199,8 @@ class ConstraintTree
ConstraintTrees ground (LogVar);
void copyLogVar (LogVar,LogVar);
ConstraintTree& operator= (const ConstraintTree& ct);
private:
unsigned countTuples (const CTNode*) const;