Add explicit no sparse linear algebra library available option.
- Previously we had no defined default value for
sparse_linear_algebra_library_type in Solver::Options if Ceres
was compiled with no sparse library available. Thus in that case,
the default value (dependent upon the compiler) would indicate that
one was available.
- Now we have an explicit option that means no sparse library is
available, which is now the default value in Solver::Options in this
case.
- Add a warning in CMake when the user disables all sparse libraries.
- Fix typos in trust_region_preprocessor_test:
(SUITE/CX)_SPARSE -> (SUITE/CX)SPARSE that induced failures when
no sparse libraries were available.
Change-Id: I869c399a12d42bfc44220cbb25ce6d6dd80236bd
diff --git a/include/ceres/solver.h b/include/ceres/solver.h
index 791630d..b2fa3ae 100644
--- a/include/ceres/solver.h
+++ b/include/ceres/solver.h
@@ -104,7 +104,8 @@
// Choose a default sparse linear algebra library in the order:
//
- // SUITE_SPARSE > CX_SPARSE > EIGEN_SPARSE
+ // SUITE_SPARSE > CX_SPARSE > EIGEN_SPARSE > NO_SPARSE
+ sparse_linear_algebra_library_type = NO_SPARSE;
#if !defined(CERES_NO_SUITESPARSE)
sparse_linear_algebra_library_type = SUITE_SPARSE;
#else
diff --git a/include/ceres/types.h b/include/ceres/types.h
index a07c893..8915188 100644
--- a/include/ceres/types.h
+++ b/include/ceres/types.h
@@ -157,7 +157,12 @@
// Eigen's sparse linear algebra routines. In particular Ceres uses
// the Simplicial LDLT routines.
- EIGEN_SPARSE
+ EIGEN_SPARSE,
+
+ // No sparse linear solver should be used. This does not necessarily
+ // imply that Ceres was built without any sparse library, although that
+ // is the likely use case, merely that one should not be used.
+ NO_SPARSE
};
enum DenseLinearAlgebraLibraryType {