Change namespace name to be in Pascal case

This commit is contained in:
Tiago Gomes 2013-02-08 21:12:46 +00:00
parent 6a1a209ee3
commit e178c1af04
52 changed files with 146 additions and 146 deletions

View File

@ -3,7 +3,7 @@
#include "BayesBall.h" #include "BayesBall.h"
namespace horus { namespace Horus {
BayesBall::BayesBall (FactorGraph& fg) BayesBall::BayesBall (FactorGraph& fg)
: fg_(fg) , dag_(fg.getStructure()) : fg_(fg) , dag_(fg.getStructure())
@ -95,5 +95,5 @@ BayesBall::constructGraph (FactorGraph* fg) const
} }
} }
} // namespace horus } // namespace Horus

View File

@ -9,7 +9,7 @@
#include "BayesBallGraph.h" #include "BayesBallGraph.h"
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
struct ScheduleInfo struct ScheduleInfo
{ {
@ -70,7 +70,7 @@ BayesBall::scheduleChilds (const BBNode* n, Scheduling& sch) const
} }
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_BAYESBALL_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_BAYESBALL_H_

View File

@ -8,7 +8,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
void void
BayesBallGraph::addNode (BBNode* n) BayesBallGraph::addNode (BBNode* n)
@ -105,5 +105,5 @@ BayesBallGraph::exportToGraphViz (const char* fileName)
out.close(); out.close();
} }
} // namespace horus } // namespace Horus

View File

@ -7,7 +7,7 @@
#include "Var.h" #include "Var.h"
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class BBNode : public Var class BBNode : public Var
{ {
@ -78,7 +78,7 @@ class BayesBallGraph
std::unordered_map<VarId, BBNode*> varMap_; std::unordered_map<VarId, BBNode*> varMap_;
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_BAYESBALLGRAPH_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_BAYESBALLGRAPH_H_

View File

@ -9,7 +9,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
BpLink::BpLink (FacNode* fn, VarNode* vn) BpLink::BpLink (FacNode* fn, VarNode* vn)
{ {
@ -572,5 +572,5 @@ BeliefProp::printLinkInformation (void) const
} }
} }
} // namespace horus } // namespace Horus

View File

@ -9,7 +9,7 @@
#include "FactorGraph.h" #include "FactorGraph.h"
namespace horus { namespace Horus {
enum MsgSchedule { enum MsgSchedule {
SEQ_FIXED, SEQ_FIXED,
@ -170,7 +170,7 @@ BeliefProp::ninf (const FacNode* fac) const
return facsI_[fac->getIndex()]; return facsI_[fac->getIndex()];
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_BELIEFPROP_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_BELIEFPROP_H_

View File

@ -7,7 +7,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
void void
CTNode::mergeSubtree (CTNode* n, bool updateLevels) CTNode::mergeSubtree (CTNode* n, bool updateLevels)
@ -1188,5 +1188,5 @@ ConstraintTree::split (
} }
} }
} // namespace horus } // namespace Horus

View File

@ -12,7 +12,7 @@
#include "LiftedUtils.h" #include "LiftedUtils.h"
namespace horus { namespace Horus {
class CTNode; class CTNode;
class ConstraintTree; class ConstraintTree;
@ -244,7 +244,7 @@ ConstraintTree::nrLogVars (void) const
assert (LogVarSet (logVars_) == logVarSet_); assert (LogVarSet (logVars_) == logVarSet_);
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_CONSTRAINTTREE_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_CONSTRAINTTREE_H_

View File

@ -7,7 +7,7 @@
#include "WeightedBp.h" #include "WeightedBp.h"
namespace horus { namespace Horus {
bool CountingBp::fif_ = true; bool CountingBp::fif_ = true;
@ -429,5 +429,5 @@ CountingBp::printGroups (
} }
} }
} // namespace horus } // namespace Horus

View File

