12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205 |
- // Ceres Solver - A fast non-linear least squares minimizer
- // Copyright 2022 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: sameeragarwal@google.com (Sameer Agarwal)
- #include "ceres/solver.h"
- #include <cmath>
- #include <limits>
- #include <memory>
- #include <string>
- #include <vector>
- #include "ceres/autodiff_cost_function.h"
- #include "ceres/evaluation_callback.h"
- #include "ceres/manifold.h"
- #include "ceres/problem.h"
- #include "ceres/problem_impl.h"
- #include "ceres/sized_cost_function.h"
- #include "gtest/gtest.h"
- namespace ceres::internal {
- TEST(SolverOptions, DefaultTrustRegionOptionsAreValid) {
- Solver::Options options;
- options.minimizer_type = TRUST_REGION;
- std::string error;
- EXPECT_TRUE(options.IsValid(&error)) << error;
- }
- TEST(SolverOptions, DefaultLineSearchOptionsAreValid) {
- Solver::Options options;
- options.minimizer_type = LINE_SEARCH;
- std::string error;
- EXPECT_TRUE(options.IsValid(&error)) << error;
- }
- struct QuadraticCostFunctor {
- template <typename T>
- bool operator()(const T* const x, T* residual) const {
- residual[0] = T(5.0) - *x;
- return true;
- }
- static CostFunction* Create() {
- return new AutoDiffCostFunction<QuadraticCostFunctor, 1, 1>(
- new QuadraticCostFunctor);
- }
- };
- struct RememberingCallback : public IterationCallback {
- explicit RememberingCallback(double* x) : calls(0), x(x) {}
- CallbackReturnType operator()(const IterationSummary& summary) final {
- x_values.push_back(*x);
- return SOLVER_CONTINUE;
- }
- int calls;
- double* x;
- std::vector<double> x_values;
- };
- struct NoOpEvaluationCallback : EvaluationCallback {
- void PrepareForEvaluation(bool evaluate_jacobians,
- bool new_evaluation_point) final {
- (void)evaluate_jacobians;
- (void)new_evaluation_point;
- }
- };
- TEST(Solver, UpdateStateEveryIterationOptionNoEvaluationCallback) {
- double x = 50.0;
- const double original_x = x;
- Problem::Options problem_options;
- Problem problem(problem_options);
- problem.AddResidualBlock(QuadraticCostFunctor::Create(), nullptr, &x);
- Solver::Options options;
- options.linear_solver_type = DENSE_QR;
- RememberingCallback callback(&x);
- options.callbacks.push_back(&callback);
- Solver::Summary summary;
- int num_iterations;
- // First: update_state_every_iteration=false, evaluation_callback=nullptr.
- Solve(options, &problem, &summary);
- num_iterations =
- summary.num_successful_steps + summary.num_unsuccessful_steps;
- EXPECT_GT(num_iterations, 1);
- for (double value : callback.x_values) {
- EXPECT_EQ(50.0, value);
- }
- // Second: update_state_every_iteration=true, evaluation_callback=nullptr.
- x = 50.0;
- options.update_state_every_iteration = true;
- callback.x_values.clear();
- Solve(options, &problem, &summary);
- num_iterations =
- summary.num_successful_steps + summary.num_unsuccessful_steps;
- EXPECT_GT(num_iterations, 1);
- EXPECT_EQ(original_x, callback.x_values[0]);
- EXPECT_NE(original_x, callback.x_values[1]);
- }
- TEST(Solver, UpdateStateEveryIterationOptionWithEvaluationCallback) {
- double x = 50.0;
- const double original_x = x;
- Problem::Options problem_options;
- NoOpEvaluationCallback evaluation_callback;
- problem_options.evaluation_callback = &evaluation_callback;
- Problem problem(problem_options);
- problem.AddResidualBlock(QuadraticCostFunctor::Create(), nullptr, &x);
- Solver::Options options;
- options.linear_solver_type = DENSE_QR;
- RememberingCallback callback(&x);
- options.callbacks.push_back(&callback);
- Solver::Summary summary;
- int num_iterations;
- // First: update_state_every_iteration=true, evaluation_callback=!nullptr.
- x = 50.0;
- options.update_state_every_iteration = true;
- callback.x_values.clear();
- Solve(options, &problem, &summary);
- num_iterations =
- summary.num_successful_steps + summary.num_unsuccessful_steps;
- EXPECT_GT(num_iterations, 1);
- EXPECT_EQ(original_x, callback.x_values[0]);
- EXPECT_NE(original_x, callback.x_values[1]);
- // Second: update_state_every_iteration=false, evaluation_callback=!nullptr.
- x = 50.0;
- options.update_state_every_iteration = false;
- callback.x_values.clear();
- Solve(options, &problem, &summary);
- num_iterations =
- summary.num_successful_steps + summary.num_unsuccessful_steps;
- EXPECT_GT(num_iterations, 1);
- EXPECT_EQ(original_x, callback.x_values[0]);
- EXPECT_NE(original_x, callback.x_values[1]);
- }
- TEST(Solver, CantMixEvaluationCallbackWithInnerIterations) {
- double x = 50.0;
- double y = 60.0;
- Problem::Options problem_options;
- NoOpEvaluationCallback evaluation_callback;
- problem_options.evaluation_callback = &evaluation_callback;
- Problem problem(problem_options);
- problem.AddResidualBlock(QuadraticCostFunctor::Create(), nullptr, &x);
- problem.AddResidualBlock(QuadraticCostFunctor::Create(), nullptr, &y);
- Solver::Options options;
- options.use_inner_iterations = true;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, FAILURE);
- options.use_inner_iterations = false;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- }
- // The parameters must be in separate blocks so that they can be individually
- // set constant or not.
- struct Quadratic4DCostFunction {
- template <typename T>
- bool operator()(const T* const x,
- const T* const y,
- const T* const z,
- const T* const w,
- T* residual) const {
- // A 4-dimension axis-aligned quadratic.
- residual[0] = T(10.0) - *x + T(20.0) - *y + T(30.0) - *z + T(40.0) - *w;
- return true;
- }
- static CostFunction* Create() {
- return new AutoDiffCostFunction<Quadratic4DCostFunction, 1, 1, 1, 1, 1>(
- new Quadratic4DCostFunction);
- }
- };
- // A cost function that simply returns its argument.
- class UnaryIdentityCostFunction : public SizedCostFunction<1, 1> {
- public:
- bool Evaluate(double const* const* parameters,
- double* residuals,
- double** jacobians) const final {
- residuals[0] = parameters[0][0];
- if (jacobians != nullptr && jacobians[0] != nullptr) {
- jacobians[0][0] = 1.0;
- }
- return true;
- }
- };
- TEST(Solver, TrustRegionProblemHasNoParameterBlocks) {
- Problem problem;
- Solver::Options options;
- options.minimizer_type = TRUST_REGION;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_EQ(summary.message,
- "Function tolerance reached. "
- "No non-constant parameter blocks found.");
- }
- TEST(Solver, LineSearchProblemHasNoParameterBlocks) {
- Problem problem;
- Solver::Options options;
- options.minimizer_type = LINE_SEARCH;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_EQ(summary.message,
- "Function tolerance reached. "
- "No non-constant parameter blocks found.");
- }
- TEST(Solver, TrustRegionProblemHasZeroResiduals) {
- Problem problem;
- double x = 1;
- problem.AddParameterBlock(&x, 1);
- Solver::Options options;
- options.minimizer_type = TRUST_REGION;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_EQ(summary.message,
- "Function tolerance reached. "
- "No non-constant parameter blocks found.");
- }
- TEST(Solver, LineSearchProblemHasZeroResiduals) {
- Problem problem;
- double x = 1;
- problem.AddParameterBlock(&x, 1);
- Solver::Options options;
- options.minimizer_type = LINE_SEARCH;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_EQ(summary.message,
- "Function tolerance reached. "
- "No non-constant parameter blocks found.");
- }
- TEST(Solver, TrustRegionProblemIsConstant) {
- Problem problem;
- double x = 1;
- problem.AddResidualBlock(new UnaryIdentityCostFunction, nullptr, &x);
- problem.SetParameterBlockConstant(&x);
- Solver::Options options;
- options.minimizer_type = TRUST_REGION;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_EQ(summary.initial_cost, 1.0 / 2.0);
- EXPECT_EQ(summary.final_cost, 1.0 / 2.0);
- }
- TEST(Solver, LineSearchProblemIsConstant) {
- Problem problem;
- double x = 1;
- problem.AddResidualBlock(new UnaryIdentityCostFunction, nullptr, &x);
- problem.SetParameterBlockConstant(&x);
- Solver::Options options;
- options.minimizer_type = LINE_SEARCH;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_EQ(summary.initial_cost, 1.0 / 2.0);
- EXPECT_EQ(summary.final_cost, 1.0 / 2.0);
- }
- template <int kNumResiduals, int... Ns>
- class DummyCostFunction : public SizedCostFunction<kNumResiduals, Ns...> {
- public:
- bool Evaluate(double const* const* parameters,
- double* residuals,
- double** jacobians) const override {
- for (int i = 0; i < kNumResiduals; ++i) {
- residuals[i] = kNumResiduals * kNumResiduals + i;
- }
- return true;
- }
- };
- TEST(Solver, FixedCostForConstantProblem) {
- double x = 1.0;
- Problem problem;
- problem.AddResidualBlock(new DummyCostFunction<2, 1>(), nullptr, &x);
- problem.SetParameterBlockConstant(&x);
- const double expected_cost = 41.0 / 2.0; // 1/2 * ((4 + 0)^2 + (4 + 1)^2)
- Solver::Options options;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_TRUE(summary.IsSolutionUsable());
- EXPECT_EQ(summary.fixed_cost, expected_cost);
- EXPECT_EQ(summary.initial_cost, expected_cost);
- EXPECT_EQ(summary.final_cost, expected_cost);
- EXPECT_EQ(summary.iterations.size(), 0);
- }
- struct LinearCostFunction {
- template <typename T>
- bool operator()(const T* x, const T* y, T* residual) const {
- residual[0] = T(10.0) - *x;
- residual[1] = T(5.0) - *y;
- return true;
- }
- static CostFunction* Create() {
- return new AutoDiffCostFunction<LinearCostFunction, 2, 1, 1>(
- new LinearCostFunction);
- }
- };
- TEST(Solver, ZeroSizedManifoldHoldsParameterBlockConstant) {
- double x = 0.0;
- double y = 1.0;
- Problem problem;
- problem.AddResidualBlock(LinearCostFunction::Create(), nullptr, &x, &y);
- problem.SetManifold(&y, new SubsetManifold(1, {0}));
- EXPECT_TRUE(problem.IsParameterBlockConstant(&y));
- Solver::Options options;
- options.function_tolerance = 0.0;
- options.gradient_tolerance = 0.0;
- options.parameter_tolerance = 0.0;
- Solver::Summary summary;
- Solve(options, &problem, &summary);
- EXPECT_EQ(summary.termination_type, CONVERGENCE);
- EXPECT_NEAR(x, 10.0, 1e-7);
- EXPECT_EQ(y, 1.0);
- }
- TEST(Solver, DenseNormalCholeskyOptions) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = DENSE_NORMAL_CHOLESKY;
- EXPECT_TRUE(options.IsValid(&message));
- options.dense_linear_algebra_library_type = EIGEN;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- EXPECT_TRUE(options.IsValid(&message));
- if (IsDenseLinearAlgebraLibraryTypeAvailable(LAPACK)) {
- options.use_mixed_precision_solves = false;
- options.dense_linear_algebra_library_type = LAPACK;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- options.use_mixed_precision_solves = false;
- options.dense_linear_algebra_library_type = LAPACK;
- EXPECT_FALSE(options.IsValid(&message));
- }
- }
- TEST(Solver, DenseQrOptions) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = DENSE_QR;
- options.use_mixed_precision_solves = false;
- options.dense_linear_algebra_library_type = EIGEN;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- if (IsDenseLinearAlgebraLibraryTypeAvailable(LAPACK)) {
- options.use_mixed_precision_solves = false;
- options.dense_linear_algebra_library_type = LAPACK;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- } else {
- options.use_mixed_precision_solves = false;
- options.dense_linear_algebra_library_type = LAPACK;
- EXPECT_FALSE(options.IsValid(&message));
- }
- }
- TEST(Solver, SparseNormalCholeskyOptionsNoSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_NORMAL_CHOLESKY;
- options.sparse_linear_algebra_library_type = NO_SPARSE;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, SparseNormalCholeskyOptionsEigenSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_NORMAL_CHOLESKY;
- options.sparse_linear_algebra_library_type = EIGEN_SPARSE;
- options.linear_solver_ordering_type = AMD;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(EIGEN_SPARSE)) {
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- EXPECT_FALSE(options.IsValid(&message));
- }
- if (IsSparseLinearAlgebraLibraryTypeAvailable(EIGEN_SPARSE)) {
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_TRUE(options.IsValid(&message));
- }
- #ifndef CERES_NO_EIGEN_METIS
- options.linear_solver_ordering_type = NESDIS;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(EIGEN_SPARSE)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_TRUE(options.IsValid(&message));
- }
- #else
- options.linear_solver_ordering_type = NESDIS;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- #endif
- }
- TEST(Solver, SparseNormalCholeskyOptionsSuiteSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_NORMAL_CHOLESKY;
- options.sparse_linear_algebra_library_type = SUITE_SPARSE;
- options.linear_solver_ordering_type = AMD;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- EXPECT_FALSE(options.IsValid(&message));
- }
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- #ifndef CERES_NO_CHOLMOD_PARTITION
- options.linear_solver_ordering_type = NESDIS;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- #else
- options.linear_solver_ordering_type = NESDIS;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- #endif
- }
- TEST(Solver, SparseNormalCholeskyOptionsAccelerateSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_NORMAL_CHOLESKY;
- options.sparse_linear_algebra_library_type = ACCELERATE_SPARSE;
- options.linear_solver_ordering_type = AMD;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- EXPECT_FALSE(options.IsValid(&message));
- }
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- options.linear_solver_ordering_type = NESDIS;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- }
- TEST(Solver, DenseSchurOptions) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = DENSE_SCHUR;
- options.dense_linear_algebra_library_type = EIGEN;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.dense_linear_algebra_library_type = LAPACK;
- if (IsDenseLinearAlgebraLibraryTypeAvailable(
- options.dense_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- }
- TEST(Solver, SparseSchurOptionsNoSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_SCHUR;
- options.sparse_linear_algebra_library_type = NO_SPARSE;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, SparseSchurOptionsEigenSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_SCHUR;
- options.sparse_linear_algebra_library_type = EIGEN_SPARSE;
- options.linear_solver_ordering_type = AMD;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(EIGEN_SPARSE)) {
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- EXPECT_FALSE(options.IsValid(&message));
- }
- if (IsSparseLinearAlgebraLibraryTypeAvailable(EIGEN_SPARSE)) {
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- #ifndef CERES_NO_EIGEN_METIS
- options.linear_solver_ordering_type = NESDIS;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(EIGEN_SPARSE)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- #else
- options.linear_solver_ordering_type = NESDIS;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- #endif
- }
- TEST(Solver, SparseSchurOptionsSuiteSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_SCHUR;
- options.sparse_linear_algebra_library_type = SUITE_SPARSE;
- options.linear_solver_ordering_type = AMD;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- EXPECT_FALSE(options.IsValid(&message));
- }
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- #ifndef CERES_NO_CHOLMOD_PARTITION
- options.linear_solver_ordering_type = NESDIS;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- #else
- options.linear_solver_ordering_type = NESDIS;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_FALSE(options.IsValid(&message));
- #endif
- }
- TEST(Solver, SparseSchurOptionsAccelerateSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = SPARSE_SCHUR;
- options.sparse_linear_algebra_library_type = ACCELERATE_SPARSE;
- options.linear_solver_ordering_type = AMD;
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- EXPECT_TRUE(options.IsValid(&message));
- } else {
- EXPECT_FALSE(options.IsValid(&message));
- }
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- options.linear_solver_ordering_type = NESDIS;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.use_mixed_precision_solves = false;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_mixed_precision_solves = true;
- options.dynamic_sparsity = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- }
- TEST(Solver, CgnrOptionsIdentityPreconditioner) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = CGNR;
- options.preconditioner_type = IDENTITY;
- options.sparse_linear_algebra_library_type = NO_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = EIGEN_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = SUITE_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = ACCELERATE_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = CUDA_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(CUDA_SPARSE));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, CgnrOptionsJacobiPreconditioner) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = CGNR;
- options.preconditioner_type = JACOBI;
- options.sparse_linear_algebra_library_type = NO_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = EIGEN_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = SUITE_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = ACCELERATE_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = CUDA_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(CUDA_SPARSE));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, CgnrOptionsSubsetPreconditioner) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = CGNR;
- options.preconditioner_type = SUBSET;
- options.sparse_linear_algebra_library_type = NO_SPARSE;
- EXPECT_FALSE(options.IsValid(&message));
- options.residual_blocks_for_subset_preconditioner.insert(nullptr);
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- options.sparse_linear_algebra_library_type = EIGEN_SPARSE;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- options.sparse_linear_algebra_library_type = SUITE_SPARSE;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- options.sparse_linear_algebra_library_type = ACCELERATE_SPARSE;
- if (IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type)) {
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_TRUE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- options.sparse_linear_algebra_library_type = CUDA_SPARSE;
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = true;
- options.use_mixed_precision_solves = false;
- EXPECT_FALSE(options.IsValid(&message));
- options.dynamic_sparsity = false;
- options.use_mixed_precision_solves = true;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, CgnrOptionsSchurPreconditioners) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = CGNR;
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, IterativeSchurOptionsNoSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = ITERATIVE_SCHUR;
- options.sparse_linear_algebra_library_type = NO_SPARSE;
- options.preconditioner_type = IDENTITY;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = SUBSET;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_explicit_schur_complement = true;
- options.preconditioner_type = IDENTITY;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, IterativeSchurOptionsEigenSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = ITERATIVE_SCHUR;
- options.sparse_linear_algebra_library_type = EIGEN_SPARSE;
- options.preconditioner_type = IDENTITY;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type));
- options.preconditioner_type = SUBSET;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_explicit_schur_complement = true;
- options.preconditioner_type = IDENTITY;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, IterativeSchurOptionsSuiteSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = ITERATIVE_SCHUR;
- options.sparse_linear_algebra_library_type = SUITE_SPARSE;
- options.preconditioner_type = IDENTITY;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type));
- options.preconditioner_type = SUBSET;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_explicit_schur_complement = true;
- options.preconditioner_type = IDENTITY;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_FALSE(options.IsValid(&message));
- }
- TEST(Solver, IterativeSchurOptionsAccelerateSparse) {
- std::string message;
- Solver::Options options;
- options.linear_solver_type = ITERATIVE_SCHUR;
- options.sparse_linear_algebra_library_type = ACCELERATE_SPARSE;
- options.preconditioner_type = IDENTITY;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_EQ(options.IsValid(&message),
- IsSparseLinearAlgebraLibraryTypeAvailable(
- options.sparse_linear_algebra_library_type));
- options.preconditioner_type = SUBSET;
- EXPECT_FALSE(options.IsValid(&message));
- options.use_explicit_schur_complement = true;
- options.preconditioner_type = IDENTITY;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = SCHUR_JACOBI;
- EXPECT_TRUE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_JACOBI;
- EXPECT_FALSE(options.IsValid(&message));
- options.preconditioner_type = CLUSTER_TRIDIAGONAL;
- EXPECT_FALSE(options.IsValid(&message));
- }
- } // namespace ceres::internal
|