diff --git a/examples/PlanarSLAMSelfContained_advanced.cpp b/examples/PlanarSLAMSelfContained_advanced.cpp index 549acabae..c8ee21997 100644 --- a/examples/PlanarSLAMSelfContained_advanced.cpp +++ b/examples/PlanarSLAMSelfContained_advanced.cpp @@ -34,7 +34,7 @@ #include // implementations for structures - needed if self-contained, and these should be included last -#include +#include #include #include #include diff --git a/examples/SimpleRotation.cpp b/examples/SimpleRotation.cpp index c31e91b5f..438459e64 100644 --- a/examples/SimpleRotation.cpp +++ b/examples/SimpleRotation.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/easyPoint2KalmanFilter.cpp b/examples/easyPoint2KalmanFilter.cpp index 3b8ee2980..f22d65f95 100644 --- a/examples/easyPoint2KalmanFilter.cpp +++ b/examples/easyPoint2KalmanFilter.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include using namespace std; diff --git a/examples/elaboratePoint2KalmanFilter.cpp b/examples/elaboratePoint2KalmanFilter.cpp index 73efc653c..8c8cbe147 100644 --- a/examples/elaboratePoint2KalmanFilter.cpp +++ b/examples/elaboratePoint2KalmanFilter.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/gtsam/nonlinear/TupleValues-inl.h b/gtsam/nonlinear/TupleValues-inl.h index 09e510093..a9d6300c1 100644 --- a/gtsam/nonlinear/TupleValues-inl.h +++ b/gtsam/nonlinear/TupleValues-inl.h @@ -18,29 +18,6 @@ #pragma once -#include -#include - -// TupleValues instantiations for N = 1-6 -#define INSTANTIATE_TUPLE_VALUES1(Values1) \ - template class TupleValues1; - -#define INSTANTIATE_TUPLE_VALUES2(Values1, Values2) \ - template class TupleValues2; - -#define INSTANTIATE_TUPLE_VALUES3(Values1, Values2, Values3) \ - template class TupleValues3; - -#define INSTANTIATE_TUPLE_VALUES4(Values1, Values2, Values3, Values4) \ - template class TupleValues4; - -#define INSTANTIATE_TUPLE_VALUES5(Values1, Values2, Values3, Values4, Values5) \ - template class TupleValues5; - -#define INSTANTIATE_TUPLE_VALUES6(Values1, Values2, Values3, Values4, Values5, Values6) \ - template class TupleValues6; - - namespace gtsam { /* ************************************************************************* */ diff --git a/gtsam/nonlinear/TupleValues.h b/gtsam/nonlinear/TupleValues.h index c16c2303f..9f1cbebae 100644 --- a/gtsam/nonlinear/TupleValues.h +++ b/gtsam/nonlinear/TupleValues.h @@ -520,3 +520,5 @@ namespace gtsam { }; } + +#include diff --git a/gtsam/nonlinear/Values-inl.h b/gtsam/nonlinear/Values-inl.h index 4a4e1898f..e53c14944 100644 --- a/gtsam/nonlinear/Values-inl.h +++ b/gtsam/nonlinear/Values-inl.h @@ -28,10 +28,6 @@ #include #include -#include - -#define INSTANTIATE_VALUES(J) template class Values; - using namespace std; namespace gtsam { diff --git a/gtsam/nonlinear/Values.h b/gtsam/nonlinear/Values.h index bb45435ce..95f2409be 100644 --- a/gtsam/nonlinear/Values.h +++ b/gtsam/nonlinear/Values.h @@ -229,5 +229,7 @@ namespace gtsam { } }; -} +} // \namespace gtsam + +#include diff --git a/gtsam/nonlinear/tests/testValues.cpp b/gtsam/nonlinear/tests/testValues.cpp index 0cabc5f6d..60c64b164 100644 --- a/gtsam/nonlinear/tests/testValues.cpp +++ b/gtsam/nonlinear/tests/testValues.cpp @@ -22,7 +22,7 @@ using namespace boost::assign; #include #include -#include +#include using namespace gtsam; using namespace std; diff --git a/gtsam/slam/Simulated3D.cpp b/gtsam/slam/Simulated3D.cpp index 3c73b5ba9..76e65a8cf 100644 --- a/gtsam/slam/Simulated3D.cpp +++ b/gtsam/slam/Simulated3D.cpp @@ -16,17 +16,9 @@ **/ #include -#include -#include namespace gtsam { -INSTANTIATE_VALUES(simulated3D::PointKey) -INSTANTIATE_VALUES(simulated3D::PoseKey) - -using namespace simulated3D; -INSTANTIATE_TUPLE_VALUES2(PoseValues, PointValues) - namespace simulated3D { Point3 prior (const Point3& x, boost::optional H) { diff --git a/gtsam/slam/planarSLAM.cpp b/gtsam/slam/planarSLAM.cpp index 955d190c2..ae47a6e7d 100644 --- a/gtsam/slam/planarSLAM.cpp +++ b/gtsam/slam/planarSLAM.cpp @@ -19,13 +19,10 @@ #include #include #include -#include // Use planarSLAM namespace for specific SLAM instance namespace gtsam { - INSTANTIATE_VALUES(planarSLAM::PointKey) - INSTANTIATE_TUPLE_VALUES2(planarSLAM::PoseValues, planarSLAM::PointValues) INSTANTIATE_NONLINEAR_FACTOR_GRAPH(planarSLAM::Values) INSTANTIATE_NONLINEAR_OPTIMIZER(planarSLAM::Graph, planarSLAM::Values) diff --git a/gtsam/slam/pose2SLAM.cpp b/gtsam/slam/pose2SLAM.cpp index 9219c242c..0eaaeaca1 100644 --- a/gtsam/slam/pose2SLAM.cpp +++ b/gtsam/slam/pose2SLAM.cpp @@ -16,14 +16,12 @@ **/ #include -#include #include #include // Use pose2SLAM namespace for specific SLAM instance namespace gtsam { - INSTANTIATE_VALUES(pose2SLAM::Key) INSTANTIATE_NONLINEAR_FACTOR_GRAPH(pose2SLAM::Values) INSTANTIATE_NONLINEAR_OPTIMIZER(pose2SLAM::Graph, pose2SLAM::Values) template class NonlinearOptimizer; diff --git a/gtsam/slam/pose3SLAM.cpp b/gtsam/slam/pose3SLAM.cpp index 7c7bb0d2e..4f4618896 100644 --- a/gtsam/slam/pose3SLAM.cpp +++ b/gtsam/slam/pose3SLAM.cpp @@ -16,14 +16,12 @@ **/ #include -#include #include #include // Use pose3SLAM namespace for specific SLAM instance namespace gtsam { - INSTANTIATE_VALUES(pose3SLAM::Key) INSTANTIATE_NONLINEAR_FACTOR_GRAPH(pose3SLAM::Values) INSTANTIATE_NONLINEAR_OPTIMIZER(pose3SLAM::Graph, pose3SLAM::Values) diff --git a/gtsam/slam/simulated2D.cpp b/gtsam/slam/simulated2D.cpp index 17a11dc06..ae30c6800 100644 --- a/gtsam/slam/simulated2D.cpp +++ b/gtsam/slam/simulated2D.cpp @@ -16,17 +16,9 @@ */ #include -#include -#include namespace gtsam { - INSTANTIATE_VALUES(simulated2D::PoseKey) - - using namespace simulated2D; - - INSTANTIATE_TUPLE_VALUES2(PoseValues, PointValues) - namespace simulated2D { static Matrix I = gtsam::eye(2); diff --git a/gtsam/slam/simulated2DOriented.cpp b/gtsam/slam/simulated2DOriented.cpp index 5dc1b2b22..0b68f0e46 100644 --- a/gtsam/slam/simulated2DOriented.cpp +++ b/gtsam/slam/simulated2DOriented.cpp @@ -16,13 +16,9 @@ */ #include -#include namespace gtsam { - using namespace simulated2DOriented; - - namespace simulated2DOriented { static Matrix I = gtsam::eye(3); diff --git a/gtsam/slam/smallExample.cpp b/gtsam/slam/smallExample.cpp index 78ffeb6f8..8f09c60e7 100644 --- a/gtsam/slam/smallExample.cpp +++ b/gtsam/slam/smallExample.cpp @@ -34,7 +34,6 @@ using namespace std; // template definitions #include #include -#include #include namespace gtsam { diff --git a/gtsam/slam/tests/testGeneralSFMFactor.cpp b/gtsam/slam/tests/testGeneralSFMFactor.cpp index 053f7a971..4316aadc6 100644 --- a/gtsam/slam/tests/testGeneralSFMFactor.cpp +++ b/gtsam/slam/tests/testGeneralSFMFactor.cpp @@ -20,7 +20,7 @@ using namespace boost; #include #include #include -#include +#include #include #include diff --git a/gtsam/slam/tests/testGeneralSFMFactor_Cal3Bundler.cpp b/gtsam/slam/tests/testGeneralSFMFactor_Cal3Bundler.cpp index 36b80bd8e..f42cb6e9c 100644 --- a/gtsam/slam/tests/testGeneralSFMFactor_Cal3Bundler.cpp +++ b/gtsam/slam/tests/testGeneralSFMFactor_Cal3Bundler.cpp @@ -20,7 +20,7 @@ using namespace boost; #include #include #include -#include +#include #include #include diff --git a/gtsam/slam/visualSLAM.cpp b/gtsam/slam/visualSLAM.cpp index 23244f5f9..5a8200dd0 100644 --- a/gtsam/slam/visualSLAM.cpp +++ b/gtsam/slam/visualSLAM.cpp @@ -16,12 +16,11 @@ */ #include -#include #include #include namespace gtsam { - INSTANTIATE_TUPLE_VALUES2(visualSLAM::PoseValues, visualSLAM::PointValues) + INSTANTIATE_NONLINEAR_FACTOR_GRAPH(visualSLAM::Values) INSTANTIATE_NONLINEAR_OPTIMIZER(visualSLAM::Graph, visualSLAM::Values) diff --git a/tests/testExtendedKalmanFilter.cpp b/tests/testExtendedKalmanFilter.cpp index 3027ab02f..3a946858a 100644 --- a/tests/testExtendedKalmanFilter.cpp +++ b/tests/testExtendedKalmanFilter.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include using namespace gtsam; diff --git a/tests/testGraph.cpp b/tests/testGraph.cpp index 1bd46f12f..b4e04603f 100644 --- a/tests/testGraph.cpp +++ b/tests/testGraph.cpp @@ -27,7 +27,6 @@ using namespace boost::assign; #define GTSAM_MAGIC_GAUSSIAN 3 #include -#include #include #include diff --git a/tests/testNonlinearEquality.cpp b/tests/testNonlinearEquality.cpp index 31e870f00..501bb9db8 100644 --- a/tests/testNonlinearEquality.cpp +++ b/tests/testNonlinearEquality.cpp @@ -24,8 +24,6 @@ #include #include -#include - using namespace std; using namespace gtsam; diff --git a/tests/testNonlinearFactor.cpp b/tests/testNonlinearFactor.cpp index 01d2920ad..9917273b9 100644 --- a/tests/testNonlinearFactor.cpp +++ b/tests/testNonlinearFactor.cpp @@ -35,7 +35,6 @@ #include #include #include -#include using namespace std; using namespace gtsam; diff --git a/tests/testRot3QOptimization.cpp b/tests/testRot3QOptimization.cpp index b94cad3a5..d46c30ea4 100644 --- a/tests/testRot3QOptimization.cpp +++ b/tests/testRot3QOptimization.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/testTupleValues.cpp b/tests/testTupleValues.cpp index b75e98102..4ba2e3a5f 100644 --- a/tests/testTupleValues.cpp +++ b/tests/testTupleValues.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include using namespace gtsam; using namespace std;