@ -9,7 +9,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class VarCluster; class VarCluster;
class FacCluster; class FacCluster;
@ -38,14 +38,14 @@ inline size_t hash_combine (size_t seed, const T& v)
return seed ^ (std::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2)); return seed ^ (std::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2));
} }
} // namespace horus } // namespace Horus
namespace std { namespace std {
template <typename T1, typename T2> struct hash<std::pair<T1,T2>> { template <typename T1, typename T2> struct hash<std::pair<T1,T2>> {
size_t operator() (const std::pair<T1,T2>& p) const { size_t operator() (const std::pair<T1,T2>& p) const {
return horus::hash_combine (std::hash<T1>()(p.first), p.second); return Horus::hash_combine (std::hash<T1>()(p.first), p.second);
}}; }};
template <typename T> struct hash<std::vector<T>> template <typename T> struct hash<std::vector<T>>
@ -56,7 +56,7 @@ template <typename T> struct hash<std::vector<T>>
typename std::vector<T>::const_iterator first = vec.begin(); typename std::vector<T>::const_iterator first = vec.begin();
typename std::vector<T>::const_iterator last = vec.end(); typename std::vector<T>::const_iterator last = vec.end();
for (; first != last; ++first) { for (; first != last; ++first) {
h = horus::hash_combine (h, *first); h = Horus::hash_combine (h, *first);
} }
return h; return h;
} }
@ -65,7 +65,7 @@ template <typename T> struct hash<std::vector<T>>
} // namespace std } // namespace std
namespace horus { namespace Horus {
class VarCluster class VarCluster
{ {
@ -217,7 +217,7 @@ CountingBp::setColor (const FacNode* fn, Color c)
facColors_[fn->getIndex()] = c; facColors_[fn->getIndex()] = c;
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_COUNTINGBP_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_COUNTINGBP_H_

View File

@ -4,7 +4,7 @@
#include "ElimGraph.h" #include "ElimGraph.h"
namespace horus { namespace Horus {
ElimHeuristic ElimGraph::elimHeuristic_ = MIN_NEIGHBORS; ElimHeuristic ElimGraph::elimHeuristic_ = MIN_NEIGHBORS;
@ -241,5 +241,5 @@ ElimGraph::connectAllNeighbors (const EgNode* n)
} }
} }
} // namespace horus } // namespace Horus

View File

@ -11,7 +11,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class EgNode; class EgNode;
@ -173,7 +173,7 @@ ElimGraph::neighbors (EgNode* n1, EgNode* n2) const
return n1->isNeighbor (n2); return n1->isNeighbor (n2);
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_ELIMGRAPH_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_ELIMGRAPH_H_

View File

@ -8,7 +8,7 @@
#include "Var.h" #include "Var.h"
namespace horus { namespace Horus {
Factor::Factor (const Factor& g) Factor::Factor (const Factor& g)
{ {
@ -235,5 +235,5 @@ Factor::clone (const Factor& g)
distId_ = g.distId(); distId_ = g.distId();
} }
} // namespace horus } // namespace Horus

View File

@ -10,7 +10,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
template <typename T> template <typename T>
class TFactor class TFactor
@ -366,7 +366,7 @@ class Factor : public TFactor<VarId>
DISALLOW_ASSIGN (Factor); DISALLOW_ASSIGN (Factor);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_

View File

@ -8,7 +8,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
bool FactorGraph::exportLd_ = false; bool FactorGraph::exportLd_ = false;
bool FactorGraph::exportUai_ = false; bool FactorGraph::exportUai_ = false;
@ -482,5 +482,5 @@ FactorGraph::containsCycle (
return false; // no cycle detected in this component return false; // no cycle detected in this component
} }
} // namespace horus } // namespace Horus

View File

@ -11,7 +11,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class FacNode; class FacNode;
@ -180,7 +180,7 @@ struct sortByVarId {
return vn1->varId() < vn2->varId(); return vn1->varId() < vn2->varId();
}}; }};
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_FACTORGRAPH_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_FACTORGRAPH_H_

