Fix the broken build. 1. When protocol buffers support is enabled CompressedRowSparseMatrix has a missing virtual method. 2. When SuiteSparse is missing, covariance_test tries to run the large scale covariance computation test. Thanks to Alex Stewart for reporting #1. Change-Id: I4238c966036362175e31749595ea8bb6f12a696c
diff --git a/internal/ceres/compressed_row_sparse_matrix.h b/internal/ceres/compressed_row_sparse_matrix.h index d65d5c7..d60b580 100644 --- a/internal/ceres/compressed_row_sparse_matrix.h +++ b/internal/ceres/compressed_row_sparse_matrix.h
@@ -36,6 +36,7 @@ #include "ceres/internal/port.h" #include "ceres/sparse_matrix.h" #include "ceres/types.h" +#include "glog/logging.h" namespace ceres { @@ -91,6 +92,13 @@ virtual const double* values() const { return &values_[0]; } virtual double* mutable_values() { return &values_[0]; } +#ifndef CERES_NO_PROTOCOL_BUFFERS + // Dump the sparse matrix to a proto. Destroys the contents of proto. + virtual void ToProto(SparseMatrixProto* proto) const { + LOG(FATAL) << "Broken.;"; + } +#endif + // Delete the bottom delta_rows. // num_rows -= delta_rows void DeleteRows(int delta_rows);
diff --git a/internal/ceres/covariance_test.cc b/internal/ceres/covariance_test.cc index bd0a0e2..f9c5cd4 100644 --- a/internal/ceres/covariance_test.cc +++ b/internal/ceres/covariance_test.cc
@@ -398,8 +398,11 @@ }; Covariance::Options options; + +#ifndef CERES_NO_SUITESPARSE options.use_dense_linear_algebra = false; ComputeAndCompareCovarianceBlocks(options, expected_covariance); +#endif options.use_dense_linear_algebra = true; ComputeAndCompareCovarianceBlocks(options, expected_covariance); @@ -441,8 +444,10 @@ Covariance::Options options; options.num_threads = 4; +#ifndef CERES_NO_SUITESPARSE options.use_dense_linear_algebra = false; ComputeAndCompareCovarianceBlocks(options, expected_covariance); +#endif options.use_dense_linear_algebra = true; ComputeAndCompareCovarianceBlocks(options, expected_covariance); @@ -484,8 +489,11 @@ }; Covariance::Options options; + +#ifndef CERES_NO_SUITESPARSE options.use_dense_linear_algebra = false; ComputeAndCompareCovarianceBlocks(options, expected_covariance); +#endif options.use_dense_linear_algebra = true; ComputeAndCompareCovarianceBlocks(options, expected_covariance); @@ -533,10 +541,12 @@ -0.00122, -0.00122, -0.00149, -0.00298, 0.00000, 0.03457 }; - Covariance::Options options; + +#ifndef CERES_NO_SUITESPARSE options.use_dense_linear_algebra = false; ComputeAndCompareCovarianceBlocks(options, expected_covariance); +#endif options.use_dense_linear_algebra = true; ComputeAndCompareCovarianceBlocks(options, expected_covariance);