diff --git a/cpp/NonlinearConstraint-inl.h b/cpp/NonlinearConstraint-inl.h index 3c90dd44a..c02ba2a0c 100644 --- a/cpp/NonlinearConstraint-inl.h +++ b/cpp/NonlinearConstraint-inl.h @@ -10,6 +10,10 @@ #include #include "NonlinearConstraint.h" +#define INSTANTIATE_NONLINEAR_CONSTRAINT(C) \ + INSTANTIATE_FACTOR_GRAPH(NonlinearConstraint); \ + template class NonlinearConstraint; + namespace gtsam { /* ************************************************************************* */ diff --git a/cpp/TupleConfig-inl.h b/cpp/TupleConfig-inl.h index 6ccbc2084..fa56118e6 100644 --- a/cpp/TupleConfig-inl.h +++ b/cpp/TupleConfig-inl.h @@ -18,9 +18,27 @@ /*template void PairConfig::print(const std::string&) const;*/ \ template PairConfig expmap(PairConfig, const VectorConfig&); -#define INSTANTIATE_TUPLE_CONFIG(CONFIG) \ - template class CONFIG; \ - template CONFIG expmap(CONFIG, const VectorConfig&); +// TupleConfig instantiations for N = 1-6 +#define INSTANTIATE_TUPLE_CONFIG2(Config1, Config2) \ + template class TupleConfig2; \ + template TupleConfig2 expmap(const TupleConfig2, const VectorConfig&); + +#define INSTANTIATE_TUPLE_CONFIG3(Config1, Config2, Config3) \ + template class TupleConfig3; \ + template TupleConfig3 expmap(const TupleConfig3, const VectorConfig&); + +#define INSTANTIATE_TUPLE_CONFIG4(Config1, Config2, Config3, Config4) \ + template class TupleConfig4; \ + template TupleConfig4 expmap(const TupleConfig4, const VectorConfig&); + +#define INSTANTIATE_TUPLE_CONFIG5(Config1, Config2, Config3, Config4, Config5) \ + template class TupleConfig5; \ + template TupleConfig5 expmap(const TupleConfig5, const VectorConfig&); + +#define INSTANTIATE_TUPLE_CONFIG6(Config1, Config2, Config3, Config4, Config5, Config6) \ + template class TupleConfig6; \ + template TupleConfig6 expmap(const TupleConfig6, const VectorConfig&); + namespace gtsam { diff --git a/cpp/TupleConfig.h b/cpp/TupleConfig.h index 433d7bb8b..089284d1f 100644 --- a/cpp/TupleConfig.h +++ b/cpp/TupleConfig.h @@ -210,6 +210,11 @@ namespace gtsam { inline const Config2_t& second() const { return this->rest().config(); } }; + template + TupleConfig2 exmap(const TupleConfig2 c, const VectorConfig& delta) { + return c.exmap(delta); + } + template class TupleConfig3 : public TupleConfig > > { public: @@ -229,6 +234,11 @@ namespace gtsam { inline const Config3_t& third() const { return this->rest().rest().config(); } }; + template + TupleConfig3 exmap(const TupleConfig3 c, const VectorConfig& delta) { + return c.exmap(delta); + } + template class TupleConfig4 : public TupleConfig > > > { public: @@ -250,6 +260,11 @@ namespace gtsam { inline const Config4_t& fourth() const { return this->rest().rest().rest().config(); } }; + template + TupleConfig4 exmap(const TupleConfig4 c, const VectorConfig& delta) { + return c.exmap(delta); + } + template class TupleConfig5 : public TupleConfig > > > > { public: @@ -274,6 +289,11 @@ namespace gtsam { inline const Config5_t& fifth() const { return this->rest().rest().rest().rest().config(); } }; + template + TupleConfig5 exmap(const TupleConfig5 c, const VectorConfig& delta) { + return c.exmap(delta); + } + template class TupleConfig6 : public TupleConfig > > > > > { public: @@ -299,6 +319,11 @@ namespace gtsam { inline const Config6_t& sixth() const { return this->rest().rest().rest().rest().rest().config(); } }; + template + TupleConfig6 exmap(const TupleConfig6 c, const VectorConfig& delta) { + return c.exmap(delta); + } + /** * PairConfig: an alias for a pair of configs using TupleConfig2 * STILL IN TESTING - will soon replace PairConfig