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
This commit is contained in:
Sameer Agarwal
2013-06-24 13:24:35 -07:00
parent c367b12eeb
commit 5d00bf40f5
2 changed files with 19 additions and 1 deletions
@@ -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 @@ class CompressedRowSparseMatrix : public SparseMatrix {
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);
+11 -1
View File
@@ -398,8 +398,11 @@ TEST_F(CovarianceTest, NormalBehavior) {
};
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 @@ TEST_F(CovarianceTest, ThreadedNormalBehavior) {
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 @@ TEST_F(CovarianceTest, ConstantParameterBlock) {
};
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 @@ TEST_F(CovarianceTest, LocalParameterization) {
-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);