Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring cleaning: deprecate -> 4.2 #999

Merged
merged 10 commits into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DGTSAM_UNSTABLE_BUILD_PYTHON=${GTSAM_BUILD_UNSTABLE:-ON} \
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V41=OFF \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V42=OFF \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gtsam_install


Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function configure()
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
-DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=${GTSAM_BUILD_EXAMPLES_ALWAYS:-ON} \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V41=${GTSAM_ALLOW_DEPRECATED_SINCE_V41:-OFF} \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V42=${GTSAM_ALLOW_DEPRECATED_SINCE_V42:-OFF} \
-DGTSAM_USE_QUATERNIONS=${GTSAM_USE_QUATERNIONS:-OFF} \
-DGTSAM_ROT3_EXPMAP=${GTSAM_ROT3_EXPMAP:-ON} \
-DGTSAM_POSE3_EXPMAP=${GTSAM_POSE3_EXPMAP:-ON} \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Set Allow Deprecated Flag
if: matrix.flag == 'deprecated'
run: |
echo "GTSAM_ALLOW_DEPRECATED_SINCE_V41=ON" >> $GITHUB_ENV
echo "GTSAM_ALLOW_DEPRECATED_SINCE_V42=ON" >> $GITHUB_ENV
echo "Allow deprecated since version 4.1"

- name: Set Use Quaternions Flag
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

As of Dec 2021, the `develop` branch is officially in "Pre 4.2" mode. A great new feature we will be adding in 4.2 is *hybrid inference* a la DCSLAM (Kevin Doherty et al) and we envision several API-breaking changes will happen in the discrete folder.

