blob: d0d962ea3d139bcf1124cde71137d42eb4d90620 [file] [log] [blame]
Austin Schuh70cc9552019-01-21 19:46:48 -08001// Ceres Solver - A fast non-linear least squares minimizer
Austin Schuh3de38b02024-06-25 18:25:10 -07002// Copyright 2023 Google Inc. All rights reserved.
Austin Schuh70cc9552019-01-21 19:46:48 -08003// http://ceres-solver.org/
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are met:
7//
8// * Redistributions of source code must retain the above copyright notice,
9// this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above copyright notice,
11// this list of conditions and the following disclaimer in the documentation
12// and/or other materials provided with the distribution.
13// * Neither the name of Google Inc. nor the names of its contributors may be
14// used to endorse or promote products derived from this software without
15// specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27// POSSIBILITY OF SUCH DAMAGE.
28//
29// Author: sameeragarwal@google.com (Sameer Agarwal)
30
31#include "ceres/sparse_cholesky.h"
32
33#include <memory>
34#include <numeric>
Austin Schuh3de38b02024-06-25 18:25:10 -070035#include <random>
Austin Schuh70cc9552019-01-21 19:46:48 -080036#include <vector>
37
38#include "Eigen/Dense"
39#include "Eigen/SparseCore"
40#include "ceres/block_sparse_matrix.h"
41#include "ceres/compressed_row_sparse_matrix.h"
42#include "ceres/inner_product_computer.h"
Austin Schuh3de38b02024-06-25 18:25:10 -070043#include "ceres/internal/config.h"
Austin Schuh70cc9552019-01-21 19:46:48 -080044#include "ceres/internal/eigen.h"
45#include "ceres/iterative_refiner.h"
Austin Schuh70cc9552019-01-21 19:46:48 -080046#include "glog/logging.h"
47#include "gmock/gmock.h"
48#include "gtest/gtest.h"
49
Austin Schuh3de38b02024-06-25 18:25:10 -070050namespace ceres::internal {
Austin Schuh70cc9552019-01-21 19:46:48 -080051
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080052namespace {
53
Austin Schuh3de38b02024-06-25 18:25:10 -070054std::unique_ptr<BlockSparseMatrix> CreateRandomFullRankMatrix(
55 const int num_col_blocks,
56 const int min_col_block_size,
57 const int max_col_block_size,
58 const double block_density,
59 std::mt19937& prng) {
Austin Schuh70cc9552019-01-21 19:46:48 -080060 // Create a random matrix
61 BlockSparseMatrix::RandomMatrixOptions options;
62 options.num_col_blocks = num_col_blocks;
63 options.min_col_block_size = min_col_block_size;
64 options.max_col_block_size = max_col_block_size;
65
66 options.num_row_blocks = 2 * num_col_blocks;
67 options.min_row_block_size = 1;
68 options.max_row_block_size = max_col_block_size;
69 options.block_density = block_density;
Austin Schuh3de38b02024-06-25 18:25:10 -070070 auto random_matrix = BlockSparseMatrix::CreateRandomMatrix(options, prng);
Austin Schuh70cc9552019-01-21 19:46:48 -080071
72 // Add a diagonal block sparse matrix to make it full rank.
73 Vector diagonal = Vector::Ones(random_matrix->num_cols());
Austin Schuh3de38b02024-06-25 18:25:10 -070074 auto block_diagonal = BlockSparseMatrix::CreateDiagonalMatrix(
75 diagonal.data(), random_matrix->block_structure()->cols);
Austin Schuh70cc9552019-01-21 19:46:48 -080076 random_matrix->AppendRows(*block_diagonal);
Austin Schuh3de38b02024-06-25 18:25:10 -070077 return random_matrix;
Austin Schuh70cc9552019-01-21 19:46:48 -080078}
79
Austin Schuh3de38b02024-06-25 18:25:10 -070080bool ComputeExpectedSolution(const CompressedRowSparseMatrix& lhs,
81 const Vector& rhs,
82 Vector* solution) {
Austin Schuh70cc9552019-01-21 19:46:48 -080083 Matrix eigen_lhs;
84 lhs.ToDenseMatrix(&eigen_lhs);
Austin Schuh3de38b02024-06-25 18:25:10 -070085 if (lhs.storage_type() ==
86 CompressedRowSparseMatrix::StorageType::UPPER_TRIANGULAR) {
Austin Schuh70cc9552019-01-21 19:46:48 -080087 Matrix full_lhs = eigen_lhs.selfadjointView<Eigen::Upper>();
88 Eigen::LLT<Matrix, Eigen::Upper> llt =
89 eigen_lhs.selfadjointView<Eigen::Upper>().llt();
90 if (llt.info() != Eigen::Success) {
91 return false;
92 }
93 *solution = llt.solve(rhs);
94 return (llt.info() == Eigen::Success);
95 }
96
97 Matrix full_lhs = eigen_lhs.selfadjointView<Eigen::Lower>();
98 Eigen::LLT<Matrix, Eigen::Lower> llt =
99 eigen_lhs.selfadjointView<Eigen::Lower>().llt();
100 if (llt.info() != Eigen::Success) {
101 return false;
102 }
103 *solution = llt.solve(rhs);
104 return (llt.info() == Eigen::Success);
105}
106
107void SparseCholeskySolverUnitTest(
108 const SparseLinearAlgebraLibraryType sparse_linear_algebra_library_type,
109 const OrderingType ordering_type,
110 const bool use_block_structure,
111 const int num_blocks,
112 const int min_block_size,
113 const int max_block_size,
Austin Schuh3de38b02024-06-25 18:25:10 -0700114 const double block_density,
115 std::mt19937& prng) {
Austin Schuh70cc9552019-01-21 19:46:48 -0800116 LinearSolver::Options sparse_cholesky_options;
117 sparse_cholesky_options.sparse_linear_algebra_library_type =
118 sparse_linear_algebra_library_type;
Austin Schuh3de38b02024-06-25 18:25:10 -0700119 sparse_cholesky_options.ordering_type = ordering_type;
120 auto sparse_cholesky = SparseCholesky::Create(sparse_cholesky_options);
Austin Schuh70cc9552019-01-21 19:46:48 -0800121 const CompressedRowSparseMatrix::StorageType storage_type =
122 sparse_cholesky->StorageType();
123
Austin Schuh3de38b02024-06-25 18:25:10 -0700124 auto m = CreateRandomFullRankMatrix(
125 num_blocks, min_block_size, max_block_size, block_density, prng);
126 auto inner_product_computer = InnerProductComputer::Create(*m, storage_type);
Austin Schuh70cc9552019-01-21 19:46:48 -0800127 inner_product_computer->Compute();
128 CompressedRowSparseMatrix* lhs = inner_product_computer->mutable_result();
129
130 if (!use_block_structure) {
131 lhs->mutable_row_blocks()->clear();
132 lhs->mutable_col_blocks()->clear();
133 }
134
135 Vector rhs = Vector::Random(lhs->num_rows());
136 Vector expected(lhs->num_rows());
137 Vector actual(lhs->num_rows());
138
139 EXPECT_TRUE(ComputeExpectedSolution(*lhs, rhs, &expected));
140 std::string message;
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800141 EXPECT_EQ(
142 sparse_cholesky->FactorAndSolve(lhs, rhs.data(), actual.data(), &message),
Austin Schuh3de38b02024-06-25 18:25:10 -0700143 LinearSolverTerminationType::SUCCESS);
Austin Schuh70cc9552019-01-21 19:46:48 -0800144 Matrix eigen_lhs;
145 lhs->ToDenseMatrix(&eigen_lhs);
146 EXPECT_NEAR((actual - expected).norm() / actual.norm(),
147 0.0,
148 std::numeric_limits<double>::epsilon() * 20)
149 << "\n"
150 << eigen_lhs;
151}
152
Austin Schuh3de38b02024-06-25 18:25:10 -0700153using Param =
154 ::testing::tuple<SparseLinearAlgebraLibraryType, OrderingType, bool>;
Austin Schuh70cc9552019-01-21 19:46:48 -0800155
156std::string ParamInfoToString(testing::TestParamInfo<Param> info) {
157 Param param = info.param;
158 std::stringstream ss;
159 ss << SparseLinearAlgebraLibraryTypeToString(::testing::get<0>(param)) << "_"
Austin Schuh3de38b02024-06-25 18:25:10 -0700160 << ::testing::get<1>(param) << "_"
Austin Schuh70cc9552019-01-21 19:46:48 -0800161 << (::testing::get<2>(param) ? "UseBlockStructure" : "NoBlockStructure");
162 return ss.str();
163}
164
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800165} // namespace
166
Austin Schuh70cc9552019-01-21 19:46:48 -0800167class SparseCholeskyTest : public ::testing::TestWithParam<Param> {};
168
169TEST_P(SparseCholeskyTest, FactorAndSolve) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700170 constexpr int kMinNumBlocks = 1;
171 constexpr int kMaxNumBlocks = 10;
172 constexpr int kNumTrials = 10;
173 constexpr int kMinBlockSize = 1;
174 constexpr int kMaxBlockSize = 5;
175
176 Param param = GetParam();
177
178 std::mt19937 prng;
179 std::uniform_real_distribution<double> distribution(0.1, 1.0);
Austin Schuh70cc9552019-01-21 19:46:48 -0800180
181 for (int num_blocks = kMinNumBlocks; num_blocks < kMaxNumBlocks;
182 ++num_blocks) {
183 for (int trial = 0; trial < kNumTrials; ++trial) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700184 const double block_density = distribution(prng);
Austin Schuh70cc9552019-01-21 19:46:48 -0800185 SparseCholeskySolverUnitTest(::testing::get<0>(param),
186 ::testing::get<1>(param),
187 ::testing::get<2>(param),
188 num_blocks,
189 kMinBlockSize,
190 kMaxBlockSize,
Austin Schuh3de38b02024-06-25 18:25:10 -0700191 block_density,
192 prng);
Austin Schuh70cc9552019-01-21 19:46:48 -0800193 }
194 }
195}
196
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800197namespace {
198
Austin Schuh70cc9552019-01-21 19:46:48 -0800199#ifndef CERES_NO_SUITESPARSE
Austin Schuh3de38b02024-06-25 18:25:10 -0700200INSTANTIATE_TEST_SUITE_P(
201 SuiteSparseCholesky,
202 SparseCholeskyTest,
203 ::testing::Combine(::testing::Values(SUITE_SPARSE),
204 ::testing::Values(OrderingType::AMD,
205 OrderingType::NATURAL),
206 ::testing::Values(true, false)),
207 ParamInfoToString);
Austin Schuh70cc9552019-01-21 19:46:48 -0800208#endif
209
Austin Schuh3de38b02024-06-25 18:25:10 -0700210#if !defined(CERES_NO_SUITESPARSE) && !defined(CERES_NO_CHOLMOD_PARTITION)
211INSTANTIATE_TEST_SUITE_P(
212 SuiteSparseCholeskyMETIS,
213 SparseCholeskyTest,
214 ::testing::Combine(::testing::Values(SUITE_SPARSE),
215 ::testing::Values(OrderingType::NESDIS),
216 ::testing::Values(true, false)),
217 ParamInfoToString);
218#endif // !defined(CERES_NO_SUITESPARSE) &&
219 // !defined(CERES_NO_CHOLMOD_PARTITION)
Austin Schuh70cc9552019-01-21 19:46:48 -0800220
221#ifndef CERES_NO_ACCELERATE_SPARSE
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800222INSTANTIATE_TEST_SUITE_P(
223 AccelerateSparseCholesky,
224 SparseCholeskyTest,
225 ::testing::Combine(::testing::Values(ACCELERATE_SPARSE),
Austin Schuh3de38b02024-06-25 18:25:10 -0700226 ::testing::Values(OrderingType::AMD,
227 OrderingType::NESDIS,
228 OrderingType::NATURAL),
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800229 ::testing::Values(true, false)),
230 ParamInfoToString);
Austin Schuh70cc9552019-01-21 19:46:48 -0800231
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800232INSTANTIATE_TEST_SUITE_P(
233 AccelerateSparseCholeskySingle,
234 SparseCholeskyTest,
235 ::testing::Combine(::testing::Values(ACCELERATE_SPARSE),
Austin Schuh3de38b02024-06-25 18:25:10 -0700236 ::testing::Values(OrderingType::AMD,
237 OrderingType::NESDIS,
238 OrderingType::NATURAL),
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800239 ::testing::Values(true, false)),
240 ParamInfoToString);
Austin Schuh70cc9552019-01-21 19:46:48 -0800241#endif
242
243#ifdef CERES_USE_EIGEN_SPARSE
Austin Schuh3de38b02024-06-25 18:25:10 -0700244INSTANTIATE_TEST_SUITE_P(
245 EigenSparseCholesky,
246 SparseCholeskyTest,
247 ::testing::Combine(::testing::Values(EIGEN_SPARSE),
248 ::testing::Values(OrderingType::AMD,
249 OrderingType::NATURAL),
250 ::testing::Values(true, false)),
251 ParamInfoToString);
Austin Schuh70cc9552019-01-21 19:46:48 -0800252
Austin Schuh3de38b02024-06-25 18:25:10 -0700253INSTANTIATE_TEST_SUITE_P(
254 EigenSparseCholeskySingle,
255 SparseCholeskyTest,
256 ::testing::Combine(::testing::Values(EIGEN_SPARSE),
257 ::testing::Values(OrderingType::AMD,
258 OrderingType::NATURAL),
259 ::testing::Values(true, false)),
260 ParamInfoToString);
261#endif // CERES_USE_EIGEN_SPARSE
262
263#if defined(CERES_USE_EIGEN_SPARSE) && !defined(CERES_NO_EIGEN_METIS)
264INSTANTIATE_TEST_SUITE_P(
265 EigenSparseCholeskyMETIS,
266 SparseCholeskyTest,
267 ::testing::Combine(::testing::Values(EIGEN_SPARSE),
268 ::testing::Values(OrderingType::NESDIS),
269 ::testing::Values(true, false)),
270 ParamInfoToString);
271
272INSTANTIATE_TEST_SUITE_P(
273 EigenSparseCholeskySingleMETIS,
274 SparseCholeskyTest,
275 ::testing::Combine(::testing::Values(EIGEN_SPARSE),
276 ::testing::Values(OrderingType::NESDIS),
277 ::testing::Values(true, false)),
278 ParamInfoToString);
279#endif // defined(CERES_USE_EIGEN_SPARSE) && !defined(CERES_NO_EIGEN_METIS)
Austin Schuh70cc9552019-01-21 19:46:48 -0800280
281class MockSparseCholesky : public SparseCholesky {
282 public:
283 MOCK_CONST_METHOD0(StorageType, CompressedRowSparseMatrix::StorageType());
284 MOCK_METHOD2(Factorize,
285 LinearSolverTerminationType(CompressedRowSparseMatrix* lhs,
286 std::string* message));
287 MOCK_METHOD3(Solve,
288 LinearSolverTerminationType(const double* rhs,
289 double* solution,
290 std::string* message));
291};
292
Austin Schuh3de38b02024-06-25 18:25:10 -0700293class MockSparseIterativeRefiner : public SparseIterativeRefiner {
Austin Schuh70cc9552019-01-21 19:46:48 -0800294 public:
Austin Schuh3de38b02024-06-25 18:25:10 -0700295 MockSparseIterativeRefiner() : SparseIterativeRefiner(1) {}
Austin Schuh70cc9552019-01-21 19:46:48 -0800296 MOCK_METHOD4(Refine,
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800297 void(const SparseMatrix& lhs,
298 const double* rhs,
299 SparseCholesky* sparse_cholesky,
300 double* solution));
Austin Schuh70cc9552019-01-21 19:46:48 -0800301};
302
Austin Schuh70cc9552019-01-21 19:46:48 -0800303using testing::_;
304using testing::Return;
305
306TEST(RefinedSparseCholesky, StorageType) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700307 auto sparse_cholesky = std::make_unique<MockSparseCholesky>();
308 auto iterative_refiner = std::make_unique<MockSparseIterativeRefiner>();
309 EXPECT_CALL(*sparse_cholesky, StorageType())
Austin Schuh70cc9552019-01-21 19:46:48 -0800310 .Times(1)
Austin Schuh3de38b02024-06-25 18:25:10 -0700311 .WillRepeatedly(
312 Return(CompressedRowSparseMatrix::StorageType::UPPER_TRIANGULAR));
313 EXPECT_CALL(*iterative_refiner, Refine(_, _, _, _)).Times(0);
Austin Schuh70cc9552019-01-21 19:46:48 -0800314 RefinedSparseCholesky refined_sparse_cholesky(std::move(sparse_cholesky),
315 std::move(iterative_refiner));
316 EXPECT_EQ(refined_sparse_cholesky.StorageType(),
Austin Schuh3de38b02024-06-25 18:25:10 -0700317 CompressedRowSparseMatrix::StorageType::UPPER_TRIANGULAR);
Austin Schuh70cc9552019-01-21 19:46:48 -0800318};
319
320TEST(RefinedSparseCholesky, Factorize) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700321 auto* mock_sparse_cholesky = new MockSparseCholesky;
322 auto* mock_iterative_refiner = new MockSparseIterativeRefiner;
Austin Schuh70cc9552019-01-21 19:46:48 -0800323 EXPECT_CALL(*mock_sparse_cholesky, Factorize(_, _))
324 .Times(1)
Austin Schuh3de38b02024-06-25 18:25:10 -0700325 .WillRepeatedly(Return(LinearSolverTerminationType::SUCCESS));
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800326 EXPECT_CALL(*mock_iterative_refiner, Refine(_, _, _, _)).Times(0);
Austin Schuh70cc9552019-01-21 19:46:48 -0800327 std::unique_ptr<SparseCholesky> sparse_cholesky(mock_sparse_cholesky);
Austin Schuh3de38b02024-06-25 18:25:10 -0700328 std::unique_ptr<SparseIterativeRefiner> iterative_refiner(
329 mock_iterative_refiner);
Austin Schuh70cc9552019-01-21 19:46:48 -0800330 RefinedSparseCholesky refined_sparse_cholesky(std::move(sparse_cholesky),
331 std::move(iterative_refiner));
332 CompressedRowSparseMatrix m(1, 1, 1);
333 std::string message;
334 EXPECT_EQ(refined_sparse_cholesky.Factorize(&m, &message),
Austin Schuh3de38b02024-06-25 18:25:10 -0700335 LinearSolverTerminationType::SUCCESS);
Austin Schuh70cc9552019-01-21 19:46:48 -0800336};
337
338TEST(RefinedSparseCholesky, FactorAndSolveWithUnsuccessfulFactorization) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700339 auto* mock_sparse_cholesky = new MockSparseCholesky;
340 auto* mock_iterative_refiner = new MockSparseIterativeRefiner;
Austin Schuh70cc9552019-01-21 19:46:48 -0800341 EXPECT_CALL(*mock_sparse_cholesky, Factorize(_, _))
342 .Times(1)
Austin Schuh3de38b02024-06-25 18:25:10 -0700343 .WillRepeatedly(Return(LinearSolverTerminationType::FAILURE));
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800344 EXPECT_CALL(*mock_sparse_cholesky, Solve(_, _, _)).Times(0);
345 EXPECT_CALL(*mock_iterative_refiner, Refine(_, _, _, _)).Times(0);
Austin Schuh70cc9552019-01-21 19:46:48 -0800346 std::unique_ptr<SparseCholesky> sparse_cholesky(mock_sparse_cholesky);
Austin Schuh3de38b02024-06-25 18:25:10 -0700347 std::unique_ptr<SparseIterativeRefiner> iterative_refiner(
348 mock_iterative_refiner);
Austin Schuh70cc9552019-01-21 19:46:48 -0800349 RefinedSparseCholesky refined_sparse_cholesky(std::move(sparse_cholesky),
350 std::move(iterative_refiner));
351 CompressedRowSparseMatrix m(1, 1, 1);
352 std::string message;
353 double rhs;
354 double solution;
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800355 EXPECT_EQ(
356 refined_sparse_cholesky.FactorAndSolve(&m, &rhs, &solution, &message),
Austin Schuh3de38b02024-06-25 18:25:10 -0700357 LinearSolverTerminationType::FAILURE);
Austin Schuh70cc9552019-01-21 19:46:48 -0800358};
359
360TEST(RefinedSparseCholesky, FactorAndSolveWithSuccess) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700361 auto* mock_sparse_cholesky = new MockSparseCholesky;
362 std::unique_ptr<MockSparseIterativeRefiner> mock_iterative_refiner(
363 new MockSparseIterativeRefiner);
Austin Schuh70cc9552019-01-21 19:46:48 -0800364 EXPECT_CALL(*mock_sparse_cholesky, Factorize(_, _))
365 .Times(1)
Austin Schuh3de38b02024-06-25 18:25:10 -0700366 .WillRepeatedly(Return(LinearSolverTerminationType::SUCCESS));
Austin Schuh70cc9552019-01-21 19:46:48 -0800367 EXPECT_CALL(*mock_sparse_cholesky, Solve(_, _, _))
368 .Times(1)
Austin Schuh3de38b02024-06-25 18:25:10 -0700369 .WillRepeatedly(Return(LinearSolverTerminationType::SUCCESS));
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800370 EXPECT_CALL(*mock_iterative_refiner, Refine(_, _, _, _)).Times(1);
Austin Schuh70cc9552019-01-21 19:46:48 -0800371
372 std::unique_ptr<SparseCholesky> sparse_cholesky(mock_sparse_cholesky);
Austin Schuh3de38b02024-06-25 18:25:10 -0700373 std::unique_ptr<SparseIterativeRefiner> iterative_refiner(
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800374 std::move(mock_iterative_refiner));
Austin Schuh70cc9552019-01-21 19:46:48 -0800375 RefinedSparseCholesky refined_sparse_cholesky(std::move(sparse_cholesky),
376 std::move(iterative_refiner));
377 CompressedRowSparseMatrix m(1, 1, 1);
378 std::string message;
379 double rhs;
380 double solution;
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800381 EXPECT_EQ(
382 refined_sparse_cholesky.FactorAndSolve(&m, &rhs, &solution, &message),
Austin Schuh3de38b02024-06-25 18:25:10 -0700383 LinearSolverTerminationType::SUCCESS);
Austin Schuh70cc9552019-01-21 19:46:48 -0800384};
385
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800386} // namespace
387
Austin Schuh3de38b02024-06-25 18:25:10 -0700388} // namespace ceres::internal