From cefeca149b93cd80b7a1003903a5e80f85da6aa6 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 30 Oct 2009 13:03:38 +0000 Subject: [PATCH] Moved template definitions to BayesTree-inl.h --- cpp/BayesTree-inl.h | 27 +++++++++++++++++++++++++++ cpp/BayesTree.h | 6 +++--- cpp/Makefile.am | 5 +++-- cpp/testBayesTree.cpp | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 cpp/BayesTree-inl.h diff --git a/cpp/BayesTree-inl.h b/cpp/BayesTree-inl.h new file mode 100644 index 000000000..4d5dcf742 --- /dev/null +++ b/cpp/BayesTree-inl.h @@ -0,0 +1,27 @@ +/** + * @file BayesTree.cpp + * @brief Bayes Tree is a tree of cliques of a Bayes Chain + * @author Frank Dellaert + */ + +#include "BayesTree.h" + +using namespace std; + +namespace gtsam { + + template + BayesTree::BayesTree(BayesChain& bayesChain) { + } + + template + void BayesTree::print(const string& s) const { + } + + template + bool BayesTree::equals(const BayesTree& other, + double tol) const { + return false; + } + +} /// namespace gtsam diff --git a/cpp/BayesTree.h b/cpp/BayesTree.h index a81d20ef2..257fdc3bc 100644 --- a/cpp/BayesTree.h +++ b/cpp/BayesTree.h @@ -28,16 +28,16 @@ class BayesTree : public Testable > public: /** Create a Bayes Tree from a SymbolicBayesChain */ - BayesTree(BayesChain& bayesChain) {} + BayesTree(BayesChain& bayesChain); /** Destructor */ virtual ~BayesTree() {} /** print */ - void print(const std::string& s = "") const {} + void print(const std::string& s = "") const; /** check equality */ - bool equals(const BayesTree& other, double tol = 1e-9) const { return false; } + bool equals(const BayesTree& other, double tol = 1e-9) const; }; // BayesTree diff --git a/cpp/Makefile.am b/cpp/Makefile.am index ee997020c..885e9c9d2 100644 --- a/cpp/Makefile.am +++ b/cpp/Makefile.am @@ -86,7 +86,7 @@ timeLinearFactor: LDFLAGS += -L.libs -lgtsam # graphs sources += SymbolicFactorGraph.cpp LinearFactorGraph.cpp -sources += SymbolicBayesChain.cpp ChordalBayesNet.cpp +sources += SymbolicBayesChain.cpp ChordalBayesNet.cpp sources += ConstrainedNonlinearFactorGraph.cpp ConstrainedLinearFactorGraph.cpp check_PROGRAMS += testFactorgraph testSymbolicFactorGraph check_PROGRAMS += testLinearFactorGraph testNonlinearFactorGraph @@ -161,13 +161,14 @@ testVSLAMFactor_LDADD = libgtsam.la # The header files will be installed in ~/include/gtsam -headers = gtsam.h Value.h Testable.h Factor.h LinearFactorSet.h BayesChain.h +headers = gtsam.h Value.h Testable.h Factor.h LinearFactorSet.h headers += Point2Prior.h Simulated2DOdometry.h Simulated2DMeasurement.h smallExample.h headers += $(sources:.cpp=.h) # templates: headers += FactorGraph.h FactorGraph-inl.h headers += NonlinearFactorGraph.h NonlinearFactorGraph-inl.h headers += NonlinearOptimizer.h NonlinearOptimizer-inl.h +headers += BayesChain.h BayesChain-inl.h BayesTree.h BayesTree-inl.h # create both dynamic and static libraries AM_CXXFLAGS = -I$(boost) -fPIC diff --git a/cpp/testBayesTree.cpp b/cpp/testBayesTree.cpp index 8b69d89fe..a4bba9cc7 100644 --- a/cpp/testBayesTree.cpp +++ b/cpp/testBayesTree.cpp @@ -8,7 +8,7 @@ #include "SymbolicBayesChain.h" #include "smallExample.h" -#include "BayesTree.h" +#include "BayesTree-inl.h" using namespace gtsam;