diff --git a/gtsam/inference/EliminationTree.h b/gtsam/inference/EliminationTree.h index d203ace3f..55fc47405 100644 --- a/gtsam/inference/EliminationTree.h +++ b/gtsam/inference/EliminationTree.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -48,6 +49,9 @@ public: private: + /** concept check */ + GTSAM_CONCEPT_TESTABLE_TYPE(FACTOR) + typedef FastList Factors; typedef FastList SubTrees; typedef std::vector Conditionals; diff --git a/gtsam/inference/FactorGraph.h b/gtsam/inference/FactorGraph.h index f2eb33767..bea514cf1 100644 --- a/gtsam/inference/FactorGraph.h +++ b/gtsam/inference/FactorGraph.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -56,6 +57,9 @@ namespace gtsam { protected: + /** concept check */ + GTSAM_CONCEPT_TESTABLE_TYPE(FACTOR) + /** Collection of factors */ std::vector factors_; diff --git a/gtsam/inference/GenericSequentialSolver.h b/gtsam/inference/GenericSequentialSolver.h index 5e694878d..2df529203 100644 --- a/gtsam/inference/GenericSequentialSolver.h +++ b/gtsam/inference/GenericSequentialSolver.h @@ -20,6 +20,7 @@ #include +#include #include namespace gtsam { @@ -53,8 +54,13 @@ namespace gtsam { VariableIndex::shared_ptr structure_; /** Elimination tree that performs elimination */ + typedef EliminationTree EliminationTree_; typename EliminationTree::shared_ptr eliminationTree_; + /** concept checks */ + GTSAM_CONCEPT_TESTABLE_TYPE(FACTOR) + GTSAM_CONCEPT_TESTABLE_TYPE(EliminationTree_) + public: /** diff --git a/gtsam/nonlinear/LieValues.h b/gtsam/nonlinear/LieValues.h index f23b08daf..97bec1f35 100644 --- a/gtsam/nonlinear/LieValues.h +++ b/gtsam/nonlinear/LieValues.h @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -63,6 +64,9 @@ namespace gtsam { private: + /** concept check */ + GTSAM_CONCEPT_TESTABLE_TYPE(Value) + KeyValueMap values_; public: diff --git a/gtsam/nonlinear/NonlinearEquality.h b/gtsam/nonlinear/NonlinearEquality.h index 62f278704..e36e22f1a 100644 --- a/gtsam/nonlinear/NonlinearEquality.h +++ b/gtsam/nonlinear/NonlinearEquality.h @@ -28,7 +28,10 @@ namespace gtsam { * Template default compare function that assumes a testable T */ template - bool compare(const T& a, const T& b) { return a.equals(b); } + bool compare(const T& a, const T& b) { + GTSAM_CONCEPT_TESTABLE_TYPE(T); + return a.equals(b); + } /** * An equality factor that forces either one variable to a constant, diff --git a/gtsam/nonlinear/TupleValues.h b/gtsam/nonlinear/TupleValues.h index 2e55ecf8a..e1ce87310 100644 --- a/gtsam/nonlinear/TupleValues.h +++ b/gtsam/nonlinear/TupleValues.h @@ -54,6 +54,10 @@ namespace gtsam { VALUES1 first_; /// Arbitrary values VALUES2 second_; /// A TupleValues or TupleValuesEnd, which wraps an arbitrary values + /** concept checks */ + GTSAM_CONCEPT_TESTABLE_TYPE(VALUES1) + GTSAM_CONCEPT_TESTABLE_TYPE(VALUES2) + public: // typedefs for values subtypes typedef typename VALUES1::Key Key1; diff --git a/gtsam/slam/simulated2DConstraints.h b/gtsam/slam/simulated2DConstraints.h index 06e611e44..39e8e5452 100644 --- a/gtsam/slam/simulated2DConstraints.h +++ b/gtsam/slam/simulated2DConstraints.h @@ -59,6 +59,8 @@ namespace gtsam { typedef boost::shared_ptr > shared_ptr; ///< boost::shared_ptr convenience typedef typedef typename KEY::Value Point; ///< Constrained variable type + virtual ~ScalarCoordConstraint1() {} + /** * Constructor for constraint * @param key is the label for the constrained variable @@ -119,6 +121,8 @@ namespace gtsam { typedef BoundingConstraint2 Base; ///< Base class for factor typedef typename KEY::Value Point; ///< Type of variable constrained + virtual ~MaxDistanceConstraint() {} + /** * Primary constructor for factor * @param key1 is the first variable key @@ -161,6 +165,8 @@ namespace gtsam { typedef typename XKEY::Value Pose; ///< Type of pose variable constrained typedef typename PKEY::Value Point; ///< Type of point variable constrained + virtual ~MinDistanceConstraint() {} + /** * Primary constructor for factor * @param key1 is the first variable key