diff --git a/packages/CLPBN/horus/BayesBallGraph.h b/packages/CLPBN/horus/BayesBallGraph.h index 8359b598f..72a0f90d0 100644 --- a/packages/CLPBN/horus/BayesBallGraph.h +++ b/packages/CLPBN/horus/BayesBallGraph.h @@ -63,7 +63,7 @@ class BayesBallGraph void addEdge (VarId vid1, VarId vid2); const BBNode* getNode (VarId vid) const; - + BBNode* getNode (VarId vid); bool empty (void) const { return nodes_.empty(); } diff --git a/packages/CLPBN/horus/BeliefProp.h b/packages/CLPBN/horus/BeliefProp.h index 6c1d5c46b..64a41d916 100644 --- a/packages/CLPBN/horus/BeliefProp.h +++ b/packages/CLPBN/horus/BeliefProp.h @@ -59,7 +59,7 @@ class BpLink ss << var_->label(); return ss.str(); } - + protected: FacNode* fac_; VarNode* var_; @@ -97,7 +97,7 @@ class BeliefProp : public GroundSolver virtual Params getPosterioriOf (VarId); virtual Params getJointDistributionOf (const VarIds&); - + protected: void runSolver (void); diff --git a/packages/CLPBN/horus/ConstraintTree.h b/packages/CLPBN/horus/ConstraintTree.h index 0b48c3650..c50f45dc3 100644 --- a/packages/CLPBN/horus/ConstraintTree.h +++ b/packages/CLPBN/horus/ConstraintTree.h @@ -57,7 +57,7 @@ class CTNode CTChilds_& childs (void) { return childs_; } const CTChilds_& childs (void) const { return childs_; } - + size_t nrChilds (void) const { return childs_.size(); } bool isRoot (void) const { return level_ == 0; } @@ -108,7 +108,7 @@ class ConstraintTree ConstraintTree (const LogVars&); ConstraintTree (const LogVars&, const Tuples&); - + ConstraintTree (vector> names); ConstraintTree (const ConstraintTree&); @@ -121,7 +121,7 @@ class ConstraintTree ~ConstraintTree (void); CTNode* root (void) const { return root_; } - + bool empty (void) const { return root_->childs().empty(); } const LogVars& logVars (void) const @@ -135,17 +135,17 @@ class ConstraintTree assert (LogVarSet (logVars_) == logVarSet_); return logVarSet_; } - + size_t nrLogVars (void) const { return logVars_.size(); assert (LogVarSet (logVars_) == logVarSet_); } - + void addTuple (const Tuple&); - + bool containsTuple (const Tuple&); - + void moveToTop (const LogVars&); void moveToBottom (const LogVars&); @@ -159,7 +159,7 @@ class ConstraintTree void applySubstitution (const Substitution&); void project (const LogVarSet&); - + ConstraintTree projectedCopy (const LogVarSet&); void remove (const LogVarSet&); @@ -201,9 +201,9 @@ class ConstraintTree ConstraintTrees ground (LogVar); void copyLogVar (LogVar,LogVar); - + ConstraintTree& operator= (const ConstraintTree& ct); - + private: unsigned countTuples (const CTNode*) const; diff --git a/packages/CLPBN/horus/CountingBp.h b/packages/CLPBN/horus/CountingBp.h index a553e9307..2cbd2f995 100644 --- a/packages/CLPBN/horus/CountingBp.h +++ b/packages/CLPBN/horus/CountingBp.h @@ -88,13 +88,13 @@ class FacCluster const FacNode* first (void) const { return members_.front(); } const FacNodes& members (void) const { return members_; } - + FacNode* representative (void) const { return repr_; } void setRepresentative (FacNode* fn) { repr_ = fn; } VarClusters& varClusters (void) { return varClusters_; } - + private: FacNodes members_; FacNode* repr_; @@ -112,9 +112,9 @@ class CountingBp : public GroundSolver void printSolverFlags (void) const; Params solveQuery (VarIds); - + static bool checkForIdenticalFactors; - + private: Color getNewColor (void) { diff --git a/packages/CLPBN/horus/ElimGraph.cpp b/packages/CLPBN/horus/ElimGraph.cpp index 50870d1b6..93c8527e4 100644 --- a/packages/CLPBN/horus/ElimGraph.cpp +++ b/packages/CLPBN/horus/ElimGraph.cpp @@ -44,7 +44,7 @@ ElimGraph::ElimGraph (const vector& factors) ElimGraph::~ElimGraph (void) { for (size_t i = 0; i < nodes_.size(); i++) { - delete nodes_[i]; + delete nodes_[i]; } } diff --git a/packages/CLPBN/horus/ElimGraph.h b/packages/CLPBN/horus/ElimGraph.h index 2f4d60d15..8188b5ba6 100644 --- a/packages/CLPBN/horus/ElimGraph.h +++ b/packages/CLPBN/horus/ElimGraph.h @@ -10,7 +10,7 @@ using namespace std; -enum ElimHeuristic +enum ElimHeuristic { SEQUENTIAL, MIN_NEIGHBORS, @@ -49,7 +49,7 @@ class ElimGraph ElimGraph (const Factors&); ~ElimGraph (void); - + VarIds getEliminatingOrder (const VarIds&); void print (void) const; diff --git a/packages/CLPBN/horus/Factor.h b/packages/CLPBN/horus/Factor.h index ca330e4c3..742f20f7a 100644 --- a/packages/CLPBN/horus/Factor.h +++ b/packages/CLPBN/horus/Factor.h @@ -34,7 +34,7 @@ class TFactor void setDistId (unsigned id) { distId_ = id; } void normalize (void) { LogAware::normalize (params_); } - + void randomize (void) { for (size_t i = 0; i < params_.size(); ++i) { @@ -207,7 +207,7 @@ class TFactor Ranges ranges_; Params params_; unsigned distId_; - + private: void extend (unsigned range_prod) { diff --git a/packages/CLPBN/horus/FactorGraph.h b/packages/CLPBN/horus/FactorGraph.h index c2ed01046..b2b03369d 100644 --- a/packages/CLPBN/horus/FactorGraph.h +++ b/packages/CLPBN/horus/FactorGraph.h @@ -15,8 +15,8 @@ class FacNode; class VarNode : public Var { public: - VarNode (VarId varId, unsigned nrStates, - int evidence = Constants::NO_EVIDENCE) + VarNode (VarId varId, unsigned nrStates, + int evidence = Constants::NO_EVIDENCE) : Var (varId, nrStates, evidence) { } VarNode (const Var* v) : Var (v) { } @@ -77,7 +77,7 @@ class FactorGraph void setFactorsAsBayesian (void) { bayesFactors_ = true; } - bool bayesianFactors (void) const { return bayesFactors_ ; } + bool bayesianFactors (void) const { return bayesFactors_; } size_t nrVarNodes (void) const { return varNodes_.size(); } @@ -112,7 +112,7 @@ class FactorGraph void exportToUaiFormat (const char*) const; void exportToLibDaiFormat (const char*) const; - + private: // DISALLOW_COPY_AND_ASSIGN (FactorGraph); @@ -130,7 +130,7 @@ class FactorGraph FacNodes facNodes_; BayesBallGraph structure_; - bool bayesFactors_; + bool bayesFactors_; typedef unordered_map VarMap; VarMap varMap_; @@ -139,8 +139,8 @@ class FactorGraph struct sortByVarId -{ - bool operator()(VarNode* vn1, VarNode* vn2) { +{ + bool operator()(VarNode* vn1, VarNode* vn2) { return vn1->varId() < vn2->varId(); } }; diff --git a/packages/CLPBN/horus/GroundSolver.h b/packages/CLPBN/horus/GroundSolver.h index 3e2959605..18b81454b 100644 --- a/packages/CLPBN/horus/GroundSolver.h +++ b/packages/CLPBN/horus/GroundSolver.h @@ -27,7 +27,7 @@ class GroundSolver Params getJointByConditioning (GroundSolverType, FactorGraph, const VarIds& jointVarIds) const; - + protected: const FactorGraph& fg; }; diff --git a/packages/CLPBN/horus/Histogram.h b/packages/CLPBN/horus/Histogram.h index 6e0f93411..af0c4595e 100644 --- a/packages/CLPBN/horus/Histogram.h +++ b/packages/CLPBN/horus/Histogram.h @@ -12,17 +12,17 @@ class HistogramSet { public: HistogramSet (unsigned, unsigned); - + void nextHistogram (void); unsigned operator[] (size_t idx) const; - + unsigned nrHistograms (void) const; void reset (void); static vector getHistograms (unsigned ,unsigned); - + static unsigned nrHistograms (unsigned, unsigned); static size_t findIndex ( @@ -31,14 +31,14 @@ class HistogramSet static vector getNumAssigns (unsigned, unsigned); friend std::ostream& operator<< (ostream &os, const HistogramSet& hs); - + private: unsigned maxCount (size_t) const; void clearAfter (size_t); - unsigned size_; - Histogram hist_; + unsigned size_; + Histogram hist_; }; #endif // HORUS_HISTOGRAM_H diff --git a/packages/CLPBN/horus/HorusYap.cpp b/packages/CLPBN/horus/HorusYap.cpp index 586d5a170..33767344e 100644 --- a/packages/CLPBN/horus/HorusYap.cpp +++ b/packages/CLPBN/horus/HorusYap.cpp @@ -133,12 +133,12 @@ runLiftedSolver (void) case LiftedSolverType::LBP: solver = new LiftedBp (pfListCopy); break; case LiftedSolverType::LKC: solver = new LiftedKc (pfListCopy); break; } - + if (Globals::verbosity > 0) { solver->printSolverFlags(); cout << endl; } - + YAP_Term taskList = YAP_ARG2; vector results; while (taskList != YAP_TermNil()) { diff --git a/packages/CLPBN/horus/LiftedBp.cpp b/packages/CLPBN/horus/LiftedBp.cpp index 66e82a8c4..d3f757704 100644 --- a/packages/CLPBN/horus/LiftedBp.cpp +++ b/packages/CLPBN/horus/LiftedBp.cpp @@ -185,7 +185,7 @@ LiftedBp::rangeOfGround (const Ground& gr) return std::numeric_limits::max(); } - + Params LiftedBp::getJointByConditioning ( diff --git a/packages/CLPBN/horus/LiftedBp.h b/packages/CLPBN/horus/LiftedBp.h index cb6e9f3a4..274503f29 100644 --- a/packages/CLPBN/horus/LiftedBp.h +++ b/packages/CLPBN/horus/LiftedBp.h @@ -28,7 +28,7 @@ class LiftedBp : public LiftedSolver void createFactorGraph (void); vector> getWeights (void) const; - + unsigned rangeOfGround (const Ground&); Params getJointByConditioning (const ParfactorList&, const Grounds&); diff --git a/packages/CLPBN/horus/LiftedCircuit.cpp b/packages/CLPBN/horus/LiftedCircuit.cpp index 41ea4f2ae..7eb11b83b 100644 --- a/packages/CLPBN/horus/LiftedCircuit.cpp +++ b/packages/CLPBN/horus/LiftedCircuit.cpp @@ -238,7 +238,7 @@ LiftedCircuit::compile ( *follow = new TrueNode(); return; } - + if (clauses.size() == 1 && clauses[0]->isUnit()) { *follow = new LeafNode (clauses[0], *lwcnf_); return; @@ -326,13 +326,13 @@ LiftedCircuit::tryUnitPropagation ( explanation << " UP on " << clauses[i]->literals()[0]; explanationMap_[andNode] = explanation.str(); } - + Clauses unitClause = { clauses[i] }; compile (andNode->leftBranch(), unitClause); compile (andNode->rightBranch(), propagClauses); (*follow) = andNode; - return true; - } + return true; + } } return false; } @@ -409,11 +409,11 @@ LiftedCircuit::tryShannonDecomp ( explanation << " SD on " << literals[j]; explanationMap_[orNode] = explanation.str(); } - + compile (orNode->leftBranch(), clauses); compile (orNode->rightBranch(), otherClauses); (*follow) = orNode; - return true; + return true; } } } @@ -949,7 +949,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, ofstream& os) { assert (node != 0); - static unsigned nrAuxNodes = 0; + static unsigned nrAuxNodes = 0; stringstream ss; ss << "n" << nrAuxNodes; string auxNode = ss.str(); @@ -957,7 +957,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, ofstream& os) string opStyle = "shape=circle,width=0.7,margin=\"0.0,0.0\"," ; switch (getCircuitNodeType (node)) { - + case OR_NODE: { OrNode* casted = dynamic_cast(node); printClauses (casted, os); @@ -966,7 +966,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, ofstream& os) os << escapeNode (node) << " -> " << auxNode; os << " [label=\"" << getExplanationString (node) << "\"]" ; os << endl; - + os << auxNode << " -> " ; os << escapeNode (*casted->leftBranch()); os << " [label=\" " << (*casted->leftBranch())->weight() << "\"]" ; diff --git a/packages/CLPBN/horus/LiftedCircuit.h b/packages/CLPBN/horus/LiftedCircuit.h index 3acdf7285..2c32945ee 100644 --- a/packages/CLPBN/horus/LiftedCircuit.h +++ b/packages/CLPBN/horus/LiftedCircuit.h @@ -33,7 +33,7 @@ class CircuitNode class OrNode : public CircuitNode { public: - OrNode (void) : CircuitNode(), leftBranch_(0), rightBranch_(0) { } + OrNode (void) : CircuitNode(), leftBranch_(0), rightBranch_(0) { } CircuitNode** leftBranch (void) { return &leftBranch_; } CircuitNode** rightBranch (void) { return &rightBranch_; } @@ -51,7 +51,7 @@ class AndNode : public CircuitNode { public: AndNode (void) : CircuitNode(), leftBranch_(0), rightBranch_(0) { } - + AndNode (CircuitNode* leftBranch, CircuitNode* rightBranch) : CircuitNode(), leftBranch_(leftBranch), rightBranch_(rightBranch) { } @@ -153,13 +153,13 @@ class SmoothNode : public CircuitNode public: SmoothNode (const Clauses& clauses, const LiftedWCNF& lwcnf) : CircuitNode(), clauses_(clauses), lwcnf_(lwcnf) { } - + const Clauses& clauses (void) const { return clauses_; } Clauses clauses (void) { return clauses_; } - - double weight (void) const; - + + double weight (void) const; + private: Clauses clauses_; const LiftedWCNF& lwcnf_; @@ -246,16 +246,15 @@ class LiftedCircuit string extraOptions = ""); string escapeNode (const CircuitNode* node) const; - + string getExplanationString (CircuitNode* node); CircuitNode* root_; const LiftedWCNF* lwcnf_; - + bool compilationSucceeded_; Clauses backupClauses_; unordered_map originClausesMap_; unordered_map explanationMap_; - bool compilationSucceeded_; }; #endif // HORUS_LIFTEDCIRCUIT_H diff --git a/packages/CLPBN/horus/LiftedOperations.h b/packages/CLPBN/horus/LiftedOperations.h index 1e21f317c..fc25363d3 100644 --- a/packages/CLPBN/horus/LiftedOperations.h +++ b/packages/CLPBN/horus/LiftedOperations.h @@ -8,19 +8,20 @@ class LiftedOperations public: static void shatterAgainstQuery ( ParfactorList& pfList, const Grounds& query); - + static void runWeakBayesBall ( ParfactorList& pfList, const Grounds&); - + static void absorveEvidence ( ParfactorList& pfList, ObservedFormulas& obsFormulas); - + static Parfactors countNormalize (Parfactor*, const LogVarSet&); static Parfactor calcGroundMultiplication (Parfactor pf); private: - static Parfactors absorve (ObservedFormula&, Parfactor*); + static Parfactors absorve (ObservedFormula&, Parfactor*); }; #endif // HORUS_LIFTEDOPERATIONS_H + diff --git a/packages/CLPBN/horus/LiftedUtils.h b/packages/CLPBN/horus/LiftedUtils.h index 458afdf7d..1f563eaf7 100644 --- a/packages/CLPBN/horus/LiftedUtils.h +++ b/packages/CLPBN/horus/LiftedUtils.h @@ -149,7 +149,7 @@ class Substitution { return Util::contains (subs_, X); } - + size_t nrReplacements (void) const { return subs_.size(); } LogVars getDiscardedLogVars (void) const; diff --git a/packages/CLPBN/horus/LiftedWCNF.cpp b/packages/CLPBN/horus/LiftedWCNF.cpp index b2272b6d6..c62ead03d 100644 --- a/packages/CLPBN/horus/LiftedWCNF.cpp +++ b/packages/CLPBN/horus/LiftedWCNF.cpp @@ -108,7 +108,7 @@ Clause::containsPositiveLiteral ( } - + bool Clause::containsNegativeLiteral ( LiteralId lid, @@ -427,7 +427,7 @@ LiftedWCNF::LiftedWCNF (const ParfactorList& pfList) c2->addLiteralComplemented (Literal (1, {1,0})); clauses_.push_back(c2); */ - + if (Globals::verbosity > 1) { cout << "FORMULA INDICATORS:" << endl; printFormulaIndicators(); @@ -631,7 +631,7 @@ LiftedWCNF::printWeights (void) const unordered_map>::const_iterator it; it = weights_.begin(); while (it != weights_.end()) { - cout << "λ" << it->first << " weights: " ; + cout << "λ" << it->first << " weights: " ; cout << it->second.first << " " << it->second.second; cout << endl; ++ it; diff --git a/packages/CLPBN/horus/LiftedWCNF.h b/packages/CLPBN/horus/LiftedWCNF.h index 92f07d192..68c169ce0 100644 --- a/packages/CLPBN/horus/LiftedWCNF.h +++ b/packages/CLPBN/horus/LiftedWCNF.h @@ -33,19 +33,19 @@ class Literal LiteralId lid (void) const { return lid_; } LogVars logVars (void) const { return logVars_; } - - size_t nrLogVars (void) const { return logVars_.size(); } + + size_t nrLogVars (void) const { return logVars_.size(); } LogVarSet logVarSet (void) const { return LogVarSet (logVars_); } - + void complement (void) { negated_ = !negated_; } bool isPositive (void) const { return negated_ == false; } bool isNegative (void) const { return negated_; } - + bool isGround (ConstraintTree constr, LogVarSet ipgLogVars) const; - + size_t indexOfLogVar (LogVar X) const; string toString (LogVarSet ipgLogVars = LogVarSet(), @@ -74,9 +74,9 @@ class Clause void addLiteral (const Literal& l) { literals_.push_back (l); } const Literals& literals (void) const { return literals_; } - + Literals& literals (void) { return literals_; } - + size_t nrLiterals (void) const { return literals_.size(); } const ConstraintTree& constr (void) const { return constr_; } @@ -100,7 +100,7 @@ class Clause unsigned nrPosCountedLogVars (void) const { return posCountedLvs_.size(); } unsigned nrNegCountedLogVars (void) const { return negCountedLvs_.size(); } - + void addLiteralComplemented (const Literal& lit); bool containsLiteral (LiteralId lid) const; @@ -119,8 +119,8 @@ class Clause bool isPositiveCountedLogVar (LogVar X) const; - bool isNegativeCountedLogVar (LogVar X) const; - + bool isNegativeCountedLogVar (LogVar X) const; + bool isIpgLogVar (LogVar X) const; TinySet lidSet (void) const; @@ -130,13 +130,13 @@ class Clause LogVarTypes logVarTypes (size_t litIdx) const; void removeLiteral (size_t litIdx); - + static bool independentClauses (Clause& c1, Clause& c2); - - static vector copyClauses (const vector& clauses); + + static vector copyClauses (const vector& clauses); static void printClauses (const vector& clauses); - + friend std::ostream& operator<< (ostream &os, const Clause& clause); private: @@ -171,14 +171,14 @@ class LitLvTypes return false; } }; - + LitLvTypes (LiteralId lid, const LogVarTypes& lvTypes) : lid_(lid), lvTypes_(lvTypes) { } - + LiteralId lid (void) const { return lid_; } - + const LogVarTypes& logVarTypes (void) const { return lvTypes_; } - + void setAllFullLogVars (void) { std::fill (lvTypes_.begin(), lvTypes_.end(), LogVarType::FULL_LV); } @@ -228,7 +228,7 @@ class LiftedWCNF Clauses clauses_; LiteralId freeLiteralId_; - const ParfactorList& pfList_; + const ParfactorList& pfList_; unordered_map> map_; unordered_map> weights_; }; diff --git a/packages/CLPBN/horus/Makefile.in b/packages/CLPBN/horus/Makefile.in index 59936c776..61a72d553 100644 --- a/packages/CLPBN/horus/Makefile.in +++ b/packages/CLPBN/horus/Makefile.in @@ -23,10 +23,10 @@ CC=@CC@ CXX=@CXX@ # normal -#CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../.. -I$(srcdir)/../../../include @CPPFLAGS@ -DNDEBUG +CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../.. -I$(srcdir)/../../../include @CPPFLAGS@ -DNDEBUG # debug -CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../.. -I$(srcdir)/../../../include @CPPFLAGS@ -g -O0 -Wextra +#CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../.. -I$(srcdir)/../../../include @CPPFLAGS@ -g -O0 -Wextra # @@ -57,13 +57,13 @@ HEADERS = \ $(srcdir)/Horus.h \ $(srcdir)/Indexer.h \ $(srcdir)/LiftedBp.h \ - $(srcdir)/LiftedCircuit.h \ - $(srcdir)/LiftedKc.h \ - $(srcdir)/LiftedOperations.h \ - $(srcdir)/LiftedSolver.h \ + $(srcdir)/LiftedCircuit.h \ + $(srcdir)/LiftedKc.h \ + $(srcdir)/LiftedOperations.h \ + $(srcdir)/LiftedSolver.h \ $(srcdir)/LiftedUtils.h \ $(srcdir)/LiftedVe.h \ - $(srcdir)/LiftedWCNF.h \ + $(srcdir)/LiftedWCNF.h \ $(srcdir)/Parfactor.h \ $(srcdir)/ParfactorList.h \ $(srcdir)/ProbFormula.h \ @@ -73,7 +73,7 @@ HEADERS = \ $(srcdir)/Var.h \ $(srcdir)/VarElim.h \ $(srcdir)/WeightedBp.h - + CPP_SOURCES = \ $(srcdir)/BayesBall.cpp \ $(srcdir)/BayesBallGraph.cpp \ @@ -87,12 +87,12 @@ CPP_SOURCES = \ $(srcdir)/HorusCli.cpp \ $(srcdir)/HorusYap.cpp \ $(srcdir)/LiftedBp.cpp \ - $(srcdir)/LiftedCircuit.cpp \ - $(srcdir)/LiftedKc.cpp \ - $(srcdir)/LiftedOperations.cpp \ + $(srcdir)/LiftedCircuit.cpp \ + $(srcdir)/LiftedKc.cpp \ + $(srcdir)/LiftedOperations.cpp \ $(srcdir)/LiftedUtils.cpp \ $(srcdir)/LiftedVe.cpp \ - $(srcdir)/LiftedWCNF.cpp \ + $(srcdir)/LiftedWCNF.cpp \ $(srcdir)/Parfactor.cpp \ $(srcdir)/ParfactorList.cpp \ $(srcdir)/ProbFormula.cpp \ @@ -114,12 +114,12 @@ OBJS = \ Histogram.o \ HorusYap.o \ LiftedBp.o \ - LiftedCircuit.o \ - LiftedKc.o \ - LiftedOperations.o \ + LiftedCircuit.o \ + LiftedKc.o \ + LiftedOperations.o \ LiftedUtils.o \ LiftedVe.o \ - LiftedWCNF.o \ + LiftedWCNF.o \ ProbFormula.o \ Parfactor.o \ ParfactorList.o \ @@ -178,8 +178,8 @@ depend: $(HEADERS) $(CPP_SOURCES) -@if test "$(GCC)" = yes; then\ $(CC) -std=c++0x -MM -MG $(CFLAGS) -I$(srcdir) -I$(srcdir)/../../../../include -I$(srcdir)/../../../../H $(CPP_SOURCES) >> Makefile;\ else\ - makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../../../H -I$(srcdir)/../../../../include -- $(CPP_SOURCES) |\ - sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\ + makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../../../H -I$(srcdir)/../../../../include -- $(CPP_SOURCES) |\ + sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\ fi # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/packages/CLPBN/horus/Parfactor.h b/packages/CLPBN/horus/Parfactor.h index 5f6aec550..1c65c2ea0 100644 --- a/packages/CLPBN/horus/Parfactor.h +++ b/packages/CLPBN/horus/Parfactor.h @@ -33,21 +33,21 @@ class Parfactor : public TFactor const ConstraintTree* constr (void) const { return constr_; } const LogVars& logVars (void) const { return constr_->logVars(); } - + const LogVarSet& logVarSet (void) const { return constr_->logVarSet(); } LogVarSet countedLogVars (void) const; LogVarSet uncountedLogVars (void) const; - + LogVarSet elimLogVars (void) const; - + LogVarSet exclusiveLogVars (size_t fIdx) const; - + void sumOutIndex (size_t fIdx); void multiply (Parfactor&); - + bool canCountConvert (LogVar X); void countConvert (LogVar); @@ -75,7 +75,7 @@ class Parfactor : public TFactor bool containsGroup (PrvGroup) const; bool containsGroups (vector) const; - + unsigned nrFormulas (LogVar) const; int indexOfLogVar (LogVar) const; @@ -99,7 +99,7 @@ class Parfactor : public TFactor static bool canMultiply (Parfactor*, Parfactor*); private: - + void simplifyCountingFormulas (size_t fIdx); void simplifyParfactor (size_t fIdx1, size_t fIdx2); @@ -113,7 +113,7 @@ class Parfactor : public TFactor static void alignAndExponentiate (Parfactor*, Parfactor*); static void alignLogicalVars (Parfactor*, Parfactor*); - + ConstraintTree* constr_; }; diff --git a/packages/CLPBN/horus/ParfactorList.cpp b/packages/CLPBN/horus/ParfactorList.cpp index b4496a683..7e829a6d0 100644 --- a/packages/CLPBN/horus/ParfactorList.cpp +++ b/packages/CLPBN/horus/ParfactorList.cpp @@ -221,7 +221,7 @@ ParfactorList::isShattered ( } - + void ParfactorList::addToShatteredList (Parfactor* g) { @@ -481,7 +481,7 @@ ParfactorList::shatter ( ConstraintTree* commCt2 = split2.first; ConstraintTree* exclCt2 = split2.second; - assert (commCt1->tupleSet (f1.logVars()) == + assert (commCt1->tupleSet (f1.logVars()) == commCt2->tupleSet (f2.logVars())); // stringstream ss1; ss1 << "" << count << "_A.dot" ; diff --git a/packages/CLPBN/horus/ParfactorList.h b/packages/CLPBN/horus/ParfactorList.h index 48008b253..1c6404dcb 100644 --- a/packages/CLPBN/horus/ParfactorList.h +++ b/packages/CLPBN/horus/ParfactorList.h @@ -56,11 +56,10 @@ class ParfactorList bool isAllShattered (void) const; void print (void) const; - + ParfactorList& operator= (const ParfactorList& pfList); private: - bool isShattered (const Parfactor*) const; bool isShattered (const Parfactor*, const Parfactor*) const; @@ -73,7 +72,7 @@ class ParfactorList Parfactors shatterAgainstMySelf ( Parfactor* g, size_t fIdx1, size_t fIdx2); - + std::pair shatter ( Parfactor*, Parfactor*); diff --git a/packages/CLPBN/horus/ProbFormula.h b/packages/CLPBN/horus/ProbFormula.h index 61b016288..63086266a 100644 --- a/packages/CLPBN/horus/ProbFormula.h +++ b/packages/CLPBN/horus/ProbFormula.h @@ -30,11 +30,11 @@ class ProbFormula const LogVars& logVars (void) const { return logVars_; } LogVarSet logVarSet (void) const { return LogVarSet (logVars_); } - + PrvGroup group (void) const { return group_; } void setGroup (PrvGroup g) { group_ = g; } - + bool sameSkeletonAs (const ProbFormula&) const; bool contains (LogVar) const; @@ -48,20 +48,20 @@ class ProbFormula bool isCounting (void) const; LogVar countedLogVar (void) const; - + void setCountedLogVar (LogVar); void clearCountedLogVar (void); - + void rename (LogVar, LogVar); - + static PrvGroup getNewGroup (void); friend std::ostream& operator<< (ostream &os, const ProbFormula& f); friend bool operator== (const ProbFormula& f1, const ProbFormula& f2); - private: + private: Symbol functor_; LogVars logVars_; unsigned range_; diff --git a/packages/CLPBN/horus/TinySet.h b/packages/CLPBN/horus/TinySet.h index ed810bcde..4b3c4bd83 100644 --- a/packages/CLPBN/horus/TinySet.h +++ b/packages/CLPBN/horus/TinySet.h @@ -225,7 +225,7 @@ class TinySet typename vector::size_type i; for (i = 0; i < s.size(); i++) { out << ((i != 0) ? "," : "") << s.vec_[i]; - } + } out << "}" ; return out; } diff --git a/packages/CLPBN/horus/VarElim.cpp b/packages/CLPBN/horus/VarElim.cpp index b2c4dc4ec..fb4eecf50 100644 --- a/packages/CLPBN/horus/VarElim.cpp +++ b/packages/CLPBN/horus/VarElim.cpp @@ -79,7 +79,7 @@ VarElim::createFactorList (void) it->second.push_back (i); } } -} +} diff --git a/packages/CLPBN/horus/WeightedBp.h b/packages/CLPBN/horus/WeightedBp.h index 844011ab5..7794fd509 100644 --- a/packages/CLPBN/horus/WeightedBp.h +++ b/packages/CLPBN/horus/WeightedBp.h @@ -22,7 +22,7 @@ class WeightedLink : public BpLink swap (currMsg_, nextMsg_); LogAware::pow (pwdMsg_, weight_); } - + private: size_t index_; unsigned weight_; @@ -33,13 +33,13 @@ class WeightedLink : public BpLink class WeightedBp : public BeliefProp { - public: + public: WeightedBp (const FactorGraph& fg, const vector>& weights) : BeliefProp (fg), weights_(weights) { } ~WeightedBp (void); - + Params getPosterioriOf (VarId); private: @@ -53,7 +53,7 @@ class WeightedBp : public BeliefProp Params getVarToFactorMsg (const BpLink*) const; void printLinkInformation (void) const; - + vector> weights_; };