mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
cab853fd5f
1. Add EigenDenseQR & tests. This implementation now uses an in place decomposition, which means that we are not allocating, deallocating memory every call. 2. Add LAPACKDenseQR and tests. The LAPACK implementation instead of using dgels which is a routine which does the factorization and solve in one call, now uses dgeqrf for factorization and then dormqr and dtrtrs for solving. This allows us to have a factorize and solve interface like DenseCholesky. And opens the door to iterative refinement and mixed precision solves. 3. The refactor also allows us to simplify the interface to DenseSparseMatrix considerably. The internals of this class were complicated because we had the AppendDiagonal and RemoveDiagonal methods and we did not want to allocate deallocate memory every call. But since we pay the cost of the copy anyways, we can just hold that buffer in DenseQRSolver. 4. Delete lapack.cc/h 5. The net result is that everything seems to be a bit faster. For LAPACK we are not doing some of the scaling work that dgels was doing. For Eigen I think it maybe the inplace decomposition. Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/1/1 -0.1154 -0.1159 692 612 691 611 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/2/1 -0.1601 -0.1553 717 603 712 601 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/3/1 -0.1673 -0.1575 733 610 724 610 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/6/2 -0.1008 -0.1003 886 797 884 796 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/10/3 -0.1489 -0.1514 1283 1092 1281 1087 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/12/4 -0.1040 -0.1104 1556 1394 1553 1381 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/20/5 -0.0007 -0.0097 1911 1910 1908 1890 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/40/5 -0.1033 -0.1022 2981 2673 2957 2655 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/100/10 -0.0147 +0.0015 9275 9138 9026 9040 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/200/10 -0.1408 -0.1284 15093 12968 14778 12880 BM_DenseSolver<ceres::EIGEN, ceres::DENSE_QR>/200/20 -0.0310 -0.0355 38973 37765 38837 37460 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/1/1 -0.1228 -0.1256 736 646 731 640 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/2/1 -0.1401 -0.1396 740 636 735 633 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/3/1 -0.1731 -0.1695 744 615 738 613 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/6/2 -0.1399 -0.1408 1121 965 1113 956 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/10/3 -0.1110 -0.1145 1571 1397 1560 1382 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/12/4 -0.1411 -0.1417 2006 1722 1993 1710 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/20/5 -0.1740 -0.1729 2741 2264 2724 2253 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/40/5 -0.0966 -0.1123 3462 3128 3425 3040 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/100/10 -0.0387 -0.0998 10365 9964 10339 9307 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/200/10 -0.2044 -0.2049 16031 12754 15998 12720 BM_DenseSolver<ceres::LAPACK, ceres::DENSE_QR>/200/20 -0.2391 -0.2386 35777 27223 35716 27193 Change-Id: I782f0d7664efe1435eebda92ddf47a0fe66c9c72
440 lines
15 KiB
C++
440 lines
15 KiB
C++
// Ceres Solver - A fast non-linear least squares minimizer
|
|
// Copyright 2015 Google Inc. All rights reserved.
|
|
// http://ceres-solver.org/
|
|
//
|
|
// Redistribution and use in source and binary forms, with or without
|
|
// modification, are permitted provided that the following conditions are met:
|
|
//
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
// this list of conditions and the following disclaimer.
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
// and/or other materials provided with the distribution.
|
|
// * Neither the name of Google Inc. nor the names of its contributors may be
|
|
// used to endorse or promote products derived from this software without
|
|
// specific prior written permission.
|
|
//
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
//
|
|
// Author: keir@google.com (Keir Mierle)
|
|
// sameeragarwal@google.com (Sameer Agarwal)
|
|
//
|
|
// This tests the TrustRegionMinimizer loop using a direct Evaluator
|
|
// implementation, rather than having a test that goes through all the
|
|
// Program and Problem machinery.
|
|
|
|
#include "ceres/trust_region_minimizer.h"
|
|
|
|
#include <cmath>
|
|
|
|
#include "ceres/autodiff_cost_function.h"
|
|
#include "ceres/cost_function.h"
|
|
#include "ceres/dense_qr_solver.h"
|
|
#include "ceres/dense_sparse_matrix.h"
|
|
#include "ceres/evaluator.h"
|
|
#include "ceres/internal/port.h"
|
|
#include "ceres/linear_solver.h"
|
|
#include "ceres/minimizer.h"
|
|
#include "ceres/problem.h"
|
|
#include "ceres/trust_region_strategy.h"
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace ceres {
|
|
namespace internal {
|
|
|
|
// Templated Evaluator for Powell's function. The template parameters
|
|
// indicate which of the four variables/columns of the jacobian are
|
|
// active. This is equivalent to constructing a problem and using the
|
|
// SubsetManifold. This allows us to test the support for
|
|
// the Evaluator::Plus operation besides checking for the basic
|
|
// performance of the trust region algorithm.
|
|
template <bool col1, bool col2, bool col3, bool col4>
|
|
class PowellEvaluator2 : public Evaluator {
|
|
public:
|
|
// clang-format off
|
|
PowellEvaluator2()
|
|
: num_active_cols_(
|
|
(col1 ? 1 : 0) +
|
|
(col2 ? 1 : 0) +
|
|
(col3 ? 1 : 0) +
|
|
(col4 ? 1 : 0)) {
|
|
VLOG(1) << "Columns: "
|
|
<< col1 << " "
|
|
<< col2 << " "
|
|
<< col3 << " "
|
|
<< col4;
|
|
}
|
|
// clang-format on
|
|
|
|
virtual ~PowellEvaluator2() {}
|
|
|
|
// Implementation of Evaluator interface.
|
|
SparseMatrix* CreateJacobian() const final {
|
|
CHECK(col1 || col2 || col3 || col4);
|
|
DenseSparseMatrix* dense_jacobian =
|
|
new DenseSparseMatrix(NumResiduals(), NumEffectiveParameters());
|
|
dense_jacobian->SetZero();
|
|
return dense_jacobian;
|
|
}
|
|
|
|
bool Evaluate(const Evaluator::EvaluateOptions& evaluate_options,
|
|
const double* state,
|
|
double* cost,
|
|
double* residuals,
|
|
double* gradient,
|
|
SparseMatrix* jacobian) final {
|
|
const double x1 = state[0];
|
|
const double x2 = state[1];
|
|
const double x3 = state[2];
|
|
const double x4 = state[3];
|
|
|
|
VLOG(1) << "State: "
|
|
<< "x1=" << x1 << ", "
|
|
<< "x2=" << x2 << ", "
|
|
<< "x3=" << x3 << ", "
|
|
<< "x4=" << x4 << ".";
|
|
|
|
const double f1 = x1 + 10.0 * x2;
|
|
const double f2 = sqrt(5.0) * (x3 - x4);
|
|
const double f3 = pow(x2 - 2.0 * x3, 2.0);
|
|
const double f4 = sqrt(10.0) * pow(x1 - x4, 2.0);
|
|
|
|
VLOG(1) << "Function: "
|
|
<< "f1=" << f1 << ", "
|
|
<< "f2=" << f2 << ", "
|
|
<< "f3=" << f3 << ", "
|
|
<< "f4=" << f4 << ".";
|
|
|
|
*cost = (f1 * f1 + f2 * f2 + f3 * f3 + f4 * f4) / 2.0;
|
|
|
|
VLOG(1) << "Cost: " << *cost;
|
|
|
|
if (residuals != NULL) {
|
|
residuals[0] = f1;
|
|
residuals[1] = f2;
|
|
residuals[2] = f3;
|
|
residuals[3] = f4;
|
|
}
|
|
|
|
if (jacobian != NULL) {
|
|
DenseSparseMatrix* dense_jacobian;
|
|
dense_jacobian = down_cast<DenseSparseMatrix*>(jacobian);
|
|
dense_jacobian->SetZero();
|
|
|
|
Matrix& jacobian_matrix = *(dense_jacobian->mutable_matrix());
|
|
CHECK_EQ(jacobian_matrix.cols(), num_active_cols_);
|
|
|
|
int column_index = 0;
|
|
if (col1) {
|
|
// clang-format off
|
|
jacobian_matrix.col(column_index++) <<
|
|
1.0,
|
|
0.0,
|
|
0.0,
|
|
sqrt(10.0) * 2.0 * (x1 - x4);
|
|
// clang-format on
|
|
}
|
|
if (col2) {
|
|
// clang-format off
|
|
jacobian_matrix.col(column_index++) <<
|
|
10.0,
|
|
0.0,
|
|
2.0*(x2 - 2.0*x3),
|
|
0.0;
|
|
// clang-format on
|
|
}
|
|
|
|
if (col3) {
|
|
// clang-format off
|
|
jacobian_matrix.col(column_index++) <<
|
|
0.0,
|
|
sqrt(5.0),
|
|
4.0*(2.0*x3 - x2),
|
|
0.0;
|
|
// clang-format on
|
|
}
|
|
|
|
if (col4) {
|
|
// clang-format off
|
|
jacobian_matrix.col(column_index++) <<
|
|
0.0,
|
|
-sqrt(5.0),
|
|
0.0,
|
|
sqrt(10.0) * 2.0 * (x4 - x1);
|
|
// clang-format on
|
|
}
|
|
VLOG(1) << "\n" << jacobian_matrix;
|
|
}
|
|
|
|
if (gradient != NULL) {
|
|
int column_index = 0;
|
|
if (col1) {
|
|
gradient[column_index++] = f1 + f4 * sqrt(10.0) * 2.0 * (x1 - x4);
|
|
}
|
|
|
|
if (col2) {
|
|
gradient[column_index++] = f1 * 10.0 + f3 * 2.0 * (x2 - 2.0 * x3);
|
|
}
|
|
|
|
if (col3) {
|
|
gradient[column_index++] =
|
|
f2 * sqrt(5.0) + f3 * (4.0 * (2.0 * x3 - x2));
|
|
}
|
|
|
|
if (col4) {
|
|
gradient[column_index++] =
|
|
-f2 * sqrt(5.0) + f4 * sqrt(10.0) * 2.0 * (x4 - x1);
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
bool Plus(const double* state,
|
|
const double* delta,
|
|
double* state_plus_delta) const final {
|
|
int delta_index = 0;
|
|
state_plus_delta[0] = (col1 ? state[0] + delta[delta_index++] : state[0]);
|
|
state_plus_delta[1] = (col2 ? state[1] + delta[delta_index++] : state[1]);
|
|
state_plus_delta[2] = (col3 ? state[2] + delta[delta_index++] : state[2]);
|
|
state_plus_delta[3] = (col4 ? state[3] + delta[delta_index++] : state[3]);
|
|
return true;
|
|
}
|
|
|
|
int NumEffectiveParameters() const final { return num_active_cols_; }
|
|
int NumParameters() const final { return 4; }
|
|
int NumResiduals() const final { return 4; }
|
|
|
|
private:
|
|
const int num_active_cols_;
|
|
};
|
|
|
|
// Templated function to hold a subset of the columns fixed and check
|
|
// if the solver converges to the optimal values or not.
|
|
template <bool col1, bool col2, bool col3, bool col4>
|
|
void IsTrustRegionSolveSuccessful(TrustRegionStrategyType strategy_type) {
|
|
Solver::Options solver_options;
|
|
LinearSolver::Options linear_solver_options;
|
|
DenseQRSolver linear_solver(linear_solver_options);
|
|
|
|
double parameters[4] = {3, -1, 0, 1.0};
|
|
|
|
// If the column is inactive, then set its value to the optimal
|
|
// value.
|
|
parameters[0] = (col1 ? parameters[0] : 0.0);
|
|
parameters[1] = (col2 ? parameters[1] : 0.0);
|
|
parameters[2] = (col3 ? parameters[2] : 0.0);
|
|
parameters[3] = (col4 ? parameters[3] : 0.0);
|
|
|
|
Minimizer::Options minimizer_options(solver_options);
|
|
minimizer_options.gradient_tolerance = 1e-26;
|
|
minimizer_options.function_tolerance = 1e-26;
|
|
minimizer_options.parameter_tolerance = 1e-26;
|
|
minimizer_options.evaluator.reset(
|
|
new PowellEvaluator2<col1, col2, col3, col4>);
|
|
minimizer_options.jacobian.reset(
|
|
minimizer_options.evaluator->CreateJacobian());
|
|
|
|
TrustRegionStrategy::Options trust_region_strategy_options;
|
|
trust_region_strategy_options.trust_region_strategy_type = strategy_type;
|
|
trust_region_strategy_options.linear_solver = &linear_solver;
|
|
trust_region_strategy_options.initial_radius = 1e4;
|
|
trust_region_strategy_options.max_radius = 1e20;
|
|
trust_region_strategy_options.min_lm_diagonal = 1e-6;
|
|
trust_region_strategy_options.max_lm_diagonal = 1e32;
|
|
minimizer_options.trust_region_strategy.reset(
|
|
TrustRegionStrategy::Create(trust_region_strategy_options));
|
|
|
|
TrustRegionMinimizer minimizer;
|
|
Solver::Summary summary;
|
|
minimizer.Minimize(minimizer_options, parameters, &summary);
|
|
|
|
// The minimum is at x1 = x2 = x3 = x4 = 0.
|
|
EXPECT_NEAR(0.0, parameters[0], 0.001);
|
|
EXPECT_NEAR(0.0, parameters[1], 0.001);
|
|
EXPECT_NEAR(0.0, parameters[2], 0.001);
|
|
EXPECT_NEAR(0.0, parameters[3], 0.001);
|
|
}
|
|
|
|
TEST(TrustRegionMinimizer, PowellsSingularFunctionUsingLevenbergMarquardt) {
|
|
// This case is excluded because this has a local minimum and does
|
|
// not find the optimum. This should not affect the correctness of
|
|
// this test since we are testing all the other 14 combinations of
|
|
// column activations.
|
|
//
|
|
// IsSolveSuccessful<true, true, false, true>();
|
|
|
|
const TrustRegionStrategyType kStrategy = LEVENBERG_MARQUARDT;
|
|
// clang-format off
|
|
IsTrustRegionSolveSuccessful<true, true, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, true, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, true, false, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, false, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, false, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, false, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, false, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, false, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, false, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, false, false, true >(kStrategy);
|
|
// clang-format on
|
|
}
|
|
|
|
TEST(TrustRegionMinimizer, PowellsSingularFunctionUsingDogleg) {
|
|
// The following two cases are excluded because they encounter a
|
|
// local minimum.
|
|
//
|
|
// IsTrustRegionSolveSuccessful<true, true, false, true >(kStrategy);
|
|
// IsTrustRegionSolveSuccessful<true, true, true, true >(kStrategy);
|
|
|
|
const TrustRegionStrategyType kStrategy = DOGLEG;
|
|
// clang-format off
|
|
IsTrustRegionSolveSuccessful<true, true, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, true, false, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, false, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, false, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, false, true, true >(kStrategy);
|
|
IsTrustRegionSolveSuccessful<true, false, false, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, true, false, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, false, true, false>(kStrategy);
|
|
IsTrustRegionSolveSuccessful<false, false, false, true >(kStrategy);
|
|
// clang-format on
|
|
}
|
|
|
|
class CurveCostFunction : public CostFunction {
|
|
public:
|
|
CurveCostFunction(int num_vertices, double target_length)
|
|
: num_vertices_(num_vertices), target_length_(target_length) {
|
|
set_num_residuals(1);
|
|
for (int i = 0; i < num_vertices_; ++i) {
|
|
mutable_parameter_block_sizes()->push_back(2);
|
|
}
|
|
}
|
|
|
|
bool Evaluate(double const* const* parameters,
|
|
double* residuals,
|
|
double** jacobians) const {
|
|
residuals[0] = target_length_;
|
|
|
|
for (int i = 0; i < num_vertices_; ++i) {
|
|
int prev = (num_vertices_ + i - 1) % num_vertices_;
|
|
double length = 0.0;
|
|
for (int dim = 0; dim < 2; dim++) {
|
|
const double diff = parameters[prev][dim] - parameters[i][dim];
|
|
length += diff * diff;
|
|
}
|
|
residuals[0] -= sqrt(length);
|
|
}
|
|
|
|
if (jacobians == NULL) {
|
|
return true;
|
|
}
|
|
|
|
for (int i = 0; i < num_vertices_; ++i) {
|
|
if (jacobians[i] != NULL) {
|
|
int prev = (num_vertices_ + i - 1) % num_vertices_;
|
|
int next = (i + 1) % num_vertices_;
|
|
|
|
double u[2], v[2];
|
|
double norm_u = 0., norm_v = 0.;
|
|
for (int dim = 0; dim < 2; dim++) {
|
|
u[dim] = parameters[i][dim] - parameters[prev][dim];
|
|
norm_u += u[dim] * u[dim];
|
|
v[dim] = parameters[next][dim] - parameters[i][dim];
|
|
norm_v += v[dim] * v[dim];
|
|
}
|
|
|
|
norm_u = sqrt(norm_u);
|
|
norm_v = sqrt(norm_v);
|
|
|
|
for (int dim = 0; dim < 2; dim++) {
|
|
jacobians[i][dim] = 0.;
|
|
|
|
if (norm_u > std::numeric_limits<double>::min()) {
|
|
jacobians[i][dim] -= u[dim] / norm_u;
|
|
}
|
|
|
|
if (norm_v > std::numeric_limits<double>::min()) {
|
|
jacobians[i][dim] += v[dim] / norm_v;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
private:
|
|
int num_vertices_;
|
|
double target_length_;
|
|
};
|
|
|
|
TEST(TrustRegionMinimizer, JacobiScalingTest) {
|
|
int N = 6;
|
|
std::vector<double*> y(N);
|
|
const double pi = 3.1415926535897932384626433;
|
|
for (int i = 0; i < N; i++) {
|
|
double theta = i * 2. * pi / static_cast<double>(N);
|
|
y[i] = new double[2];
|
|
y[i][0] = cos(theta);
|
|
y[i][1] = sin(theta);
|
|
}
|
|
|
|
Problem problem;
|
|
problem.AddResidualBlock(new CurveCostFunction(N, 10.), NULL, y);
|
|
Solver::Options options;
|
|
options.linear_solver_type = ceres::DENSE_QR;
|
|
Solver::Summary summary;
|
|
Solve(options, &problem, &summary);
|
|
EXPECT_LE(summary.final_cost, 1e-10);
|
|
|
|
for (int i = 0; i < N; i++) {
|
|
delete[] y[i];
|
|
}
|
|
}
|
|
|
|
struct ExpCostFunctor {
|
|
template <typename T>
|
|
bool operator()(const T* const x, T* residual) const {
|
|
residual[0] = T(10.0) - exp(x[0]);
|
|
return true;
|
|
}
|
|
|
|
static CostFunction* Create() {
|
|
return new AutoDiffCostFunction<ExpCostFunctor, 1, 1>(new ExpCostFunctor);
|
|
}
|
|
};
|
|
|
|
TEST(TrustRegionMinimizer, GradientToleranceConvergenceUpdatesStep) {
|
|
double x = 5;
|
|
Problem problem;
|
|
problem.AddResidualBlock(ExpCostFunctor::Create(), NULL, &x);
|
|
problem.SetParameterLowerBound(&x, 0, 3.0);
|
|
Solver::Options options;
|
|
Solver::Summary summary;
|
|
Solve(options, &problem, &summary);
|
|
EXPECT_NEAR(3.0, x, 1e-12);
|
|
const double expected_final_cost = 0.5 * pow(10.0 - exp(3.0), 2);
|
|
EXPECT_NEAR(expected_final_cost, summary.final_cost, 1e-12);
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace ceres
|