diff --git a/gtsam/base/ConcurrentMap.h b/gtsam/base/ConcurrentMap.h index 66d06d324..372f02d06 100644 --- a/gtsam/base/ConcurrentMap.h +++ b/gtsam/base/ConcurrentMap.h @@ -52,7 +52,6 @@ using ConcurrentMapBase = gtsam::FastMap; #include #include #endif -#include #include diff --git a/gtsam/base/FastList.h b/gtsam/base/FastList.h index 2b0b9945b..414c1e83f 100644 --- a/gtsam/base/FastList.h +++ b/gtsam/base/FastList.h @@ -20,7 +20,6 @@ #include #include -#include #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION #include #include diff --git a/gtsam/base/FastSet.h b/gtsam/base/FastSet.h index b7c00801b..37912449c 100644 --- a/gtsam/base/FastSet.h +++ b/gtsam/base/FastSet.h @@ -18,8 +18,8 @@ #pragma once -#include #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION +#include #if BOOST_VERSION >= 107400 #include #endif diff --git a/gtsam/base/GenericValue.h b/gtsam/base/GenericValue.h index bbf0f57ad..bb92b6b2e 100644 --- a/gtsam/base/GenericValue.h +++ b/gtsam/base/GenericValue.h @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include // operator typeid diff --git a/gtsam/base/Group.h b/gtsam/base/Group.h index 5c0f92b4e..cf5f35e39 100644 --- a/gtsam/base/Group.h +++ b/gtsam/base/Group.h @@ -22,10 +22,13 @@ #include +#ifdef GTSAM_USE_BOOST_FEATURES #include #include #include #include +#endif + #include namespace gtsam { diff --git a/gtsam/base/Manifold.h b/gtsam/base/Manifold.h index 55aebd10f..92f9ba9ac 100644 --- a/gtsam/base/Manifold.h +++ b/gtsam/base/Manifold.h @@ -23,9 +23,11 @@ #include #include +#ifdef GTSAM_USE_BOOST_FEATURES #include #include #include +#endif namespace gtsam { diff --git a/gtsam/base/Testable.h b/gtsam/base/Testable.h index b68d6a97c..e9e8ad932 100644 --- a/gtsam/base/Testable.h +++ b/gtsam/base/Testable.h @@ -33,7 +33,10 @@ #pragma once +#ifdef GTSAM_USE_BOOST_FEATURES #include +#endif + #include #include #include diff --git a/gtsam/base/concepts.h b/gtsam/base/concepts.h index da872d006..f7776ab9b 100644 --- a/gtsam/base/concepts.h +++ b/gtsam/base/concepts.h @@ -13,7 +13,10 @@ // to cause compilation errors. #ifdef COMPILE_ERROR_NOT_IMPLEMENTED +#ifdef GTSAM_USE_BOOST_FEATURES #include +#endif + #define CONCEPT_NOT_IMPLEMENTED BOOST_STATIC_ASSERT_MSG(boost::false_type, \ "This method is required by the new concepts framework but has not been implemented yet."); diff --git a/gtsam/base/types.h b/gtsam/base/types.h index 9a1c823c4..3f1c1cd3d 100644 --- a/gtsam/base/types.h +++ b/gtsam/base/types.h @@ -20,8 +20,10 @@ #pragma once #include +#ifdef GTSAM_USE_BOOST_FEATURES #include #include +#endif #include // for GTSAM_USE_TBB #include diff --git a/gtsam/linear/GaussianConditional.h b/gtsam/linear/GaussianConditional.h index f99006831..43d349b67 100644 --- a/gtsam/linear/GaussianConditional.h +++ b/gtsam/linear/GaussianConditional.h @@ -19,8 +19,6 @@ #pragma once -#include - #include #include #include diff --git a/gtsam/linear/PCGSolver.cpp b/gtsam/linear/PCGSolver.cpp index e98cbf69d..cc461e63c 100644 --- a/gtsam/linear/PCGSolver.cpp +++ b/gtsam/linear/PCGSolver.cpp @@ -22,8 +22,6 @@ #include #include -#include - #include #include #include diff --git a/gtsam/linear/SubgraphBuilder.cpp b/gtsam/linear/SubgraphBuilder.cpp index af31d760b..834fc8d12 100644 --- a/gtsam/linear/SubgraphBuilder.cpp +++ b/gtsam/linear/SubgraphBuilder.cpp @@ -25,9 +25,9 @@ #include #include +#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION #include #include -#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION #include #endif diff --git a/gtsam/linear/SubgraphPreconditioner.cpp b/gtsam/linear/SubgraphPreconditioner.cpp index ece8d13d4..96f4847b5 100644 --- a/gtsam/linear/SubgraphPreconditioner.cpp +++ b/gtsam/linear/SubgraphPreconditioner.cpp @@ -24,8 +24,6 @@ #include #include -#include - #include using std::cout; diff --git a/gtsam/linear/VectorValues.cpp b/gtsam/linear/VectorValues.cpp index 6ec7fb764..2c9ca7f06 100644 --- a/gtsam/linear/VectorValues.cpp +++ b/gtsam/linear/VectorValues.cpp @@ -18,9 +18,6 @@ #include -#include -#include - using namespace std; namespace gtsam { diff --git a/gtsam/linear/linearExceptions.cpp b/gtsam/linear/linearExceptions.cpp index 7302380d9..75f284348 100644 --- a/gtsam/linear/linearExceptions.cpp +++ b/gtsam/linear/linearExceptions.cpp @@ -18,7 +18,6 @@ #include #include -#include namespace gtsam { diff --git a/gtsam/linear/tests/testGaussianBayesNet.cpp b/gtsam/linear/tests/testGaussianBayesNet.cpp index 103ed9d43..f52d69e47 100644 --- a/gtsam/linear/tests/testGaussianBayesNet.cpp +++ b/gtsam/linear/tests/testGaussianBayesNet.cpp @@ -24,7 +24,6 @@ #include #include -#include // STL/C++ #include diff --git a/gtsam/linear/tests/testJacobianFactor.cpp b/gtsam/linear/tests/testJacobianFactor.cpp index 332bc4dbd..0ad77b366 100644 --- a/gtsam/linear/tests/testJacobianFactor.cpp +++ b/gtsam/linear/tests/testJacobianFactor.cpp @@ -25,8 +25,6 @@ #include #include -#include - using namespace std; using namespace gtsam; diff --git a/gtsam/navigation/ImuFactor.h b/gtsam/navigation/ImuFactor.h index 59ff688af..40bc15e11 100644 --- a/gtsam/navigation/ImuFactor.h +++ b/gtsam/navigation/ImuFactor.h @@ -320,6 +320,7 @@ public: private: +#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION /** Serialization function */ friend class boost::serialization::access; template @@ -329,6 +330,7 @@ private: boost::serialization::base_object(*this)); ar & BOOST_SERIALIZATION_NVP(_PIM_); } +#endif }; // class ImuFactor2 diff --git a/gtsam/navigation/tests/testAttitudeFactor.cpp b/gtsam/navigation/tests/testAttitudeFactor.cpp index 0973fe8ac..f1fde1dca 100644 --- a/gtsam/navigation/tests/testAttitudeFactor.cpp +++ b/gtsam/navigation/tests/testAttitudeFactor.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include "gtsam/base/Matrix.h" #include diff --git a/gtsam/navigation/tests/testBarometricFactor.cpp b/gtsam/navigation/tests/testBarometricFactor.cpp index 85ca25075..c7e9032fe 100644 --- a/gtsam/navigation/tests/testBarometricFactor.cpp +++ b/gtsam/navigation/tests/testBarometricFactor.cpp @@ -21,8 +21,6 @@ #include #include -#include - using namespace std::placeholders; using namespace std; using namespace gtsam; diff --git a/gtsam/navigation/tests/testImuFactor.cpp b/gtsam/navigation/tests/testImuFactor.cpp index aa2559575..3c8f426cb 100644 --- a/gtsam/navigation/tests/testImuFactor.cpp +++ b/gtsam/navigation/tests/testImuFactor.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include "imuFactorTesting.h" diff --git a/gtsam/navigation/tests/testMagFactor.cpp b/gtsam/navigation/tests/testMagFactor.cpp index f15e00456..2b5dee4ff 100644 --- a/gtsam/navigation/tests/testMagFactor.cpp +++ b/gtsam/navigation/tests/testMagFactor.cpp @@ -20,8 +20,6 @@ #include #include -#include - #include #include diff --git a/gtsam/navigation/tests/testNavState.cpp b/gtsam/navigation/tests/testNavState.cpp index e658639b0..b8f081518 100644 --- a/gtsam/navigation/tests/testNavState.cpp +++ b/gtsam/navigation/tests/testNavState.cpp @@ -20,7 +20,6 @@ #include #include -#include #include using namespace std::placeholders; diff --git a/gtsam/nonlinear/ExpressionFactor.h b/gtsam/nonlinear/ExpressionFactor.h index ada4609b9..80a7660fc 100644 --- a/gtsam/nonlinear/ExpressionFactor.h +++ b/gtsam/nonlinear/ExpressionFactor.h @@ -288,6 +288,7 @@ private: return expression(keys); } +#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION friend class boost::serialization::access; template void serialize(ARCHIVE &ar, const unsigned int /*version*/) { @@ -295,6 +296,7 @@ private: "ExpressionFactorN", boost::serialization::base_object>(*this)); } +#endif }; /// traits template diff --git a/gtsam/nonlinear/NonlinearEquality.h b/gtsam/nonlinear/NonlinearEquality.h index c8ab0c2af..f81486b30 100644 --- a/gtsam/nonlinear/NonlinearEquality.h +++ b/gtsam/nonlinear/NonlinearEquality.h @@ -21,8 +21,6 @@ #include #include -#include - #include #include #include @@ -346,6 +344,7 @@ class NonlinearEquality2 : public NoiseModelFactorN { GTSAM_MAKE_ALIGNED_OPERATOR_NEW private: +#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION /// Serialization function friend class boost::serialization::access; template @@ -354,6 +353,7 @@ class NonlinearEquality2 : public NoiseModelFactorN { ar& boost::serialization::make_nvp( "NoiseModelFactor2", boost::serialization::base_object(*this)); } +#endif }; // \NonlinearEquality2 diff --git a/gtsam/nonlinear/Values-inl.h b/gtsam/nonlinear/Values-inl.h index f509fe534..61ea6684a 100644 --- a/gtsam/nonlinear/Values-inl.h +++ b/gtsam/nonlinear/Values-inl.h @@ -25,11 +25,8 @@ #pragma once #include -#include #include -#include - #include // Only so Eclipse finds class definition namespace gtsam { diff --git a/gtsam/nonlinear/tests/testValues.cpp b/gtsam/nonlinear/tests/testValues.cpp index 1ad7277dc..1af18ef95 100644 --- a/gtsam/nonlinear/tests/testValues.cpp +++ b/gtsam/nonlinear/tests/testValues.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/gtsam/sam/tests/testRangeFactor.cpp b/gtsam/sam/tests/testRangeFactor.cpp index 6a71cbd2c..f45349c6b 100644 --- a/gtsam/sam/tests/testRangeFactor.cpp +++ b/gtsam/sam/tests/testRangeFactor.cpp @@ -25,7 +25,6 @@ #include #include -#include using namespace std::placeholders; using namespace std; diff --git a/gtsam/slam/GeneralSFMFactor.h b/gtsam/slam/GeneralSFMFactor.h index 5605ad58e..763f3666d 100644 --- a/gtsam/slam/GeneralSFMFactor.h +++ b/gtsam/slam/GeneralSFMFactor.h @@ -36,7 +36,6 @@ #include #include -#include #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION #include #endif diff --git a/gtsam/slam/InitializePose3.cpp b/gtsam/slam/InitializePose3.cpp index 4bec99665..ba9e0dd6b 100644 --- a/gtsam/slam/InitializePose3.cpp +++ b/gtsam/slam/InitializePose3.cpp @@ -27,8 +27,6 @@ #include #include -#include - #include using namespace std; diff --git a/gtsam/slam/TriangulationFactor.h b/gtsam/slam/TriangulationFactor.h index 6feaa7041..32aa590a6 100644 --- a/gtsam/slam/TriangulationFactor.h +++ b/gtsam/slam/TriangulationFactor.h @@ -19,7 +19,6 @@ #include #include -#include namespace gtsam { @@ -86,7 +85,7 @@ public: if (model && model->dim() != traits::dimension) throw std::invalid_argument( "TriangulationFactor must be created with " - + boost::lexical_cast((int) traits::dimension) + + std::to_string((int) traits::dimension) + "-dimensional noise model."); } diff --git a/gtsam/slam/lago.cpp b/gtsam/slam/lago.cpp index 5407e60a2..645c5ea91 100644 --- a/gtsam/slam/lago.cpp +++ b/gtsam/slam/lago.cpp @@ -19,17 +19,16 @@ #include #include -#include #include -#include +#include #include +#include #include #include -#include - #include #include +#include using namespace std; @@ -188,7 +187,7 @@ GaussianFactorGraph buildLinearOrientationGraph( ///cout << "REG: key1= " << DefaultKeyFormatter(key1) << " key2= " << DefaultKeyFormatter(key2) << endl; double k2pi_noise = key1_DeltaTheta_key2 + orientationsToRoot.at(key1) - orientationsToRoot.at(key2); // this coincides to summing up measurements along the cycle induced by the chord - double k = boost::math::round(k2pi_noise / (2 * M_PI)); + double k = std::round(k2pi_noise / (2 * M_PI)); //if (k2pi_noise - 2*k*M_PI > 1e-5) cout << k2pi_noise - 2*k*M_PI << endl; // for debug Vector deltaThetaRegularized = (Vector(1) << key1_DeltaTheta_key2 - 2 * k * M_PI).finished(); diff --git a/gtsam/slam/tests/testTriangulationFactor.cpp b/gtsam/slam/tests/testTriangulationFactor.cpp index 4173a54f8..29b0330c6 100644 --- a/gtsam/slam/tests/testTriangulationFactor.cpp +++ b/gtsam/slam/tests/testTriangulationFactor.cpp @@ -25,8 +25,6 @@ #include #include -#include - using namespace std; using namespace gtsam; using namespace std::placeholders; diff --git a/gtsam_unstable/dynamics/FullIMUFactor.h b/gtsam_unstable/dynamics/FullIMUFactor.h index 325321d13..02da899b7 100644 --- a/gtsam_unstable/dynamics/FullIMUFactor.h +++ b/gtsam_unstable/dynamics/FullIMUFactor.h @@ -10,8 +10,6 @@ #include #include -#include - namespace gtsam { /** diff --git a/gtsam_unstable/dynamics/IMUFactor.h b/gtsam_unstable/dynamics/IMUFactor.h index 102c9311e..ee09600e5 100644 --- a/gtsam_unstable/dynamics/IMUFactor.h +++ b/gtsam_unstable/dynamics/IMUFactor.h @@ -10,8 +10,6 @@ #include #include -#include - namespace gtsam { /** diff --git a/gtsam_unstable/dynamics/VelocityConstraint.h b/gtsam_unstable/dynamics/VelocityConstraint.h index bd6a40008..2bb70e1b5 100644 --- a/gtsam_unstable/dynamics/VelocityConstraint.h +++ b/gtsam_unstable/dynamics/VelocityConstraint.h @@ -10,8 +10,6 @@ #include #include -#include - namespace gtsam { namespace dynamics { diff --git a/gtsam_unstable/slam/EquivInertialNavFactor_GlobalVel.h b/gtsam_unstable/slam/EquivInertialNavFactor_GlobalVel.h index f62157845..0accb8f42 100644 --- a/gtsam_unstable/slam/EquivInertialNavFactor_GlobalVel.h +++ b/gtsam_unstable/slam/EquivInertialNavFactor_GlobalVel.h @@ -27,8 +27,6 @@ // Using numerical derivative to calculate d(Pose3::Expmap)/dw #include -#include - #include namespace gtsam { diff --git a/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h b/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h index 91dba26e6..8fda5456b 100644 --- a/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h +++ b/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h @@ -26,8 +26,6 @@ // Using numerical derivative to calculate d(Pose3::Expmap)/dw #include -#include - #include namespace gtsam { diff --git a/gtsam_unstable/slam/InvDepthFactorVariant1.h b/gtsam_unstable/slam/InvDepthFactorVariant1.h index 23f8bd3e0..a49b2090c 100644 --- a/gtsam_unstable/slam/InvDepthFactorVariant1.h +++ b/gtsam_unstable/slam/InvDepthFactorVariant1.h @@ -17,8 +17,6 @@ #include #include -#include - namespace gtsam { /** diff --git a/gtsam_unstable/slam/InvDepthFactorVariant2.h b/gtsam_unstable/slam/InvDepthFactorVariant2.h index 63fcb4d8c..7abbbe89a 100644 --- a/gtsam_unstable/slam/InvDepthFactorVariant2.h +++ b/gtsam_unstable/slam/InvDepthFactorVariant2.h @@ -18,8 +18,6 @@ #include #include -#include - namespace gtsam { /** diff --git a/gtsam_unstable/slam/InvDepthFactorVariant3.h b/gtsam_unstable/slam/InvDepthFactorVariant3.h index 22a725d47..8664002e8 100644 --- a/gtsam_unstable/slam/InvDepthFactorVariant3.h +++ b/gtsam_unstable/slam/InvDepthFactorVariant3.h @@ -17,8 +17,6 @@ #include #include -#include - namespace gtsam { /** diff --git a/gtsam_unstable/slam/tests/testEquivInertialNavFactor_GlobalVel.cpp b/gtsam_unstable/slam/tests/testEquivInertialNavFactor_GlobalVel.cpp index 644283512..33a48cf7a 100644 --- a/gtsam_unstable/slam/tests/testEquivInertialNavFactor_GlobalVel.cpp +++ b/gtsam_unstable/slam/tests/testEquivInertialNavFactor_GlobalVel.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include