From d07ea730504abae9592bd33151ac13626472b18c Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Mon, 29 Oct 2012 21:37:58 +0000 Subject: [PATCH] add projectedCopy --- packages/CLPBN/horus/ConstraintTree.cpp | 10 ++++++++++ packages/CLPBN/horus/ConstraintTree.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/packages/CLPBN/horus/ConstraintTree.cpp b/packages/CLPBN/horus/ConstraintTree.cpp index 9702e4a4a..07aaf35a3 100644 --- a/packages/CLPBN/horus/ConstraintTree.cpp +++ b/packages/CLPBN/horus/ConstraintTree.cpp @@ -367,6 +367,16 @@ ConstraintTree::project (const LogVarSet& X) +ConstraintTree +ConstraintTree::projectedCopy (const LogVarSet& X) +{ + ConstraintTree copy = *this; + copy.project (X); + return copy; +} + + + void ConstraintTree::remove (const LogVarSet& X) { diff --git a/packages/CLPBN/horus/ConstraintTree.h b/packages/CLPBN/horus/ConstraintTree.h index 0cc01c841..d233a2e97 100644 --- a/packages/CLPBN/horus/ConstraintTree.h +++ b/packages/CLPBN/horus/ConstraintTree.h @@ -157,6 +157,8 @@ class ConstraintTree void applySubstitution (const Substitution&); void project (const LogVarSet&); + + ConstraintTree projectedCopy (const LogVarSet&); void remove (const LogVarSet&);