Skip to content

Commit

Permalink
Merge branch 'develop' into discrete-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Dec 27, 2024
2 parents 3694f7a + 39d92cb commit 795780d
Show file tree
Hide file tree
Showing 170 changed files with 259 additions and 254 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,7 @@ include(GtsamPrinting)
############### Decide on BOOST ######################################
# Enable or disable serialization with GTSAM_ENABLE_BOOST_SERIALIZATION
option(GTSAM_ENABLE_BOOST_SERIALIZATION "Enable Boost serialization" ON)
if(GTSAM_ENABLE_BOOST_SERIALIZATION)
add_definitions(-DGTSAM_ENABLE_BOOST_SERIALIZATION)
endif()

option(GTSAM_USE_BOOST_FEATURES "Enable Features that use Boost" ON)
if(GTSAM_USE_BOOST_FEATURES)
add_definitions(-DGTSAM_USE_BOOST_FEATURES)
endif()

if(GTSAM_ENABLE_BOOST_SERIALIZATION OR GTSAM_USE_BOOST_FEATURES)
include(cmake/HandleBoost.cmake)
Expand Down
4 changes: 2 additions & 2 deletions gtsam/base/ConcurrentMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using ConcurrentMapBase = gtsam::FastMap<KEY, VALUE>;

#endif

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#endif
Expand Down Expand Up @@ -101,7 +101,7 @@ class ConcurrentMap : public ConcurrentMapBase<KEY,VALUE> {
#endif

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class Archive>
Expand Down
4 changes: 2 additions & 2 deletions gtsam/base/FastList.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <gtsam/base/FastDefaultAllocator.h>
#include <list>
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/version.hpp>
#if BOOST_VERSION >= 107400
Expand Down Expand Up @@ -79,7 +79,7 @@ class FastList: public std::list<VALUE, typename internal::FastDefaultAllocator<
}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
4 changes: 2 additions & 2 deletions gtsam/base/FastMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

#include <gtsam/base/FastDefaultAllocator.h>
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/map.hpp>
#endif
Expand Down Expand Up @@ -69,7 +69,7 @@ class FastMap : public std::map<KEY, VALUE, std::less<KEY>,
bool exists(const KEY& e) const { return this->find(e) != this->end(); }

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
6 changes: 4 additions & 2 deletions gtsam/base/FastSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#pragma once

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#include <gtsam/config.h>

