diff --git a/cpp/ConstrainedLinearFactorGraph.cpp b/cpp/ConstrainedLinearFactorGraph.cpp index dadc884be..ee992c8a7 100644 --- a/cpp/ConstrainedLinearFactorGraph.cpp +++ b/cpp/ConstrainedLinearFactorGraph.cpp @@ -4,8 +4,9 @@ */ #include +#include +#include #include "ConstrainedLinearFactorGraph.h" -#include "FactorGraph-inl.h" // for getOrdering using namespace std; // trick from some reading group diff --git a/cpp/LinearFactorGraph.cpp b/cpp/LinearFactorGraph.cpp index c6b0ac855..89ceb5253 100644 --- a/cpp/LinearFactorGraph.cpp +++ b/cpp/LinearFactorGraph.cpp @@ -20,6 +20,9 @@ using namespace std; using namespace gtsam; +// Explicitly instantiate so we don't have to include everywhere +template class FactorGraph; + // explicitly instantiate conversion from LinearFG to SymbolicFG template SymbolicBayesChain::SymbolicBayesChain (FactorGraph const&, Ordering const&); diff --git a/cpp/SymbolicFactorGraph.cpp b/cpp/SymbolicFactorGraph.cpp index 67f2dac6d..f7a31f6b1 100644 --- a/cpp/SymbolicFactorGraph.cpp +++ b/cpp/SymbolicFactorGraph.cpp @@ -7,6 +7,7 @@ #include #include "Ordering.h" +#include "FactorGraph-inl.h" #include "SymbolicFactorGraph.h" #include "SymbolicBayesChain.h" @@ -14,6 +15,9 @@ using namespace std; namespace gtsam { + // Explicitly instantiate so we don't have to include everywhere + template class FactorGraph; + /* ************************************************************************* */ SymbolicBayesChain::shared_ptr SymbolicFactorGraph::eliminate(const Ordering& ordering) diff --git a/cpp/testConstrainedLinearFactorGraph.cpp b/cpp/testConstrainedLinearFactorGraph.cpp index c4dd4834e..374148a7a 100644 --- a/cpp/testConstrainedLinearFactorGraph.cpp +++ b/cpp/testConstrainedLinearFactorGraph.cpp @@ -6,7 +6,6 @@ #include #include #include "ConstrainedLinearFactorGraph.h" -#include "FactorGraph-inl.h" #include "LinearFactorGraph.h" #include "smallExample.h" diff --git a/cpp/testLinearFactorGraph.cpp b/cpp/testLinearFactorGraph.cpp index 2f18cd854..a2e48e03c 100644 --- a/cpp/testLinearFactorGraph.cpp +++ b/cpp/testLinearFactorGraph.cpp @@ -14,9 +14,6 @@ using namespace std; #include "Matrix.h" #include "smallExample.h" -// template definitions -#include "FactorGraph-inl.h" - using namespace gtsam; double tol=1e-4; diff --git a/cpp/testSymbolicBayesChain.cpp b/cpp/testSymbolicBayesChain.cpp index b27b2c893..974031bd8 100644 --- a/cpp/testSymbolicBayesChain.cpp +++ b/cpp/testSymbolicBayesChain.cpp @@ -7,7 +7,6 @@ #include #include "smallExample.h" -#include "FactorGraph-inl.h" #include "SymbolicBayesChain.h" using namespace std; diff --git a/cpp/testSymbolicFactorGraph.cpp b/cpp/testSymbolicFactorGraph.cpp index c4688f5b3..05115c838 100644 --- a/cpp/testSymbolicFactorGraph.cpp +++ b/cpp/testSymbolicFactorGraph.cpp @@ -7,9 +7,7 @@ #include #include "smallExample.h" -#include "FactorGraph-inl.h" #include "SymbolicFactorGraph.h" -#include "SymbolicConditional.h" #include "SymbolicBayesChain.h" using namespace std;