Expand check for lack of a sparse linear algebra library.

The LinearSolver factory was creating a NULL linear solver
if only Eigen's sparse linear algebra backend was available.

Thanks to Michael Samples and Domink Reitzle for reporting this.

Change-Id: I35e3a6c0fd0da2a31934adb5dfe4cad29577cc73
This commit is contained in:
Sameer Agarwal
2014-08-27 22:54:00 -07:00
parent 12eb389b4e
commit 62a8d64453
2 changed files with 44 additions and 4 deletions
+6 -2
View File
@@ -75,14 +75,18 @@ LinearSolver* LinearSolver::Create(const LinearSolver::Options& options) {
return new CgnrSolver(options);
case SPARSE_NORMAL_CHOLESKY:
#if defined(CERES_NO_SUITESPARSE) && defined(CERES_NO_CXSPARSE)
#if defined(CERES_NO_SUITESPARSE) && \
defined(CERES_NO_CXSPARSE) && \
!defined(CERES_USE_EIGEN_SPARSE)
return NULL;
#else
return new SparseNormalCholeskySolver(options);
#endif
case SPARSE_SCHUR:
#if defined(CERES_NO_SUITESPARSE) && defined(CERES_NO_CXSPARSE)
#if defined(CERES_NO_SUITESPARSE) && \
defined(CERES_NO_CXSPARSE) && \
!defined(CERES_USE_EIGEN_SPARSE)
return NULL;
#else
return new SparseSchurComplementSolver(options);