#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/version.hpp>
#if BOOST_VERSION >= 107400
#include <boost/serialization/library_version_type.hpp>
Expand Down Expand Up @@ -123,7 +125,7 @@ class FastSet: public std::set<VALUE, std::less<VALUE>,
}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/base/GenericValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class GenericValue: public Value {

private:

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/base/MatrixSerialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// \callgraph

// Defined only if boost serialization is enabled
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#pragma once

#include <gtsam/base/Matrix.h>
Expand Down
4 changes: 2 additions & 2 deletions gtsam/base/SymmetricBlockMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <gtsam/base/Matrix.h>
#include <gtsam/base/types.h>
#include <gtsam/dllexport.h>
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#endif
#include <cassert>
Expand Down Expand Up @@ -386,7 +386,7 @@ namespace gtsam {
template<typename SymmetricBlockMatrixType> friend class SymmetricBlockMatrixBlockExpr;

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
6 changes: 3 additions & 3 deletions gtsam/base/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <gtsam/config.h> // Configuration from CMake

#include <gtsam/base/Vector.h>
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/assume_abstract.hpp>
#endif
Expand Down Expand Up @@ -121,7 +121,7 @@ namespace gtsam {
* The last two links explain why these export lines have to be in the same source module that includes
* any of the archive class headers.
* */
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
friend class boost::serialization::access;
template<class ARCHIVE>
void serialize(ARCHIVE & /*ar*/, const unsigned int /*version*/) {
Expand All @@ -132,6 +132,6 @@ namespace gtsam {

} /* namespace gtsam */

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
BOOST_SERIALIZATION_ASSUME_ABSTRACT(gtsam::Value)
#endif
2 changes: 1 addition & 1 deletion gtsam/base/VectorSerialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

// Defined only if boost serialization is enabled
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#pragma once

#include <gtsam/base/Vector.h>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/base/VerticalBlockMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ namespace gtsam {
friend class SymmetricBlockMatrix;

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
5 changes: 4 additions & 1 deletion gtsam/base/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
* @date Feb 7, 2012
*/

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#pragma once

#include <gtsam/config.h>

#if GTSAM_ENABLE_BOOST_SERIALIZATION

#include <Eigen/Core>
#include <fstream>
#include <sstream>
Expand Down
5 changes: 4 additions & 1 deletion gtsam/base/serializationTestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
* @date Feb 7, 2012
*/

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#pragma once

#include <gtsam/config.h>

#if GTSAM_ENABLE_BOOST_SERIALIZATION

#include <iostream>
#include <sstream>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/base/std_optional_serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma once

// Defined only if boost serialization is enabled
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <optional>
#include <boost/config.hpp>

Expand Down
4 changes: 4 additions & 0 deletions gtsam/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@
#cmakedefine GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR

#cmakedefine GTSAM_SLOW_BUT_CORRECT_EXPMAP

// Boost flags
#cmakedefine01 GTSAM_ENABLE_BOOST_SERIALIZATION
#cmakedefine01 GTSAM_USE_BOOST_FEATURES
4 changes: 2 additions & 2 deletions gtsam/discrete/DecisionTree-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace gtsam {
private:
using Base = DecisionTree<L, Y>::Node;

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down Expand Up @@ -471,7 +471,7 @@ namespace gtsam {
private:
using Base = DecisionTree<L, Y>::Node;

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down
6 changes: 3 additions & 3 deletions gtsam/discrete/DecisionTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <gtsam/base/types.h>
#include <gtsam/discrete/Assignment.h>

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#endif
#include <memory>
Expand Down Expand Up @@ -132,7 +132,7 @@ namespace gtsam {
virtual bool isLeaf() const = 0;

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down Expand Up @@ -440,7 +440,7 @@ namespace gtsam {
/// @}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/discrete/DecisionTreeFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace gtsam {
/// @}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/discrete/DiscreteBayesNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class GTSAM_EXPORT DiscreteBayesNet: public BayesNet<DiscreteConditional> {
/// @}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template<class ARCHIVE>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/discrete/DiscreteConditional.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class GTSAM_EXPORT DiscreteConditional
bool forceComplete) const;

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/discrete/DiscreteFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class GTSAM_EXPORT DiscreteFactor : public Factor {
/// @}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down
4 changes: 2 additions & 2 deletions gtsam/discrete/DiscreteKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <gtsam/global_includes.h>
#include <gtsam/inference/Key.h>

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/vector.hpp>
#endif
#include <map>
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace gtsam {
/// Check equality to another DiscreteKeys object.
bool equals(const DiscreteKeys& other, double tol = 0) const;

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/discrete/DiscreteLookupDAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class GTSAM_EXPORT DiscreteLookupDAG : public BayesNet<DiscreteLookupTable> {
/// @}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class ARCHIVE>
Expand Down
4 changes: 2 additions & 2 deletions gtsam/geometry/BearingRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <gtsam/base/Manifold.h>
#include <gtsam/base/Testable.h>
#include <gtsam/base/OptionalJacobian.h>
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
#include <boost/serialization/nvp.hpp>
#endif
#include <iostream>
Expand Down Expand Up @@ -148,7 +148,7 @@ struct BearingRange {
/// @{

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/// Serialization function
template <class ARCHIVE>
void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Cal3.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class GTSAM_EXPORT Cal3 {
/// @{

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION ///
#if GTSAM_ENABLE_BOOST_SERIALIZATION ///
/// Serialization function
friend class boost::serialization::access;
template <class Archive>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Cal3Bundler.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class GTSAM_EXPORT Cal3Bundler : public Cal3f {
/// @name Advanced Interface
/// @{

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Cal3DS2.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class GTSAM_EXPORT Cal3DS2 : public Cal3DS2_Base {
/// @name Advanced Interface
/// @{

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Cal3DS2_Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class GTSAM_EXPORT Cal3DS2_Base : public Cal3 {
/// @name Advanced Interface
/// @{

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Cal3Fisheye.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class GTSAM_EXPORT Cal3Fisheye : public Cal3 {
/// @name Advanced Interface
/// @{

#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/Cal3Unified.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class GTSAM_EXPORT Cal3Unified : public Cal3DS2_Base {
/// @}

private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
#if GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand Down
Loading

0 comments on commit 795780d

Please sign in to comment.