In addition, features deprecated in 4.1 will be removed. Please use the last [4.1.1 release](https://github.com/borglab/gtsam/releases/tag/4.1.1) if you need those features. However, most (not all, unfortunately) are easily converted and can be tracked down (in 4.1.1) by disabling the cmake flag `GTSAM_ALLOW_DEPRECATED_SINCE_V41`.
In addition, features deprecated in 4.1 will be removed. Please use the last [4.1.1 release](https://github.com/borglab/gtsam/releases/tag/4.1.1) if you need those features. However, most (not all, unfortunately) are easily converted and can be tracked down (in 4.1.1) by disabling the cmake flag `GTSAM_ALLOW_DEPRECATED_SINCE_V42`.

## What is GTSAM?

Expand Down Expand Up @@ -57,7 +57,7 @@ GTSAM 4 introduces several new features, most notably Expressions and a Python t

GTSAM 4 also deprecated some legacy functionality and wrongly named methods. If you are on a 4.0.X release, you can define the flag `GTSAM_ALLOW_DEPRECATED_SINCE_V4` to use the deprecated methods.

GTSAM 4.1 added a new pybind wrapper, and **removed** the deprecated functionality. There is a flag `GTSAM_ALLOW_DEPRECATED_SINCE_V41` for newly deprecated methods since the 4.1 release, which is on by default, allowing anyone to just pull version 4.1 and compile.
GTSAM 4.1 added a new pybind wrapper, and **removed** the deprecated functionality. There is a flag `GTSAM_ALLOW_DEPRECATED_SINCE_V42` for newly deprecated methods since the 4.1 release, which is on by default, allowing anyone to just pull version 4.1 and compile.


## Wrappers
Expand Down
2 changes: 1 addition & 1 deletion Using-GTSAM-EXPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rule #1 doesn't seem very bad, until you combine it with rule #2

***Compiler Rule #2*** Anything declared in a header file is not included in a DLL.

When these two rules are combined, you get some very confusing results. For example, a class which is completely defined in a header (e.g. LieMatrix) cannot use `GTSAM_EXPORT` in its definition. If LieMatrix is defined with `GTSAM_EXPORT`, then the compiler _must_ find LieMatrix in a DLL. Because LieMatrix is a header-only class, however, it can't find it, leading to a very confusing "I can't find this symbol" type of error. Note that the linker says it can't find the symbol even though the compiler found the header file that completely defines the class.
When these two rules are combined, you get some very confusing results. For example, a class which is completely defined in a header (e.g. Foo) cannot use `GTSAM_EXPORT` in its definition. If Foo is defined with `GTSAM_EXPORT`, then the compiler _must_ find Foo in a DLL. Because Foo is a header-only class, however, it can't find it, leading to a very confusing "I can't find this symbol" type of error. Note that the linker says it can't find the symbol even though the compiler found the header file that completely defines the class.

Also note that when a class that you want to export inherits from another class that is not exportable, this can cause significant issues. According to this [MSVC Warning page](https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4275?view=vs-2019), it may not strictly be a rule, but we have seen several linker errors when a class that is defined with `GTSAM_EXPORT` extended an Eigen class. In general, it appears that any inheritance of non-exportable class by an exportable class is a bad idea.

Expand Down
2 changes: 1 addition & 1 deletion cmake/HandleGeneralOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ option(GTSAM_WITH_EIGEN_MKL_OPENMP "Eigen, when using Intel MKL, will a
option(GTSAM_THROW_CHEIRALITY_EXCEPTION "Throw exception when a triangulated point is behind a camera" ON)
option(GTSAM_BUILD_PYTHON "Enable/Disable building & installation of Python module with pybind11" OFF)
option(GTSAM_INSTALL_MATLAB_TOOLBOX "Enable/Disable installation of matlab toolbox" OFF)
option(GTSAM_ALLOW_DEPRECATED_SINCE_V41 "Allow use of methods/functions deprecated in GTSAM 4.1" ON)
option(GTSAM_ALLOW_DEPRECATED_SINCE_V42 "Allow use of methods/functions deprecated in GTSAM 4.1" ON)
option(GTSAM_SUPPORT_NESTED_DISSECTION "Support Metis-based nested dissection" ON)
option(GTSAM_TANGENT_PREINTEGRATION "Use new ImuFactor with integration on tangent space" ON)
option(GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR "Use the slower but correct version of BetweenFactor" OFF)
Expand Down
2 changes: 1 addition & 1 deletion cmake/HandlePrintConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ print_enabled_config(${GTSAM_USE_QUATERNIONS} "Quaternions as defaul
print_enabled_config(${GTSAM_ENABLE_CONSISTENCY_CHECKS} "Runtime consistency checking ")
print_enabled_config(${GTSAM_ROT3_EXPMAP} "Rot3 retract is full ExpMap ")
print_enabled_config(${GTSAM_POSE3_EXPMAP} "Pose3 retract is full ExpMap ")
print_enabled_config(${GTSAM_ALLOW_DEPRECATED_SINCE_V41} "Allow features deprecated in GTSAM 4.1")
print_enabled_config(${GTSAM_ALLOW_DEPRECATED_SINCE_V42} "Allow features deprecated in GTSAM 4.1")
print_enabled_config(${GTSAM_SUPPORT_NESTED_DISSECTION} "Metis-based Nested Dissection ")
print_enabled_config(${GTSAM_TANGENT_PREINTEGRATION} "Use tangent-space preintegration")

Expand Down
4 changes: 2 additions & 2 deletions gtsam/3rdparty/Eigen/Eigen/src/Core/CwiseNullaryOp.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ DenseBase<Derived>::Constant(const Scalar& value)
return DenseBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op<Scalar>(value));
}

/** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&)
/** @deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&)
dellaert marked this conversation as resolved.
Show resolved Hide resolved
*
* \sa LinSpaced(Index,Scalar,Scalar), setLinSpaced(Index,const Scalar&,const Scalar&)
*/
Expand All @@ -227,7 +227,7 @@ DenseBase<Derived>::LinSpaced(Sequential_t, Index size, const Scalar& low, const
return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar,PacketScalar>(low,high,size));
}

/** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&)
/** @deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&)
*
* \sa LinSpaced(Scalar,Scalar)
*/
Expand Down
4 changes: 2 additions & 2 deletions gtsam/3rdparty/Eigen/Eigen/src/Core/DenseBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ template<typename Derived> class DenseBase

/** \internal
* Copies \a other into *this without evaluating other. \returns a reference to *this.
* \deprecated */
* @deprecated */
dellaert marked this conversation as resolved.
Show resolved Hide resolved
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
Derived& lazyAssign(const DenseBase<OtherDerived>& other);

EIGEN_DEVICE_FUNC
CommaInitializer<Derived> operator<< (const Scalar& s);

/** \deprecated it now returns \c *this */
/** @deprecated it now returns \c *this */
template<unsigned int Added,unsigned int Removed>
EIGEN_DEPRECATED
const Derived& flagged() const
Expand Down
2 changes: 1 addition & 1 deletion gtsam/3rdparty/Eigen/Eigen/src/Core/EigenBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ template<typename Derived> struct EigenBase

/** \brief The interface type of indices
* \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE.
* \deprecated Since Eigen 3.3, its usage is deprecated. Use Eigen::Index instead.
* @deprecated Since Eigen 3.3, its usage is deprecated. Use Eigen::Index instead.
dellaert marked this conversation as resolved.
Show resolved Hide resolved
* \sa StorageIndex, \ref TopicPreprocessorDirectives.
*/
typedef Eigen::Index Index;
Expand Down
6 changes: 3 additions & 3 deletions gtsam/3rdparty/Eigen/Eigen/src/Core/TriangularMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,12 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularViewImpl<_Mat
TriangularViewType& operator=(const TriangularViewImpl& other)
{ return *this = other.derived().nestedExpression(); }

/** \deprecated */
/** @deprecated */
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
void lazyAssign(const TriangularBase<OtherDerived>& other);

/** \deprecated */
/** @deprecated */
dellaert marked this conversation as resolved.
Show resolved Hide resolved
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
void lazyAssign(const MatrixBase<OtherDerived>& other);
Expand Down Expand Up @@ -523,7 +523,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularViewImpl<_Mat
call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
}

