Add a source file for Indexer class
- Move some non-performance critical methods to the source file - Fix some implicit declarions of members in iomanip - Fix declaration order in Makefile.in
This commit is contained in:
parent
0852c4fe22
commit
ba79d2e422
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "BeliefProp.h"
|
#include "BeliefProp.h"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include "GroundSolver.h"
|
#include "GroundSolver.h"
|
||||||
#include "VarElim.h"
|
#include "VarElim.h"
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
|
#include "Indexer.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Horus {
|
||||||
|
|
||||||
|
std::ostream&
|
||||||
|
operator<< (std::ostream& os, const Indexer& indexer)
|
||||||
|
{
|
||||||
|
os << "(" ;
|
||||||
|
os << std::setw (2) << std::setfill('0') << indexer.index_;
|
||||||
|
os << ") " ;
|
||||||
|
os << indexer.indices_;
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
std::ostream&
|
||||||
|
operator<< (std::ostream &os, const MapIndexer& indexer)
|
||||||
|
{
|
||||||
|
os << "(" ;
|
||||||
|
os << std::setw (2) << std::setfill('0') << indexer.index_;
|
||||||
|
os << ") " ;
|
||||||
|
os << indexer.indices_;
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Horus
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <sstream>
|
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
|
||||||
|
@ -187,18 +185,6 @@ Indexer::calculateOffsets (void)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline std::ostream&
|
|
||||||
operator<< (std::ostream& os, const Indexer& indexer)
|
|
||||||
{
|
|
||||||
os << "(" ;
|
|
||||||
os << std::setw (2) << std::setfill('0') << indexer.index_;
|
|
||||||
os << ") " ;
|
|
||||||
os << indexer.indices_;
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MapIndexer {
|
class MapIndexer {
|
||||||
public:
|
public:
|
||||||
MapIndexer (const Ranges& ranges, const std::vector<bool>& mask);
|
MapIndexer (const Ranges& ranges, const std::vector<bool>& mask);
|
||||||
|
@ -237,7 +223,9 @@ class MapIndexer {
|
||||||
|
|
||||||
|
|
||||||
inline
|
inline
|
||||||
MapIndexer::MapIndexer (const Ranges& ranges, const std::vector<bool>& mask)
|
MapIndexer::MapIndexer (
|
||||||
|
const Ranges& ranges,
|
||||||
|
const std::vector<bool>& mask)
|
||||||
: index_(0), indices_(ranges.size(), 0), ranges_(ranges),
|
: index_(0), indices_(ranges.size(), 0), ranges_(ranges),
|
||||||
valid_(true)
|
valid_(true)
|
||||||
{
|
{
|
||||||
|
@ -349,18 +337,6 @@ MapIndexer::reset (void)
|
||||||
std::fill (indices_.begin(), indices_.end(), 0);
|
std::fill (indices_.begin(), indices_.end(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline std::ostream&
|
|
||||||
operator<< (std::ostream &os, const MapIndexer& indexer)
|
|
||||||
{
|
|
||||||
os << "(" ;
|
|
||||||
os << std::setw (2) << std::setfill('0') << indexer.index_;
|
|
||||||
os << ") " ;
|
|
||||||
os << indexer.indices_;
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Horus
|
} // namespace Horus
|
||||||
|
|
||||||
#endif // YAP_PACKAGES_CLPBN_HORUS_INDEXER_H_
|
#endif // YAP_PACKAGES_CLPBN_HORUS_INDEXER_H_
|
||||||
|
|
|
@ -54,6 +54,7 @@ HEADERS = \
|
||||||
$(srcdir)/ElimGraph.h \
|
$(srcdir)/ElimGraph.h \
|
||||||
$(srcdir)/Factor.h \
|
$(srcdir)/Factor.h \
|
||||||
$(srcdir)/FactorGraph.h \
|
$(srcdir)/FactorGraph.h \
|
||||||
|
$(srcdir)/GroundSolver.h \
|
||||||
$(srcdir)/Histogram.h \
|
$(srcdir)/Histogram.h \
|
||||||
$(srcdir)/Horus.h \
|
$(srcdir)/Horus.h \
|
||||||
$(srcdir)/Indexer.h \
|
$(srcdir)/Indexer.h \
|
||||||
|
@ -67,7 +68,6 @@ HEADERS = \
|
||||||
$(srcdir)/Parfactor.h \
|
$(srcdir)/Parfactor.h \
|
||||||
$(srcdir)/ParfactorList.h \
|
$(srcdir)/ParfactorList.h \
|
||||||
$(srcdir)/ProbFormula.h \
|
$(srcdir)/ProbFormula.h \
|
||||||
$(srcdir)/GroundSolver.h \
|
|
||||||
$(srcdir)/TinySet.h \
|
$(srcdir)/TinySet.h \
|
||||||
$(srcdir)/Util.h \
|
$(srcdir)/Util.h \
|
||||||
$(srcdir)/Var.h \
|
$(srcdir)/Var.h \
|
||||||
|
@ -83,9 +83,11 @@ CPP_SOURCES = \
|
||||||
$(srcdir)/ElimGraph.cpp \
|
$(srcdir)/ElimGraph.cpp \
|
||||||
$(srcdir)/Factor.cpp \
|
$(srcdir)/Factor.cpp \
|
||||||
$(srcdir)/FactorGraph.cpp \
|
$(srcdir)/FactorGraph.cpp \
|
||||||
|
$(srcdir)/GroundSolver.cpp \
|
||||||
$(srcdir)/Histogram.cpp \
|
$(srcdir)/Histogram.cpp \
|
||||||
$(srcdir)/HorusCli.cpp \
|
$(srcdir)/HorusCli.cpp \
|
||||||
$(srcdir)/HorusYap.cpp \
|
$(srcdir)/HorusYap.cpp \
|
||||||
|
$(srcdir)/Indexer.cpp \
|
||||||
$(srcdir)/LiftedBp.cpp \
|
$(srcdir)/LiftedBp.cpp \
|
||||||
$(srcdir)/LiftedKc.cpp \
|
$(srcdir)/LiftedKc.cpp \
|
||||||
$(srcdir)/LiftedOperations.cpp \
|
$(srcdir)/LiftedOperations.cpp \
|
||||||
|
@ -95,7 +97,6 @@ CPP_SOURCES = \
|
||||||
$(srcdir)/Parfactor.cpp \
|
$(srcdir)/Parfactor.cpp \
|
||||||
$(srcdir)/ParfactorList.cpp \
|
$(srcdir)/ParfactorList.cpp \
|
||||||
$(srcdir)/ProbFormula.cpp \
|
$(srcdir)/ProbFormula.cpp \
|
||||||
$(srcdir)/GroundSolver.cpp \
|
|
||||||
$(srcdir)/Util.cpp \
|
$(srcdir)/Util.cpp \
|
||||||
$(srcdir)/Var.cpp \
|
$(srcdir)/Var.cpp \
|
||||||
$(srcdir)/VarElim.cpp \
|
$(srcdir)/VarElim.cpp \
|
||||||
|
@ -110,8 +111,10 @@ OBJS = \
|
||||||
ElimGraph.o \
|
ElimGraph.o \
|
||||||
Factor.o \
|
Factor.o \
|
||||||
FactorGraph.o \
|
FactorGraph.o \
|
||||||
|
GroundSolver.o \
|
||||||
Histogram.o \
|
Histogram.o \
|
||||||
HorusYap.o \
|
HorusYap.o \
|
||||||
|
Indexer.o \
|
||||||
LiftedBp.o \
|
LiftedBp.o \
|
||||||
LiftedKc.o \
|
LiftedKc.o \
|
||||||
LiftedOperations.o \
|
LiftedOperations.o \
|
||||||
|
@ -121,7 +124,6 @@ OBJS = \
|
||||||
ProbFormula.o \
|
ProbFormula.o \
|
||||||
Parfactor.o \
|
Parfactor.o \
|
||||||
ParfactorList.o \
|
ParfactorList.o \
|
||||||
GroundSolver.o \
|
|
||||||
Util.o \
|
Util.o \
|
||||||
Var.o \
|
Var.o \
|
||||||
VarElim.o \
|
VarElim.o \
|
||||||
|
@ -135,8 +137,9 @@ HCLI_OBJS = \
|
||||||
ElimGraph.o \
|
ElimGraph.o \
|
||||||
Factor.o \
|
Factor.o \
|
||||||
FactorGraph.o \
|
FactorGraph.o \
|
||||||
HorusCli.o \
|
|
||||||
GroundSolver.o \
|
GroundSolver.o \
|
||||||
|
HorusCli.o \
|
||||||
|
Indexer.o \
|
||||||
Util.o \
|
Util.o \
|
||||||
Var.o \
|
Var.o \
|
||||||
VarElim.o \
|
VarElim.o \
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include "WeightedBp.h"
|
#include "WeightedBp.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Horus {
|
namespace Horus {
|
||||||
|
|
||||||
WeightedBp::~WeightedBp (void)
|
WeightedBp::~WeightedBp (void)
|
||||||
|
|
Reference in New Issue