View File

@ -11,7 +11,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
void void
GroundSolver::printAnswer (const VarIds& vids) GroundSolver::printAnswer (const VarIds& vids)
@ -114,5 +114,5 @@ GroundSolver::getJointByConditioning (
return prevBeliefs; return prevBeliefs;
} }
} // namespace horus } // namespace Horus

View File

@ -5,7 +5,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class GroundSolver class GroundSolver
{ {
@ -32,7 +32,7 @@ class GroundSolver
DISALLOW_COPY_AND_ASSIGN (GroundSolver); DISALLOW_COPY_AND_ASSIGN (GroundSolver);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_GROUNDSOLVER_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_GROUNDSOLVER_H_

View File

@ -7,7 +7,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
HistogramSet::HistogramSet (unsigned size, unsigned range) HistogramSet::HistogramSet (unsigned size, unsigned range)
{ {
@ -147,5 +147,5 @@ operator<< (std::ostream& os, const HistogramSet& hs)
return os; return os;
} }
} // namespace horus } // namespace Horus

View File

@ -9,7 +9,7 @@
typedef std::vector<unsigned> Histogram; typedef std::vector<unsigned> Histogram;
namespace horus { namespace Horus {
class HistogramSet class HistogramSet
{ {
@ -46,7 +46,7 @@ class HistogramSet
DISALLOW_COPY_AND_ASSIGN (HistogramSet); DISALLOW_COPY_AND_ASSIGN (HistogramSet);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_HISTOGRAM_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_HISTOGRAM_H_

View File

@ -15,7 +15,7 @@
#include <string> #include <string>
namespace horus { namespace Horus {
class Var; class Var;
class Factor; class Factor;
@ -75,7 +75,7 @@ const unsigned PRECISION = 6;
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_HORUS_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_HORUS_H_

View File

@ -11,12 +11,12 @@
int readHorusFlags (int, const char* []); int readHorusFlags (int, const char* []);
void readFactorGraph (horus::FactorGraph&, const char*); void readFactorGraph (Horus::FactorGraph&, const char*);
horus::VarIds readQueryAndEvidence ( Horus::VarIds readQueryAndEvidence (
horus::FactorGraph&, int, const char* [], int); Horus::FactorGraph&, int, const char* [], int);
void runSolver (const horus::FactorGraph&, const horus::VarIds&); void runSolver (const Horus::FactorGraph&, const Horus::VarIds&);
const std::string USAGE = "usage: ./hcli [solver=hve|bp|cbp] \ const std::string USAGE = "usage: ./hcli [solver=hve|bp|cbp] \
[<OPTION>=<VALUE>]... <FILE> [<VAR>|<VAR>=<EVIDENCE>]... " ; [<OPTION>=<VALUE>]... <FILE> [<VAR>|<VAR>=<EVIDENCE>]... " ;
@ -31,23 +31,23 @@ main (int argc, const char* argv[])
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
int idx = readHorusFlags (argc, argv); int idx = readHorusFlags (argc, argv);
horus::FactorGraph fg; Horus::FactorGraph fg;
readFactorGraph (fg, argv[idx]); readFactorGraph (fg, argv[idx]);
horus::VarIds queryIds Horus::VarIds queryIds
= readQueryAndEvidence (fg, argc, argv, idx + 1); = readQueryAndEvidence (fg, argc, argv, idx + 1);
if (horus::FactorGraph::exportToLibDai()) { if (Horus::FactorGraph::exportToLibDai()) {
fg.exportToLibDai ("model.fg"); fg.exportToLibDai ("model.fg");
} }
if (horus::FactorGraph::exportToUai()) { if (Horus::FactorGraph::exportToUai()) {
fg.exportToUai ("model.uai"); fg.exportToUai ("model.uai");
} }
if (horus::FactorGraph::exportGraphViz()) { if (Horus::FactorGraph::exportGraphViz()) {
fg.exportToGraphViz ("model.dot"); fg.exportToGraphViz ("model.dot");
} }
if (horus::FactorGraph::printFactorGraph()) { if (Horus::FactorGraph::printFactorGraph()) {
fg.print(); fg.print();
} }
if (horus::Globals::verbosity > 0) { if (Horus::Globals::verbosity > 0) {
std::cout << "factor graph contains " ; std::cout << "factor graph contains " ;
std::cout << fg.nrVarNodes() << " variables and " ; std::cout << fg.nrVarNodes() << " variables and " ;
std::cout << fg.nrFacNodes() << " factors " << std::endl; std::cout << fg.nrFacNodes() << " factors " << std::endl;
@ -80,7 +80,7 @@ readHorusFlags (int argc, const char* argv[])
std::cerr << USAGE << std::endl; std::cerr << USAGE << std::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
horus::Util::setHorusFlag (leftArg, rightArg); Horus::Util::setHorusFlag (leftArg, rightArg);
} }
return i + 1; return i + 1;
} }
@ -88,7 +88,7 @@ readHorusFlags (int argc, const char* argv[])
void void
readFactorGraph (horus::FactorGraph& fg, const char* s) readFactorGraph (Horus::FactorGraph& fg, const char* s)
{ {
std::string fileName (s); std::string fileName (s);
std::string extension = fileName.substr (fileName.find_last_of ('.') + 1); std::string extension = fileName.substr (fileName.find_last_of ('.') + 1);
@ -105,25 +105,25 @@ readFactorGraph (horus::FactorGraph& fg, const char* s)
horus::VarIds Horus::VarIds
readQueryAndEvidence ( readQueryAndEvidence (
horus::FactorGraph& fg, Horus::FactorGraph& fg,
int argc, int argc,
const char* argv[], const char* argv[],
int start) int start)
{ {
horus::VarIds queryIds; Horus::VarIds queryIds;
for (int i = start; i < argc; i++) { for (int i = start; i < argc; i++) {
const std::string& arg = argv[i]; const std::string& arg = argv[i];
if (arg.find ('=') == std::string::npos) { if (arg.find ('=') == std::string::npos) {
if (horus::Util::isInteger (arg) == false) { if (Horus::Util::isInteger (arg) == false) {
std::cerr << "Error: `" << arg << "' " ; std::cerr << "Error: `" << arg << "' " ;
std::cerr << "is not a variable id." ; std::cerr << "is not a variable id." ;
std::cerr << std::endl; std::cerr << std::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
horus::VarId vid = horus::Util::stringToUnsigned (arg); Horus::VarId vid = Horus::Util::stringToUnsigned (arg);
horus::VarNode* queryVar = fg.getVarNode (vid); Horus::VarNode* queryVar = fg.getVarNode (vid);
if (queryVar == false) { if (queryVar == false) {
std::cerr << "Error: unknow variable with id " ; std::cerr << "Error: unknow variable with id " ;
std::cerr << "`" << vid << "'." << std::endl; std::cerr << "`" << vid << "'." << std::endl;
@ -139,13 +139,13 @@ readQueryAndEvidence (
std::cerr << USAGE << std::endl; std::cerr << USAGE << std::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
if (horus::Util::isInteger (leftArg) == false) { if (Horus::Util::isInteger (leftArg) == false) {
std::cerr << "Error: `" << leftArg << "' " ; std::cerr << "Error: `" << leftArg << "' " ;
std::cerr << "is not a variable id." << std::endl; std::cerr << "is not a variable id." << std::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
horus::VarId vid = horus::Util::stringToUnsigned (leftArg); Horus::VarId vid = Horus::Util::stringToUnsigned (leftArg);
horus::VarNode* observedVar = fg.getVarNode (vid); Horus::VarNode* observedVar = fg.getVarNode (vid);
if (observedVar == false) { if (observedVar == false) {
std::cerr << "Error: unknow variable with id " ; std::cerr << "Error: unknow variable with id " ;
std::cerr << "`" << vid << "'." << std::endl; std::cerr << "`" << vid << "'." << std::endl;
@ -156,12 +156,12 @@ readQueryAndEvidence (
std::cerr << USAGE << std::endl; std::cerr << USAGE << std::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
if (horus::Util::isInteger (rightArg) == false) { if (Horus::Util::isInteger (rightArg) == false) {
std::cerr << "Error: `" << rightArg << "' " ; std::cerr << "Error: `" << rightArg << "' " ;
std::cerr << "is not a state index." << std::endl; std::cerr << "is not a state index." << std::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
unsigned stateIdx = horus::Util::stringToUnsigned (rightArg); unsigned stateIdx = Horus::Util::stringToUnsigned (rightArg);
if (observedVar->isValidState (stateIdx) == false) { if (observedVar->isValidState (stateIdx) == false) {
std::cerr << "Error: `" << stateIdx << "' " ; std::cerr << "Error: `" << stateIdx << "' " ;
std::cerr << "is not a valid state index for variable with id " ; std::cerr << "is not a valid state index for variable with id " ;
@ -178,24 +178,24 @@ readQueryAndEvidence (
void void
runSolver ( runSolver (
const horus::FactorGraph& fg, const Horus::FactorGraph& fg,
const horus::VarIds& queryIds) const Horus::VarIds& queryIds)
{ {
horus::GroundSolver* solver = 0; Horus::GroundSolver* solver = 0;
switch (horus::Globals::groundSolver) { switch (Horus::Globals::groundSolver) {
case horus::GroundSolverType::VE: case Horus::GroundSolverType::VE:
solver = new horus::VarElim (fg); solver = new Horus::VarElim (fg);
break; break;
case horus::GroundSolverType::BP: case Horus::GroundSolverType::BP:
solver = new horus::BeliefProp (fg); solver = new Horus::BeliefProp (fg);
break; break;
case horus::GroundSolverType::CBP: case Horus::GroundSolverType::CBP:
solver = new horus::CountingBp (fg); solver = new Horus::CountingBp (fg);
break; break;
default: default:
assert (false); assert (false);
} }
if (horus::Globals::verbosity > 0) { if (Horus::Globals::verbosity > 0) {
solver->printSolverFlags(); solver->printSolverFlags();
std::cout << std::endl; std::cout << std::endl;
} }

View File

@ -20,7 +20,7 @@
#include "ElimGraph.h" #include "ElimGraph.h"
#include "BayesBall.h" #include "BayesBall.h"
namespace horus { namespace Horus {
typedef std::pair<ParfactorList*, ObservedFormulas*> LiftedNetwork; typedef std::pair<ParfactorList*, ObservedFormulas*> LiftedNetwork;
@ -582,5 +582,5 @@ init_predicates (void)
freeGroundNetwork, 1); freeGroundNetwork, 1);
} }
} // namespace horus } // namespace Horus

View File

@ -10,7 +10,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
class Indexer class Indexer
{ {
@ -363,7 +363,7 @@ operator<< (std::ostream &os, const MapIndexer& indexer)
return os; return os;
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_INDEXER_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_INDEXER_H_

View File

@ -8,7 +8,7 @@
#include "FactorGraph.h" #include "FactorGraph.h"
namespace horus { namespace Horus {
LiftedBp::LiftedBp (const ParfactorList& parfactorList) LiftedBp::LiftedBp (const ParfactorList& parfactorList)
: LiftedSolver (parfactorList) : LiftedSolver (parfactorList)
@ -237,5 +237,5 @@ LiftedBp::getJointByConditioning (
return prevBeliefs; return prevBeliefs;
} }
} // namespace horus } // namespace Horus

View File

@ -7,7 +7,7 @@
#include "ParfactorList.h" #include "ParfactorList.h"
namespace horus { namespace Horus {
class FactorGraph; class FactorGraph;
class WeightedBp; class WeightedBp;
@ -45,7 +45,7 @@ class LiftedBp : public LiftedSolver
DISALLOW_COPY_AND_ASSIGN (LiftedBp); DISALLOW_COPY_AND_ASSIGN (LiftedBp);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDBP_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDBP_H_

View File

@ -7,7 +7,7 @@
#include "Indexer.h" #include "Indexer.h"
namespace horus { namespace Horus {
OrNode::~OrNode (void) OrNode::~OrNode (void)
{ {
@ -1318,5 +1318,5 @@ LiftedKc::printSolverFlags (void) const
std::cout << ss.str() << std::endl; std::cout << ss.str() << std::endl;
} }
} // namespace horus } // namespace Horus

View File

@ -11,7 +11,7 @@
#include "ParfactorList.h" #include "ParfactorList.h"
namespace horus { namespace Horus {
enum CircuitNodeType { enum CircuitNodeType {
OR_NODE, OR_NODE,
@ -305,7 +305,7 @@ class LiftedKc : public LiftedSolver
DISALLOW_COPY_AND_ASSIGN (LiftedKc); DISALLOW_COPY_AND_ASSIGN (LiftedKc);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDKC_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDKC_H_

View File

@ -5,7 +5,7 @@
#include "LiftedOperations.h" #include "LiftedOperations.h"
namespace horus { namespace Horus {
void void
LiftedOperations::shatterAgainstQuery ( LiftedOperations::shatterAgainstQuery (
@ -275,5 +275,5 @@ LiftedOperations::absorve (
return absorvedPfs; return absorvedPfs;
} }
} // namespace horus } // namespace Horus

View File

@ -4,7 +4,7 @@
#include "ParfactorList.h" #include "ParfactorList.h"
namespace horus { namespace Horus {
class LiftedOperations class LiftedOperations
{ {
@ -28,7 +28,7 @@ class LiftedOperations
DISALLOW_COPY_AND_ASSIGN (LiftedOperations); DISALLOW_COPY_AND_ASSIGN (LiftedOperations);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDOPERATIONS_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDOPERATIONS_H_

View File

@ -4,7 +4,7 @@
#include "ParfactorList.h" #include "ParfactorList.h"
namespace horus { namespace Horus {
class LiftedSolver class LiftedSolver
{ {
@ -25,7 +25,7 @@ class LiftedSolver
DISALLOW_COPY_AND_ASSIGN (LiftedSolver); DISALLOW_COPY_AND_ASSIGN (LiftedSolver);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDSOLVER_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDSOLVER_H_

View File

@ -5,7 +5,7 @@
#include "LiftedUtils.h" #include "LiftedUtils.h"
namespace horus { namespace Horus {
namespace LiftedUtils { namespace LiftedUtils {
@ -132,5 +132,5 @@ operator<< (std::ostream& os, const Substitution& theta)
return os; return os;
} }
} // namespace horus } // namespace Horus

View File

@ -10,7 +10,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
class Symbol class Symbol
{ {
@ -69,25 +69,25 @@ LogVar::valid (void) const
return id_ != Util::maxUnsigned(); return id_ != Util::maxUnsigned();
} }
} // namespace horus } // namespace Horus
namespace std { namespace std {
template <> struct hash<horus::Symbol> { template <> struct hash<Horus::Symbol> {
size_t operator() (const horus::Symbol& s) const { size_t operator() (const Horus::Symbol& s) const {
return std::hash<unsigned>() (s); return std::hash<unsigned>() (s);
}}; }};
template <> struct hash<horus::LogVar> { template <> struct hash<Horus::LogVar> {
size_t operator() (const horus::LogVar& X) const { size_t operator() (const Horus::LogVar& X) const {
return std::hash<unsigned>() (X); return std::hash<unsigned>() (X);
}}; }};
} // namespace std } // namespace std
namespace horus { namespace Horus {
typedef std::vector<Symbol> Symbols; typedef std::vector<Symbol> Symbols;
typedef std::vector<Symbol> Tuple; typedef std::vector<Symbol> Tuple;
@ -208,7 +208,7 @@ Substitution::nrReplacements (void) const
return subs_.size(); return subs_.size();
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDUTILS_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDUTILS_H_

View File

@ -12,7 +12,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
std::vector<LiftedOperator*> std::vector<LiftedOperator*>
LiftedOperator::getValidOps ( LiftedOperator::getValidOps (
@ -734,5 +734,5 @@ LiftedVe::getBestOperation (const Grounds& query)
return bestOp; return bestOp;
} }
} // namespace horus } // namespace Horus

View File

@ -8,7 +8,7 @@
#include "ParfactorList.h" #include "ParfactorList.h"
namespace horus { namespace Horus {
class LiftedOperator class LiftedOperator
{ {
@ -169,7 +169,7 @@ class LiftedVe : public LiftedSolver
DISALLOW_COPY_AND_ASSIGN (LiftedVe); DISALLOW_COPY_AND_ASSIGN (LiftedVe);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDVE_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDVE_H_

View File

@ -9,7 +9,7 @@
#include "Indexer.h" #include "Indexer.h"
namespace horus { namespace Horus {
bool bool
Literal::isGround ( Literal::isGround (

View File

@ -11,7 +11,7 @@
#include "LiftedUtils.h" #include "LiftedUtils.h"
namespace horus { namespace Horus {
class ParfactorList; class ParfactorList;
@ -242,7 +242,7 @@ class LiftedWCNF
DISALLOW_COPY_AND_ASSIGN (LiftedWCNF); DISALLOW_COPY_AND_ASSIGN (LiftedWCNF);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDWCNF_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDWCNF_H_

View File

@ -10,7 +10,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
Parfactor::Parfactor ( Parfactor::Parfactor (
const ProbFormulas& formulas, const ProbFormulas& formulas,
@ -948,5 +948,5 @@ Parfactor::alignLogicalVars (Parfactor* g1, Parfactor* g2)
g2->applySubstitution (theta2); g2->applySubstitution (theta2);
} }
} // namespace horus } // namespace Horus

View File

@ -11,7 +11,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class Parfactor : public TFactor<ProbFormula> class Parfactor : public TFactor<ProbFormula>
{ {
@ -122,7 +122,7 @@ class Parfactor : public TFactor<ProbFormula>
typedef std::vector<Parfactor*> Parfactors; typedef std::vector<Parfactor*> Parfactors;
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_PARFACTOR_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_PARFACTOR_H_

View File

@ -7,7 +7,7 @@
#include "ParfactorList.h" #include "ParfactorList.h"
namespace horus { namespace Horus {
ParfactorList::ParfactorList (const ParfactorList& pfList) ParfactorList::ParfactorList (const ParfactorList& pfList)
{ {
@ -646,5 +646,5 @@ ParfactorList::disjoint (
return (ts1 & ts2).empty(); return (ts1 & ts2).empty();
} }
} // namespace horus } // namespace Horus

View File

@ -7,7 +7,7 @@
#include "ProbFormula.h" #include "ProbFormula.h"
namespace horus { namespace Horus {
class Parfactor; class Parfactor;
@ -120,7 +120,7 @@ class ParfactorList
std::list<Parfactor*> pfList_; std::list<Parfactor*> pfList_;
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_PARFACTORLIST_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_PARFACTORLIST_H_

View File

@ -6,7 +6,7 @@
namespace horus { namespace Horus {
PrvGroup ProbFormula::freeGroup_ = 0; PrvGroup ProbFormula::freeGroup_ = 0;
@ -165,5 +165,5 @@ operator<< (std::ostream& os, const ObservedFormula& of)
return os; return os;
} }
} // namespace horus } // namespace Horus

View File

@ -10,7 +10,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
typedef unsigned long PrvGroup; typedef unsigned long PrvGroup;
@ -114,7 +114,7 @@ class ObservedFormula
typedef std::vector<ObservedFormula> ObservedFormulas; typedef std::vector<ObservedFormula> ObservedFormulas;
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_PROBFORMULA_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_PROBFORMULA_H_

View File

@ -6,7 +6,7 @@
#include <ostream> #include <ostream>
namespace horus { namespace Horus {
template <typename T, typename Compare = std::less<T>> template <typename T, typename Compare = std::less<T>>
class TinySet class TinySet
@ -404,7 +404,7 @@ TinySet<T,C>::consistent (void) const
return true; return true;
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_TINYSET_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_TINYSET_H_

View File

@ -4,7 +4,7 @@
#include "BeliefProp.h" #include "BeliefProp.h"
namespace horus { namespace Horus {
namespace Globals { namespace Globals {
@ -429,6 +429,6 @@ pow (Params& v, double exp)
} // namespace LogAware } // namespace LogAware
} // namespace horus } // namespace Horus

View File

@ -16,7 +16,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
namespace { namespace {
@ -424,7 +424,7 @@ struct abs_diff_exp : public std::binary_function<T, T, T> {
} // namespace func_obj } // namespace func_obj
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_UTIL_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_UTIL_H_

View File

@ -3,7 +3,7 @@
#include "Var.h" #include "Var.h"
namespace horus { namespace Horus {
std::unordered_map<VarId, VarInfo> Var::varsInfo_; std::unordered_map<VarId, VarInfo> Var::varsInfo_;
@ -110,5 +110,5 @@ Var::clearVarsInfo (void)
varsInfo_.clear(); varsInfo_.clear();
} }
} // namespace horus } // namespace Horus

View File

@ -10,7 +10,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
struct VarInfo struct VarInfo
{ {
@ -107,7 +107,7 @@ Var::operator!= (const Var& var) const
return !(*this == var); return !(*this == var);
} }
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_VAR_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_VAR_H_

View File

@ -8,7 +8,7 @@
#include "Util.h" #include "Util.h"
namespace horus { namespace Horus {
Params Params
VarElim::solveQuery (VarIds queryVids) VarElim::solveQuery (VarIds queryVids)
@ -200,5 +200,5 @@ VarElim::printActiveFactors (void)
} }
} }
} // namespace horus } // namespace Horus

View File

@ -9,7 +9,7 @@
#include "Horus.h" #include "Horus.h"
namespace horus { namespace Horus {
class VarElim : public GroundSolver class VarElim : public GroundSolver
{ {
@ -41,7 +41,7 @@ class VarElim : public GroundSolver
DISALLOW_COPY_AND_ASSIGN (VarElim); DISALLOW_COPY_AND_ASSIGN (VarElim);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_VARELIM_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_VARELIM_H_

View File

@ -4,7 +4,7 @@
#include "WeightedBp.h" #include "WeightedBp.h"
namespace horus { namespace Horus {
WeightedBp::~WeightedBp (void) WeightedBp::~WeightedBp (void)
{ {
@ -305,5 +305,5 @@ WeightedBp::printLinkInformation (void) const
} }
} }
} // namespace horus } // namespace Horus

View File

@ -6,7 +6,7 @@
#include "BeliefProp.h" #include "BeliefProp.h"
namespace horus { namespace Horus {
class WeightedLink : public BpLink class WeightedLink : public BpLink
{ {
@ -70,7 +70,7 @@ class WeightedBp : public BeliefProp
DISALLOW_COPY_AND_ASSIGN (WeightedBp); DISALLOW_COPY_AND_ASSIGN (WeightedBp);
}; };
} // namespace horus } // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_WEIGHTEDBP_H_ #endif // YAP_PACKAGES_CLPBN_HORUS_WEIGHTEDBP_H_