/** \deprecated
/** @deprecated
* Shortcut for \code (*this).swap(other.triangularView<(*this)::Mode>()) \endcode */
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
Expand Down
4 changes: 2 additions & 2 deletions gtsam/3rdparty/Eigen/Eigen/src/Core/util/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const unsigned int RowMajorBit = 0x1;
const unsigned int EvalBeforeNestingBit = 0x2;

/** \ingroup flags
* \deprecated
* @deprecated
* means the expression should be evaluated before any assignment */
EIGEN_DEPRECATED
const unsigned int EvalBeforeAssigningBit = 0x4; // FIXME deprecated
Expand Down Expand Up @@ -149,7 +149,7 @@ const unsigned int LvalueBit = 0x20;
*/
const unsigned int DirectAccessBit = 0x40;

/** \deprecated \ingroup flags
/** @deprecated \ingroup flags
*
* means the first coefficient packet is guaranteed to be aligned.
* An expression cannot has the AlignedBit without the PacketAccessBit flag.
Expand Down
4 changes: 2 additions & 2 deletions gtsam/3rdparty/Eigen/Eigen/src/Geometry/AlignedBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
/** \returns the dimension in which the box holds */
EIGEN_DEVICE_FUNC inline Index dim() const { return AmbientDimAtCompileTime==Dynamic ? m_min.size() : Index(AmbientDimAtCompileTime); }

/** \deprecated use isEmpty() */
/** @deprecated use isEmpty() */
EIGEN_DEVICE_FUNC inline bool isNull() const { return isEmpty(); }

/** \deprecated use setEmpty() */
/** @deprecated use setEmpty() */
EIGEN_DEVICE_FUNC inline void setNull() { setEmpty(); }

/** \returns true if the box is empty.
Expand Down
2 changes: 1 addition & 1 deletion gtsam/3rdparty/Eigen/Eigen/src/Geometry/ParametrizedLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ EIGEN_DEVICE_FUNC inline _Scalar ParametrizedLine<_Scalar, _AmbientDim,_Options>
}


/** \deprecated use intersectionParameter()
/** @deprecated use intersectionParameter()
* \returns the parameter value of the intersection between \c *this and the given \a hyperplane
*/
template <typename _Scalar, int _AmbientDim, int _Options>
Expand Down
8 changes: 4 additions & 4 deletions gtsam/3rdparty/Eigen/Eigen/src/Geometry/Scaling.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ template<typename Derived>
inline const DiagonalWrapper<const Derived> Scaling(const MatrixBase<Derived>& coeffs)
{ return coeffs.asDiagonal(); }

/** \deprecated */
/** @deprecated */
typedef DiagonalMatrix<float, 2> AlignedScaling2f;
/** \deprecated */
/** @deprecated */
typedef DiagonalMatrix<double,2> AlignedScaling2d;
/** \deprecated */
/** @deprecated */
typedef DiagonalMatrix<float, 3> AlignedScaling3f;
/** \deprecated */
/** @deprecated */
typedef DiagonalMatrix<double,3> AlignedScaling3d;
//@}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ template<typename _MatrixType, int _UpLo, typename _Ordering>
}
};

