diff --git a/packages/CLPBN/horus/LiftedWCNF.cpp b/packages/CLPBN/horus/LiftedWCNF.cpp index 4bb393117..f8d81ba33 100644 --- a/packages/CLPBN/horus/LiftedWCNF.cpp +++ b/packages/CLPBN/horus/LiftedWCNF.cpp @@ -4,6 +4,7 @@ #include #include "LiftedWCNF.h" +#include "ParfactorList.h" #include "ConstraintTree.h" #include "Indexer.h" @@ -11,7 +12,9 @@ namespace horus { bool -Literal::isGround (ConstraintTree constr, LogVarSet ipgLogVars) const +Literal::isGround ( + ConstraintTree constr, + const LogVarSet& ipgLogVars) const { if (logVars_.empty()) { return true; @@ -392,6 +395,14 @@ operator<< (std::ostream& os, const LitLvTypes& lit) +void +LitLvTypes::setAllFullLogVars (void) +{ + std::fill (lvTypes_.begin(), lvTypes_.end(), LogVarType::FULL_LV); +} + + + LiftedWCNF::LiftedWCNF (const ParfactorList& pfList) : freeLiteralId_(0), pfList_(pfList) { diff --git a/packages/CLPBN/horus/LiftedWCNF.h b/packages/CLPBN/horus/LiftedWCNF.h index 81e293604..3551eafe0 100644 --- a/packages/CLPBN/horus/LiftedWCNF.h +++ b/packages/CLPBN/horus/LiftedWCNF.h @@ -6,19 +6,16 @@ #include #include -#include "ParfactorList.h" +#include "ConstraintTree.h" +#include "ProbFormula.h" +#include "LiftedUtils.h" namespace horus { -class ConstraintTree; +class ParfactorList; -enum LogVarType -{ - FULL_LV, - POS_LV, - NEG_LV -}; +enum LogVarType { FULL_LV, POS_LV, NEG_LV }; typedef long LiteralId; typedef std::vector LogVarTypes; @@ -27,11 +24,11 @@ typedef std::vector LogVarTypes; class Literal { public: - Literal (LiteralId lid, const LogVars& lvs) : - lid_(lid), logVars_(lvs), negated_(false) { } + Literal (LiteralId lid, const LogVars& lvs) + : lid_(lid), logVars_(lvs), negated_(false) { } - Literal (const Literal& lit, bool negated) : - lid_(lit.lid_), logVars_(lit.logVars_), negated_(negated) { } + Literal (const Literal& lit, bool negated) + : lid_(lit.lid_), logVars_(lit.logVars_), negated_(negated) { } LiteralId lid (void) const { return lid_; } @@ -47,13 +44,14 @@ class Literal bool isNegative (void) const { return negated_; } - bool isGround (ConstraintTree constr, LogVarSet ipgLogVars) const; + bool isGround (ConstraintTree constr, const LogVarSet& ipgLogVars) const; size_t indexOfLogVar (LogVar X) const; - std::string toString (LogVarSet ipgLogVars = LogVarSet(), - LogVarSet posCountedLvs = LogVarSet(), - LogVarSet negCountedLvs = LogVarSet()) const; + std::string toString ( + LogVarSet ipgLogVars = LogVarSet(), + LogVarSet posCountedLvs = LogVarSet(), + LogVarSet negCountedLvs = LogVarSet()) const; private: friend std::ostream& operator<< (std::ostream&, const Literal&); @@ -172,8 +170,7 @@ class LitLvTypes const LogVarTypes& logVarTypes (void) const { return lvTypes_; } - void setAllFullLogVars (void) { - std::fill (lvTypes_.begin(), lvTypes_.end(), LogVarType::FULL_LV); } + void setAllFullLogVars (void); private: friend std::ostream& operator<< (std::ostream&, const LitLvTypes&);