Move most of suitesparse/cxsparse ifdef code to their headers

Main purpose of this is to make implementation files free from
endless ifdef blocks every time this libraries are needed to be
included. This would hopefully prevent compilation errors in
the future caused by missing ifdef around header include.

This also includes some stubs added to suitesparse/cxsparse
headers to make code even more free from ifdefs.

Change-Id: Ic8554e7df31d8c4751583fe004b99e71b3c9087b
This commit is contained in:
Sergey Sharybin
2013-08-15 14:50:08 +06:00
committed by Sameer Agarwal
parent dc60d9c451
commit f258e4624f
8 changed files with 26 additions and 44 deletions
@@ -36,11 +36,8 @@
#include <cstring>
#include <ctime>
#ifndef CERES_NO_CXSPARSE
#include "cs.h"
#endif
#include "ceres/compressed_row_sparse_matrix.h"
#include "ceres/cxsparse.h"
#include "ceres/internal/eigen.h"
#include "ceres/internal/scoped_ptr.h"
#include "ceres/linear_solver.h"
@@ -54,14 +51,9 @@ namespace internal {
SparseNormalCholeskySolver::SparseNormalCholeskySolver(
const LinearSolver::Options& options)
: options_(options) {
#ifndef CERES_NO_SUITESPARSE
factor_ = NULL;
#endif
#ifndef CERES_NO_CXSPARSE
cxsparse_factor_ = NULL;
#endif // CERES_NO_CXSPARSE
: factor_(NULL),
cxsparse_factor_(NULL),
options_(options) {
}
SparseNormalCholeskySolver::~SparseNormalCholeskySolver() {