/** \deprecated use SimplicialLDLT or class SimplicialLLT
/** @deprecated use SimplicialLDLT or class SimplicialLLT
* \ingroup SparseCholesky_Module
* \class SimplicialCholesky
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Eigen {

/** \deprecated Use Map<SparseMatrix<> >
/** @deprecated Use Map<SparseMatrix<> >
* \class MappedSparseMatrix
*
* \brief Sparse matrix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Eigen {

/** \deprecated use a SparseMatrix in an uncompressed mode
/** @deprecated use a SparseMatrix in an uncompressed mode
*
* \class DynamicSparseMatrix
*
Expand Down Expand Up @@ -291,15 +291,15 @@ template<typename _Scalar, int _Options, typename _StorageIndex>

public:

/** \deprecated
/** @deprecated
* Set the matrix to zero and reserve the memory for \a reserveSize nonzero coefficients. */
EIGEN_DEPRECATED void startFill(Index reserveSize = 1000)
{
setZero();
reserve(reserveSize);
}

/** \deprecated use insert()
/** @deprecated use insert()
* inserts a nonzero coefficient at given coordinates \a row, \a col and returns its reference assuming that:
* 1 - the coefficient does not exist yet
* 2 - this the coefficient with greater inner coordinate for the given outer coordinate.
Expand All @@ -315,7 +315,7 @@ template<typename _Scalar, int _Options, typename _StorageIndex>
return insertBack(outer,inner);
}

/** \deprecated use insert()
/** @deprecated use insert()
* Like fill() but with random inner coordinates.
* Compared to the generic coeffRef(), the unique limitation is that we assume
* the coefficient does not exist yet.
Expand All @@ -325,7 +325,7 @@ template<typename _Scalar, int _Options, typename _StorageIndex>
return insert(row,col);
}

/** \deprecated use finalize()
/** @deprecated use finalize()
* Does nothing. Provided for compatibility with SparseMatrix. */
EIGEN_DEPRECATED void endFill() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace GeographicLib {
NormalGravity(real a, real GM, real omega, real f_J2,
bool geometricp = true);
/**
* \deprecated Old constructor for the normal gravity.
* @deprecated Old constructor for the normal gravity.
dellaert marked this conversation as resolved.
Show resolved Hide resolved
*
* @param[in] a equatorial radius (meters).
* @param[in] GM mass constant of the ellipsoid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ namespace GeographicLib {
return x;
}
/**
* \deprecated An old name for val<T>(s).
* @deprecated An old name for val<T>(s).
**********************************************************************/
template<typename T>
// GEOGRAPHICLIB_DEPRECATED("Use new Utility::val<T>(s)")
Expand Down
3 changes: 0 additions & 3 deletions gtsam/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ install(FILES ${base_headers} DESTINATION include/gtsam/base)
file(GLOB base_headers_tree "treeTraversal/*.h")
install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal)

file(GLOB deprecated_headers "deprecated/*.h")
install(FILES ${deprecated_headers} DESTINATION include/gtsam/base/deprecated)

# Build tests
add_subdirectory(tests)
26 changes: 0 additions & 26 deletions gtsam/base/LieMatrix.h

This file was deleted.

26 changes: 0 additions & 26 deletions gtsam/base/LieScalar.h

This file was deleted.

26 changes: 0 additions & 26 deletions gtsam/base/LieVector.h

This file was deleted.

4 changes: 3 additions & 1 deletion gtsam/base/TestableAssertions.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ bool assert_equal(const V& expected, const boost::optional<const V&>& actual, do
return assert_equal(expected, *actual, tol);
}

#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
/**
* Version of assert_equals to work with vectors
* \deprecated: use container equals instead
* @deprecated: use container equals instead
*/
template<class V>
bool GTSAM_DEPRECATED assert_equal(const std::vector<V>& expected, const std::vector<V>& actual, double tol = 1e-9) {
Expand All @@ -108,6 +109,7 @@ bool GTSAM_DEPRECATED assert_equal(const std::vector<V>& expected, const std::ve
}
return true;
}
#endif

/**
* Function for comparing maps of testable->testable
Expand Down
Loading