Update the minimum required version of Eigen to 3.3. Change-Id: I6e6bd745311b7d4f1d5b749ec70d314f9e765438
diff --git a/docs/source/installation.rst b/docs/source/installation.rst index b3dfb50..c6ddfff 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst
@@ -32,7 +32,7 @@ :ref:`section-customizing` . - `Eigen <http://eigen.tuxfamily.org/index.php?title=Main_Page>`_ - 3.2.2 or later **strongly** recommended, 3.1.0 or later **required**. + 3.3 or later **required**. .. NOTE :: @@ -409,8 +409,8 @@ #. Get dependencies; unpack them as subdirectories in ``ceres/`` (``ceres/eigen``, ``ceres/glog``, etc) - #. ``Eigen`` 3.1 (needed on Windows; 3.0.x will not work). There is - no need to build anything; just unpack the source tarball. + #. ``Eigen`` 3.3 . There is no need to build anything; just unpack + the source tarball. #. ``google-glog`` Open up the Visual Studio solution and build it. #. ``gflags`` Open up the Visual Studio solution and build it. @@ -431,7 +431,7 @@ #. Unpack the Ceres tarball into ``ceres``. For the tarball, you should get a directory inside ``ceres`` similar to - ``ceres-solver-1.3.0``. Alternately, checkout Ceres via ``git`` to + ``ceres-solver-1.14.0``. Alternately, checkout Ceres via ``git`` to get ``ceres-solver.git`` inside ``ceres``. #. Install ``CMake``, @@ -693,15 +693,6 @@ #. ``EIGENSPARSE [Default: ON]``: By default, Ceres will not use Eigen's sparse Cholesky factorization. - .. NOTE:: - - For good performance, use Eigen version 3.2.2 or later. - - .. NOTE:: - - Unlike the rest of Eigen (>= 3.1.1 MPL2, < 3.1.1 LGPL), Eigen's sparse - Cholesky factorization is (still) licensed under the LGPL. - #. ``GFLAGS [Default: ON]``: Turn this ``OFF`` to build Ceres without ``gflags``. This will also prevent some of the example code from building.
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 00ecdca..1879ea1 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -941,7 +941,6 @@ static inline Real lowest() { return Real(-std::numeric_limits<T>::max()); } }; -#if EIGEN_VERSION_AT_LEAST(3, 3, 0) // Specifying the return type of binary operations between Jets and scalar types // allows you to perform matrix/array operations with Eigen matrices and arrays // such as addition, subtraction, multiplication, and division where one Eigen @@ -956,7 +955,6 @@ struct ScalarBinaryOpTraits<T, ceres::Jet<T, N>, BinaryOp> { typedef ceres::Jet<T, N> ReturnType; }; -#endif // EIGEN_VERSION_AT_LEAST(3, 3, 0) } // namespace Eigen
diff --git a/internal/ceres/eigensparse.cc b/internal/ceres/eigensparse.cc index 76dba31..22ed2c4 100644 --- a/internal/ceres/eigensparse.cc +++ b/internal/ceres/eigensparse.cc
@@ -143,10 +143,6 @@ const OrderingType ordering_type) { std::unique_ptr<SparseCholesky> sparse_cholesky; - // The preprocessor gymnastics here are dealing with the fact that - // before version 3.2.2, Eigen did not support a third template - // parameter to specify the ordering and it always defaults to AMD. -#if EIGEN_VERSION_AT_LEAST(3, 2, 2) typedef Eigen::SimplicialLDLT<Eigen::SparseMatrix<double>, Eigen::Upper, Eigen::AMDOrdering<int>> @@ -161,11 +157,6 @@ sparse_cholesky.reset( new EigenSparseCholeskyTemplate<WithNaturalOrdering>()); } -#else - typedef Eigen::SimplicialLDLT<Eigen::SparseMatrix<double>, Eigen::Upper> - WithAMDOrdering; - sparse_cholesky.reset(new EigenSparseCholeskyTemplate<WithAMDOrdering>()); -#endif return sparse_cholesky; } @@ -174,10 +165,6 @@ std::unique_ptr<SparseCholesky> FloatEigenSparseCholesky::Create( const OrderingType ordering_type) { std::unique_ptr<SparseCholesky> sparse_cholesky; - // The preprocessor gymnastics here are dealing with the fact that - // before version 3.2.2, Eigen did not support a third template - // parameter to specify the ordering and it always defaults to AMD. -#if EIGEN_VERSION_AT_LEAST(3, 2, 2) typedef Eigen::SimplicialLDLT<Eigen::SparseMatrix<float>, Eigen::Upper, Eigen::AMDOrdering<int>> @@ -192,11 +179,6 @@ sparse_cholesky.reset( new EigenSparseCholeskyTemplate<WithNaturalOrdering>()); } -#else - typedef Eigen::SimplicialLDLT<Eigen::SparseMatrix<float>, Eigen::Upper> - WithAMDOrdering; - sparse_cholesky.reset(new EigenSparseCholeskyTemplate<WithAMDOrdering>()); -#endif return sparse_cholesky; }
diff --git a/internal/ceres/jet_test.cc b/internal/ceres/jet_test.cc index 3f2b7d3..dff660b 100644 --- a/internal/ceres/jet_test.cc +++ b/internal/ceres/jet_test.cc
@@ -765,8 +765,6 @@ EXPECT_FALSE(IsNaN(a)); } -#if EIGEN_VERSION_AT_LEAST(3, 3, 0) - // The following test ensures that Jets have all the appropriate Eigen // related traits so that they can be used as part of matrix // decompositions. @@ -900,7 +898,6 @@ ExpectJetsClose(r3(0), r3(0)); ExpectJetsClose(r4(1), r4(1)); } -#endif // EIGEN_VERSION_AT_LEAST(3, 3, 0) } // namespace internal } // namespace ceres
diff --git a/internal/ceres/reorder_program.cc b/internal/ceres/reorder_program.cc index 45dbbc4..aa6032a 100644 --- a/internal/ceres/reorder_program.cc +++ b/internal/ceres/reorder_program.cc
@@ -85,7 +85,7 @@ return min_parameter_block_position; } -#if EIGEN_VERSION_AT_LEAST(3, 2, 2) && defined(CERES_USE_EIGEN_SPARSE) +#if defined(CERES_USE_EIGEN_SPARSE) Eigen::SparseMatrix<int> CreateBlockJacobian( const TripletSparseMatrix& block_jacobian_transpose) { typedef Eigen::SparseMatrix<int> SparseMatrix; @@ -179,7 +179,6 @@ } -#if EIGEN_VERSION_AT_LEAST(3, 2, 2) void OrderingForSparseNormalCholeskyUsingEigenSparse( const TripletSparseMatrix& tsm_block_jacobian_transpose, int* ordering) { @@ -212,7 +211,6 @@ } #endif // CERES_USE_EIGEN_SPARSE } -#endif } // namespace @@ -385,10 +383,7 @@ const int size_of_first_elimination_group, const ProblemImpl::ParameterMap& parameter_map, Program* program) { -#if !EIGEN_VERSION_AT_LEAST(3, 2, 2) || !defined(CERES_USE_EIGEN_SPARSE) - return; -#else - +#if defined(CERES_USE_EIGEN_SPARSE) std::unique_ptr<TripletSparseMatrix> tsm_block_jacobian_transpose( program->CreateJacobianBlockSparsityTranspose()); @@ -574,18 +569,9 @@ return true; } else if (sparse_linear_algebra_library_type == EIGEN_SPARSE) { -#if EIGEN_VERSION_AT_LEAST(3, 2, 2) - OrderingForSparseNormalCholeskyUsingEigenSparse( + OrderingForSparseNormalCholeskyUsingEigenSparse( *tsm_block_jacobian_transpose, &ordering[0]); -#else - // For Eigen versions less than 3.2.2, there is nothing to do as - // older versions of Eigen do not expose a method for doing - // symbolic analysis on pre-ordered matrices, so a block - // pre-ordering is a bit pointless. - - return true; -#endif } // Apply ordering.