| 1 | // Ceres Solver - A fast non-linear least squares minimizercxx . . $ `<file>/internal/ceres/power_series_expansion_preconditioner_test.cc`/ |
| 2 | // Copyright 2023 Google Inc. All rights reserved. |
| 3 | // 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: [email protected] (Mark Shachkov) |
| 30 | |
| 31 | #include "ceres/power_series_expansion_preconditioner.h"cxx . . $ `<file>/internal/ceres/power_series_expansion_preconditioner.h`/ |
| 32 | |
| 33 | #include <memory> |
| 34 | |
| 35 | #include "Eigen/Dense" |
| 36 | #include "ceres/linear_least_squares_problems.h"cxx . . $ `<file>/internal/ceres/linear_least_squares_problems.h`/ |
| 37 | #include "gtest/gtest.h"cxx . . $ `<file>/internal/ceres/gtest/gtest.h`/ |
| 38 | |
| 39 | namespace cerescxx . . $ ceres/::internalcxx . . $ ceres/internal/ { |
| 40 | |
| 41 | const double kEpsiloncxx . . $ ceres/internal/kEpsilon. = 1e-14; |
| 42 | |
| 43 | class PowerSeriesExpansionPreconditionerTestcxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest# : public ::testingcxx . . $ testing/::Testcxx . . $ testing/Test# { |
| 44 | protected: |
| 45 | void SetUpcxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#SetUp(49f6e7a06ebc5aa8).() final { |
| 46 | problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_. =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). CreateLinearLeastSquaresProblemFromIdcxx . . $ ceres/internal/CreateLinearLeastSquaresProblemFromId(c3f679e54539ce44).(5); |
| 47 | const auto A = down_castcxx . . $ ceres/down_cast(1032eac53f7286c).<BlockSparseMatrixcxx . . $ ceres/internal/BlockSparseMatrix#*>(problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).Acxx . . $ ceres/internal/LinearLeastSquaresProblem#A..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).()); |
| 48 | const auto D = problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).Dcxx . . $ ceres/internal/LinearLeastSquaresProblem#D..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(); |
| 49 | |
| 50 | options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#options_..elimination_groupscxx . . $ ceres/internal/LinearSolver#Options#elimination_groups..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).num_eliminate_blockscxx . . $ ceres/internal/LinearLeastSquaresProblem#num_eliminate_blocks.); |
| 51 | options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#options_..preconditioner_typecxx . . $ ceres/internal/LinearSolver#Options#preconditioner_type. = SCHUR_POWER_SERIES_EXPANSIONcxx . . $ ceres/SCHUR_POWER_SERIES_EXPANSION.; |
| 52 | preconditioner_options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#preconditioner_options_. =cxx . . $ ceres/internal/Preconditioner#Options#`operator=`(bf0c15987d0e9b22). Preconditionercxx . . $ ceres/internal/Preconditioner#::Optionscxx . . $ ceres/internal/Preconditioner#Options#(options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#options_.); |
| 53 | isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_. =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<ImplicitSchurComplementcxx . . $ ceres/internal/ImplicitSchurComplement#>(options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#options_.); |
| 54 | isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).Initcxx . . $ ceres/internal/ImplicitSchurComplement#Init(7a594c893c4040e5).(*A, D, problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).bcxx . . $ ceres/internal/LinearLeastSquaresProblem#b..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).()); |
| 55 | num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_. = isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).rhscxx . . $ ceres/internal/ImplicitSchurComplement#rhs(bb71754208da2340).().rowscxx . . $ Eigen/PlainObjectBase#rows(51018398d23244e3).(); |
| 56 | const int num_rows = A->num_rowscxx . . $ ceres/internal/BlockSparseMatrix#num_rows(455f465bc33b4cdf).(), num_cols = A->num_colscxx . . $ ceres/internal/BlockSparseMatrix#num_cols(455f465bc33b4cdf).(), |
| 57 | num_e_cols = num_cols - num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.; |
| 58 | |
| 59 | // Using predefined linear operator with schur structure and block-diagonal |
| 60 | // F'F to explicitly construct schur complement and to calculate its inverse |
| 61 | // to be used as a reference. |
| 62 | Matrixcxx . . $ ceres/Matrix# A_densecxx . . $ Eigen/Matrix#Matrix(49f6e7a06ebc5aa8)., Ecxx . . $ Eigen/Matrix#Matrix(49f6e7a06ebc5aa8)., Fcxx . . $ Eigen/Matrix#Matrix(49f6e7a06ebc5aa8)., DEcxx . . $ Eigen/Matrix#Matrix(49f6e7a06ebc5aa8)., DFcxx . . $ Eigen/Matrix#Matrix(49f6e7a06ebc5aa8).; |
| 63 | problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).Acxx . . $ ceres/internal/LinearLeastSquaresProblem#A.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).ToDenseMatrixcxx . . $ ceres/internal/SparseMatrix#ToDenseMatrix(de7d277d7d69b5e3).(&A_dense); |
| 64 | E =cxx . . $ Eigen/Matrix#`operator=`(24f3321d7c59ffed). A_dense.leftColscxx . . $ Eigen/DenseBase#leftCols(20fa195bf94fe073).(num_e_cols); |
| 65 | F =cxx . . $ Eigen/Matrix#`operator=`(24f3321d7c59ffed). A_dense.rightColscxx . . $ Eigen/DenseBase#rightCols(20fa195bf94fe073).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.); |
| 66 | DE =cxx . . $ Eigen/Matrix#`operator=`(af177dfaa4751aca). VectorRefcxx . . $ Eigen/Map#Map(4dc11cacba148567).(D, num_e_cols).asDiagonalcxx . . $ Eigen/MatrixBase#asDiagonal(94ffa588b9df6c50).(); |
| 67 | DF =cxx . . $ Eigen/Matrix#`operator=`(af177dfaa4751aca). VectorRefcxx . . $ Eigen/Map#Map(4dc11cacba148567).(D + num_e_cols, num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.).asDiagonalcxx . . $ Eigen/MatrixBase#asDiagonal(94ffa588b9df6c50).(); |
| 68 | |
| 69 | sc_inverse_expected_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#sc_inverse_expected_. =cxx . . $ Eigen/Matrix#`operator=`(24f3321d7c59ffed). |
| 70 | (F.transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).() *cxx . . $ Eigen/MatrixBase#`operator*`(ff6f680c5b873dd0). |
| 71 | (Matrixcxx . . $ ceres/Matrix#::Identitycxx . . $ Eigen/MatrixBase#Identity(a18c5ed07c452574).(num_rows, num_rows) -cxx . . $ Eigen/MatrixBase#operator-(fd03634741fad72f). |
| 72 | E *cxx . . $ Eigen/MatrixBase#`operator*`(ff6f680c5b873dd0). (E.transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).() *cxx . . $ Eigen/MatrixBase#`operator*`(ff6f680c5b873dd0). E +cxx . . $ Eigen/MatrixBase#operator+(5b980a29d77f232c). DE).inversecxx . . $ Eigen/MatrixBase#inverse(c16a78d4dae44f99).() *cxx . . $ Eigen/MatrixBase#`operator*`(ff6f680c5b873dd0). E.transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).()) *cxx . . $ Eigen/MatrixBase#`operator*`(ff6f680c5b873dd0). |
| 73 | F +cxx . . $ Eigen/MatrixBase#operator+(5b980a29d77f232c). |
| 74 | DF) |
| 75 | .inversecxx . . $ Eigen/MatrixBase#inverse(c16a78d4dae44f99).(); |
| 76 | } |
| 77 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<LinearLeastSquaresProblemcxx . . $ ceres/internal/LinearLeastSquaresProblem#> problem_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#problem_.; |
| 78 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<ImplicitSchurComplementcxx . . $ ceres/internal/ImplicitSchurComplement#> isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_.; |
| 79 | int num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.; |
| 80 | Matrixcxx . . $ ceres/Matrix# sc_inverse_expected_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#sc_inverse_expected_.; |
| 81 | LinearSolvercxx . . $ ceres/internal/LinearSolver#::Optionscxx . . $ ceres/internal/LinearSolver#Options# options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#options_.; |
| 82 | Preconditionercxx . . $ ceres/internal/Preconditioner#::Optionscxx . . $ ceres/internal/Preconditioner#Options# preconditioner_options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#preconditioner_options_.; |
| 83 | }; |
| 84 | |
| 85 | TEST_Fcxx . . $ `internal/ceres/gtest/gtest.h:12266:9`!(PowerSeriesExpansionPreconditionerTest, |
| 86 | InverseValidPreconditionerToleranceReached) { |
| 87 | const double spse_tolerance = kEpsiloncxx . . $ ceres/internal/kEpsilon.; |
| 88 | const int max_num_iterations = 50; |
| 89 | PowerSeriesExpansionPreconditionercxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner# preconditionercxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#PowerSeriesExpansionPreconditioner(5636533f9845f4e4).( |
| 90 | isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(), max_num_iterations, spse_tolerance, preconditioner_options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#preconditioner_options_.); |
| 91 | |
| 92 | Vectorcxx . . $ ceres/Vector# xcxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.), ycxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.); |
| 93 | for (int i = 0; i < num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.; i++) { |
| 94 | x.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 95 | x(cxx . . $ Eigen/DenseCoeffsBase#`operator()`(1905f20a50b1238d).i) = 1.0; |
| 96 | |
| 97 | y.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 98 | preconditioner.RightMultiplyAndAccumulatecxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#RightMultiplyAndAccumulate(e2830e709b966a15).(x.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).(), y.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).()); |
| 99 | EXPECT_LTcxx . . $ `internal/ceres/gtest/gtest.h:11931:9`!((y - sc_inverse_expected_.col(i)).norm(), kEpsilon) |
| 100 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). "Reference Schur complement inverse and its estimate via " |
| 101 | "PowerSeriesExpansionPreconditioner differs in " |
| 102 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). i |
| 103 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). " column.\nreference : " <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). sc_inverse_expected_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#sc_inverse_expected_..colcxx . . $ Eigen/DenseBase#col(a84c988c80554028).(i).transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).() |
| 104 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). "\nestimated: " <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). y.transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).(); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | TEST_Fcxx . . $ `internal/ceres/gtest/gtest.h:12266:9`!(PowerSeriesExpansionPreconditionerTest, |
| 109 | InverseValidPreconditionerMaxIterations) { |
| 110 | const double spse_tolerance = 0; |
| 111 | const int max_num_iterations = 50; |
| 112 | PowerSeriesExpansionPreconditionercxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner# preconditioner_fixed_n_iterationscxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#PowerSeriesExpansionPreconditioner(5636533f9845f4e4).( |
| 113 | isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(), max_num_iterations, spse_tolerance, preconditioner_options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#preconditioner_options_.); |
| 114 | |
| 115 | Vectorcxx . . $ ceres/Vector# xcxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.), ycxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.); |
| 116 | for (int i = 0; i < num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.; i++) { |
| 117 | x.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 118 | x(cxx . . $ Eigen/DenseCoeffsBase#`operator()`(1905f20a50b1238d).i) = 1.0; |
| 119 | |
| 120 | y.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 121 | preconditioner_fixed_n_iterations.RightMultiplyAndAccumulatecxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#RightMultiplyAndAccumulate(e2830e709b966a15).(x.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).(), |
| 122 | y.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).()); |
| 123 | EXPECT_LTcxx . . $ `internal/ceres/gtest/gtest.h:11931:9`!((y - sc_inverse_expected_.col(i)).norm(), kEpsilon) |
| 124 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). "Reference Schur complement inverse and its estimate via " |
| 125 | "PowerSeriesExpansionPreconditioner differs in " |
| 126 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). i |
| 127 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). " column.\nreference : " <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). sc_inverse_expected_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#sc_inverse_expected_..colcxx . . $ Eigen/DenseBase#col(a84c988c80554028).(i).transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).() |
| 128 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). "\nestimated: " <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). y.transposecxx . . $ Eigen/DenseBase#transpose(b50b62ba401a926d).(); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | TEST_Fcxx . . $ `internal/ceres/gtest/gtest.h:12266:9`!(PowerSeriesExpansionPreconditionerTest, |
| 133 | InverseInvalidBadPreconditionerTolerance) { |
| 134 | const double spse_tolerance = 1 / kEpsiloncxx . . $ ceres/internal/kEpsilon.; |
| 135 | const int max_num_iterations = 50; |
| 136 | PowerSeriesExpansionPreconditionercxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner# preconditioner_bad_tolerancecxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#PowerSeriesExpansionPreconditioner(5636533f9845f4e4).( |
| 137 | isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(), max_num_iterations, spse_tolerance, preconditioner_options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#preconditioner_options_.); |
| 138 | |
| 139 | Vectorcxx . . $ ceres/Vector# xcxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.), ycxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.); |
| 140 | for (int i = 0; i < num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.; i++) { |
| 141 | x.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 142 | x(cxx . . $ Eigen/DenseCoeffsBase#`operator()`(1905f20a50b1238d).i) = 1.0; |
| 143 | |
| 144 | y.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 145 | preconditioner_bad_tolerance.RightMultiplyAndAccumulatecxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#RightMultiplyAndAccumulate(e2830e709b966a15).(x.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).(), y.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).()); |
| 146 | EXPECT_GTcxx . . $ `internal/ceres/gtest/gtest.h:11935:9`!((y - sc_inverse_expected_.col(i)).norm(), kEpsilon) |
| 147 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). "Reference Schur complement inverse and its estimate via " |
| 148 | "PowerSeriesExpansionPreconditioner are too similar, tolerance " |
| 149 | "stopping criteria failed."; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | TEST_Fcxx . . $ `internal/ceres/gtest/gtest.h:12266:9`!(PowerSeriesExpansionPreconditionerTest, |
| 154 | InverseInvalidBadPreconditionerMaxIterations) { |
| 155 | const double spse_tolerance = kEpsiloncxx . . $ ceres/internal/kEpsilon.; |
| 156 | const int max_num_iterations = 1; |
| 157 | PowerSeriesExpansionPreconditionercxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner# preconditioner_bad_iterations_limitcxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#PowerSeriesExpansionPreconditioner(5636533f9845f4e4).( |
| 158 | isc_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#isc_..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(), max_num_iterations, spse_tolerance, preconditioner_options_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#preconditioner_options_.); |
| 159 | |
| 160 | Vectorcxx . . $ ceres/Vector# xcxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.), ycxx . . $ Eigen/Matrix#Matrix(edcd8b2679e9bd1a).(num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.); |
| 161 | for (int i = 0; i < num_f_cols_cxx . . $ ceres/internal/PowerSeriesExpansionPreconditionerTest#num_f_cols_.; i++) { |
| 162 | x.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 163 | x(cxx . . $ Eigen/DenseCoeffsBase#`operator()`(1905f20a50b1238d).i) = 1.0; |
| 164 | |
| 165 | y.setZerocxx . . $ Eigen/DenseBase#setZero(19b2b6f17af048b).(); |
| 166 | preconditioner_bad_iterations_limit.RightMultiplyAndAccumulatecxx . . $ ceres/internal/PowerSeriesExpansionPreconditioner#RightMultiplyAndAccumulate(e2830e709b966a15).(x.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).(), |
| 167 | y.datacxx . . $ Eigen/PlainObjectBase#data(654f260ebb5356a9).()); |
| 168 | EXPECT_GTcxx . . $ `internal/ceres/gtest/gtest.h:11935:9`!((y - sc_inverse_expected_.col(i)).norm(), kEpsilon) |
| 169 | <<cxx . . $ testing/Message#`operator<<`(f8d13ec85d0bba72). "Reference Schur complement inverse and its estimate via " |
| 170 | "PowerSeriesExpansionPreconditioner are too similar, maximum " |
| 171 | "iterations stopping criteria failed."; |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | } // namespace ceres::internal |