mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user