Explicit template instantiation in .cpp files, so we can link with the code without having to include -inl.h everywhere...

release/4.3a0
Frank Dellaert 2009-10-30 05:45:22 +00:00
parent 83e5286710
commit 0d7d0e2161
7 changed files with 9 additions and 8 deletions

View File

@ -4,8 +4,9 @@
*/ */
#include <iostream> #include <iostream>
#include <boost/tuple/tuple.hpp>
#include <boost/foreach.hpp>
#include "ConstrainedLinearFactorGraph.h" #include "ConstrainedLinearFactorGraph.h"
#include "FactorGraph-inl.h" // for getOrdering
using namespace std; using namespace std;
// trick from some reading group // trick from some reading group

View File

@ -20,6 +20,9 @@
using namespace std; using namespace std;
using namespace gtsam; using namespace gtsam;
// Explicitly instantiate so we don't have to include everywhere
template class FactorGraph<LinearFactor>;
// explicitly instantiate conversion from LinearFG to SymbolicFG // explicitly instantiate conversion from LinearFG to SymbolicFG
template SymbolicBayesChain::SymbolicBayesChain template SymbolicBayesChain::SymbolicBayesChain
(FactorGraph<LinearFactor> const&, Ordering const&); (FactorGraph<LinearFactor> const&, Ordering const&);

View File

@ -7,6 +7,7 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include "Ordering.h" #include "Ordering.h"
#include "FactorGraph-inl.h"
#include "SymbolicFactorGraph.h" #include "SymbolicFactorGraph.h"
#include "SymbolicBayesChain.h" #include "SymbolicBayesChain.h"
@ -14,6 +15,9 @@ using namespace std;
namespace gtsam { namespace gtsam {
// Explicitly instantiate so we don't have to include everywhere
template class FactorGraph<SymbolicFactor>;
/* ************************************************************************* */ /* ************************************************************************* */
SymbolicBayesChain::shared_ptr SymbolicBayesChain::shared_ptr
SymbolicFactorGraph::eliminate(const Ordering& ordering) SymbolicFactorGraph::eliminate(const Ordering& ordering)

View File

@ -6,7 +6,6 @@
#include <iostream> #include <iostream>
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>
#include "ConstrainedLinearFactorGraph.h" #include "ConstrainedLinearFactorGraph.h"
#include "FactorGraph-inl.h"
#include "LinearFactorGraph.h" #include "LinearFactorGraph.h"
#include "smallExample.h" #include "smallExample.h"

View File

@ -14,9 +14,6 @@ using namespace std;
#include "Matrix.h" #include "Matrix.h"
#include "smallExample.h" #include "smallExample.h"
// template definitions
#include "FactorGraph-inl.h"
using namespace gtsam; using namespace gtsam;
double tol=1e-4; double tol=1e-4;

View File

@ -7,7 +7,6 @@
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>
#include "smallExample.h" #include "smallExample.h"
#include "FactorGraph-inl.h"
#include "SymbolicBayesChain.h" #include "SymbolicBayesChain.h"
using namespace std; using namespace std;

View File

@ -7,9 +7,7 @@
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>
#include "smallExample.h" #include "smallExample.h"
#include "FactorGraph-inl.h"
#include "SymbolicFactorGraph.h" #include "SymbolicFactorGraph.h"
#include "SymbolicConditional.h"
#include "SymbolicBayesChain.h" #include "SymbolicBayesChain.h"
using namespace std; using namespace std;