diff --git a/docs/source/installation.rst b/docs/source/installation.rst index b3dfb50fe..c6ddfffea 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -32,7 +32,7 @@ optional. For details on customizing the build process, see :ref:`section-customizing` . - `Eigen `_ - 3.2.2 or later **strongly** recommended, 3.1.0 or later **required**. + 3.3 or later **required**. .. NOTE :: @@ -409,8 +409,8 @@ dependencies. #. 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 @@ dependencies. #. 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 @@ Options controlling Ceres configuration #. ``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 00ecdca14..1879ea18c 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -941,7 +941,6 @@ struct NumTraits> { static inline Real lowest() { return Real(-std::numeric_limits::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 @@ template struct ScalarBinaryOpTraits, BinaryOp> { typedef ceres::Jet ReturnType; }; -#endif // EIGEN_VERSION_AT_LEAST(3, 3, 0) } // namespace Eigen diff --git a/internal/ceres/eigensparse.cc b/internal/ceres/eigensparse.cc index 76dba31d9..22ed2c43b 100644 --- a/internal/ceres/eigensparse.cc +++ b/internal/ceres/eigensparse.cc @@ -143,10 +143,6 @@ std::unique_ptr EigenSparseCholesky::Create( const OrderingType ordering_type) { std::unique_ptr 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::Upper, Eigen::AMDOrdering> @@ -161,11 +157,6 @@ std::unique_ptr EigenSparseCholesky::Create( sparse_cholesky.reset( new EigenSparseCholeskyTemplate()); } -#else - typedef Eigen::SimplicialLDLT, Eigen::Upper> - WithAMDOrdering; - sparse_cholesky.reset(new EigenSparseCholeskyTemplate()); -#endif return sparse_cholesky; } @@ -174,10 +165,6 @@ EigenSparseCholesky::~EigenSparseCholesky() {} std::unique_ptr FloatEigenSparseCholesky::Create( const OrderingType ordering_type) { std::unique_ptr 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::Upper, Eigen::AMDOrdering> @@ -192,11 +179,6 @@ std::unique_ptr FloatEigenSparseCholesky::Create( sparse_cholesky.reset( new EigenSparseCholeskyTemplate()); } -#else - typedef Eigen::SimplicialLDLT, Eigen::Upper> - WithAMDOrdering; - sparse_cholesky.reset(new EigenSparseCholeskyTemplate()); -#endif return sparse_cholesky; } diff --git a/internal/ceres/jet_test.cc b/internal/ceres/jet_test.cc index 3f2b7d3ab..dff660bf2 100644 --- a/internal/ceres/jet_test.cc +++ b/internal/ceres/jet_test.cc @@ -765,8 +765,6 @@ TEST(JetTraitsTest, ClassificationFinite) { 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 @@ TEST(JetTraitsTest, ArrayScalarBinaryOps) { 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 45dbbc479..aa6032a9e 100644 --- a/internal/ceres/reorder_program.cc +++ b/internal/ceres/reorder_program.cc @@ -85,7 +85,7 @@ static int MinParameterBlock(const ResidualBlock* residual_block, 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 CreateBlockJacobian( const TripletSparseMatrix& block_jacobian_transpose) { typedef Eigen::SparseMatrix SparseMatrix; @@ -179,7 +179,6 @@ void OrderingForSparseNormalCholeskyUsingCXSparse( } -#if EIGEN_VERSION_AT_LEAST(3, 2, 2) void OrderingForSparseNormalCholeskyUsingEigenSparse( const TripletSparseMatrix& tsm_block_jacobian_transpose, int* ordering) { @@ -212,7 +211,6 @@ void OrderingForSparseNormalCholeskyUsingEigenSparse( } #endif // CERES_USE_EIGEN_SPARSE } -#endif } // namespace @@ -385,10 +383,7 @@ static void MaybeReorderSchurComplementColumnsUsingEigen( 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 tsm_block_jacobian_transpose( program->CreateJacobianBlockSparsityTranspose()); @@ -574,18 +569,9 @@ bool ReorderProgramForSparseCholesky( 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.