3rdparty/Eigen/test/cholesky.cpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #define TEST_ENABLE_TEMPORARY_TRACKING
11 
12 #include "main.h"
13 #include <Eigen/Cholesky>
14 #include <Eigen/QR>
15 #include "solverbase.h"
16 
17 template<typename MatrixType, int UpLo>
19  if(m.cols()==0) return typename MatrixType::RealScalar(0);
20  MatrixType symm = m.template selfadjointView<UpLo>();
21  return symm.cwiseAbs().colwise().sum().maxCoeff();
22 }
23 
24 template<typename MatrixType,template <typename,int> class CholType> void test_chol_update(const MatrixType& symm)
25 {
26  typedef typename MatrixType::Scalar Scalar;
27  typedef typename MatrixType::RealScalar RealScalar;
29 
30  MatrixType symmLo = symm.template triangularView<Lower>();
31  MatrixType symmUp = symm.template triangularView<Upper>();
32  MatrixType symmCpy = symm;
33 
34  CholType<MatrixType,Lower> chollo(symmLo);
35  CholType<MatrixType,Upper> cholup(symmUp);
36 
37  for (int k=0; k<10; ++k)
38  {
39  VectorType vec = VectorType::Random(symm.rows());
40  RealScalar sigma = internal::random<RealScalar>();
41  symmCpy += sigma * vec * vec.adjoint();
42 
43  // we are doing some downdates, so it might be the case that the matrix is not SPD anymore
44  CholType<MatrixType,Lower> chol(symmCpy);
45  if(chol.info()!=Success)
46  break;
47 
48  chollo.rankUpdate(vec, sigma);
49  VERIFY_IS_APPROX(symmCpy, chollo.reconstructedMatrix());
50 
51  cholup.rankUpdate(vec, sigma);
52  VERIFY_IS_APPROX(symmCpy, cholup.reconstructedMatrix());
53  }
54 }
55 
56 template<typename MatrixType> void cholesky(const MatrixType& m)
57 {
58  /* this test covers the following files:
59  LLT.h LDLT.h
60  */
61  Index rows = m.rows();
62  Index cols = m.cols();
63 
64  typedef typename MatrixType::Scalar Scalar;
65  typedef typename NumTraits<Scalar>::Real RealScalar;
68 
69  MatrixType a0 = MatrixType::Random(rows,cols);
70  VectorType vecB = VectorType::Random(rows), vecX(rows);
71  MatrixType matB = MatrixType::Random(rows,cols), matX(rows,cols);
72  SquareMatrixType symm = a0 * a0.adjoint();
73  // let's make sure the matrix is not singular or near singular
74  for (int k=0; k<3; ++k)
75  {
76  MatrixType a1 = MatrixType::Random(rows,cols);
77  symm += a1 * a1.adjoint();
78  }
79 
80  {
81  STATIC_CHECK(( internal::is_same<typename LLT<MatrixType,Lower>::StorageIndex,int>::value ));
82  STATIC_CHECK(( internal::is_same<typename LLT<MatrixType,Upper>::StorageIndex,int>::value ));
83 
84  SquareMatrixType symmUp = symm.template triangularView<Upper>();
85  SquareMatrixType symmLo = symm.template triangularView<Lower>();
86 
87  LLT<SquareMatrixType,Lower> chollo(symmLo);
89 
90  check_solverbase<VectorType, VectorType>(symm, chollo, rows, rows, 1);
91  check_solverbase<MatrixType, MatrixType>(symm, chollo, rows, cols, rows);
92 
93  const MatrixType symmLo_inverse = chollo.solve(MatrixType::Identity(rows,cols));
94  RealScalar rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Lower>(symmLo)) /
95  matrix_l1_norm<MatrixType, Lower>(symmLo_inverse);
96  RealScalar rcond_est = chollo.rcond();
97  // Verify that the estimated condition number is within a factor of 10 of the
98  // truth.
99  VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
100 
101  // test the upper mode
102  LLT<SquareMatrixType,Upper> cholup(symmUp);
104  vecX = cholup.solve(vecB);
105  VERIFY_IS_APPROX(symm * vecX, vecB);
106  matX = cholup.solve(matB);
107  VERIFY_IS_APPROX(symm * matX, matB);
108 
109  // Verify that the estimated condition number is within a factor of 10 of the
110  // truth.
111  const MatrixType symmUp_inverse = cholup.solve(MatrixType::Identity(rows,cols));
112  rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Upper>(symmUp)) /
113  matrix_l1_norm<MatrixType, Upper>(symmUp_inverse);
114  rcond_est = cholup.rcond();
115  VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
116 
117 
118  MatrixType neg = -symmLo;
119  chollo.compute(neg);
120  VERIFY(neg.size()==0 || chollo.info()==NumericalIssue);
121 
122  VERIFY_IS_APPROX(MatrixType(chollo.matrixL().transpose().conjugate()), MatrixType(chollo.matrixU()));
123  VERIFY_IS_APPROX(MatrixType(chollo.matrixU().transpose().conjugate()), MatrixType(chollo.matrixL()));
124  VERIFY_IS_APPROX(MatrixType(cholup.matrixL().transpose().conjugate()), MatrixType(cholup.matrixU()));
125  VERIFY_IS_APPROX(MatrixType(cholup.matrixU().transpose().conjugate()), MatrixType(cholup.matrixL()));
126 
127  // test some special use cases of SelfCwiseBinaryOp:
128  MatrixType m1 = MatrixType::Random(rows,cols), m2(rows,cols);
129  m2 = m1;
130  m2 += symmLo.template selfadjointView<Lower>().llt().solve(matB);
131  VERIFY_IS_APPROX(m2, m1 + symmLo.template selfadjointView<Lower>().llt().solve(matB));
132  m2 = m1;
133  m2 -= symmLo.template selfadjointView<Lower>().llt().solve(matB);
134  VERIFY_IS_APPROX(m2, m1 - symmLo.template selfadjointView<Lower>().llt().solve(matB));
135  m2 = m1;
136  m2.noalias() += symmLo.template selfadjointView<Lower>().llt().solve(matB);
137  VERIFY_IS_APPROX(m2, m1 + symmLo.template selfadjointView<Lower>().llt().solve(matB));
138  m2 = m1;
139  m2.noalias() -= symmLo.template selfadjointView<Lower>().llt().solve(matB);
140  VERIFY_IS_APPROX(m2, m1 - symmLo.template selfadjointView<Lower>().llt().solve(matB));
141  }
142 
143  // LDLT
144  {
145  STATIC_CHECK(( internal::is_same<typename LDLT<MatrixType,Lower>::StorageIndex,int>::value ));
146  STATIC_CHECK(( internal::is_same<typename LDLT<MatrixType,Upper>::StorageIndex,int>::value ));
147 
148  int sign = internal::random<int>()%2 ? 1 : -1;
149 
150  if(sign == -1)
151  {
152  symm = -symm; // test a negative matrix
153  }
154 
155  SquareMatrixType symmUp = symm.template triangularView<Upper>();
156  SquareMatrixType symmLo = symm.template triangularView<Lower>();
157 
158  LDLT<SquareMatrixType,Lower> ldltlo(symmLo);
159  VERIFY(ldltlo.info()==Success);
161 
162  check_solverbase<VectorType, VectorType>(symm, ldltlo, rows, rows, 1);
163  check_solverbase<MatrixType, MatrixType>(symm, ldltlo, rows, cols, rows);
164 
165  const MatrixType symmLo_inverse = ldltlo.solve(MatrixType::Identity(rows,cols));
166  RealScalar rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Lower>(symmLo)) /
167  matrix_l1_norm<MatrixType, Lower>(symmLo_inverse);
168  RealScalar rcond_est = ldltlo.rcond();
169  // Verify that the estimated condition number is within a factor of 10 of the
170  // truth.
171  VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
172 
173 
174  LDLT<SquareMatrixType,Upper> ldltup(symmUp);
175  VERIFY(ldltup.info()==Success);
177  vecX = ldltup.solve(vecB);
178  VERIFY_IS_APPROX(symm * vecX, vecB);
179  matX = ldltup.solve(matB);
180  VERIFY_IS_APPROX(symm * matX, matB);
181 
182  // Verify that the estimated condition number is within a factor of 10 of the
183  // truth.
184  const MatrixType symmUp_inverse = ldltup.solve(MatrixType::Identity(rows,cols));
185  rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Upper>(symmUp)) /
186  matrix_l1_norm<MatrixType, Upper>(symmUp_inverse);
187  rcond_est = ldltup.rcond();
188  VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
189 
190  VERIFY_IS_APPROX(MatrixType(ldltlo.matrixL().transpose().conjugate()), MatrixType(ldltlo.matrixU()));
191  VERIFY_IS_APPROX(MatrixType(ldltlo.matrixU().transpose().conjugate()), MatrixType(ldltlo.matrixL()));
192  VERIFY_IS_APPROX(MatrixType(ldltup.matrixL().transpose().conjugate()), MatrixType(ldltup.matrixU()));
193  VERIFY_IS_APPROX(MatrixType(ldltup.matrixU().transpose().conjugate()), MatrixType(ldltup.matrixL()));
194 
195  if(MatrixType::RowsAtCompileTime==Dynamic)
196  {
197  // note : each inplace permutation requires a small temporary vector (mask)
198 
199  // check inplace solve
200  matX = matB;
201  VERIFY_EVALUATION_COUNT(matX = ldltlo.solve(matX), 0);
202  VERIFY_IS_APPROX(matX, ldltlo.solve(matB).eval());
203 
204 
205  matX = matB;
206  VERIFY_EVALUATION_COUNT(matX = ldltup.solve(matX), 0);
207  VERIFY_IS_APPROX(matX, ldltup.solve(matB).eval());
208  }
209 
210  // restore
211  if(sign == -1)
212  symm = -symm;
213 
214  // check matrices coming from linear constraints with Lagrange multipliers
215  if(rows>=3)
216  {
217  SquareMatrixType A = symm;
218  Index c = internal::random<Index>(0,rows-2);
219  A.bottomRightCorner(c,c).setZero();
220  // Make sure a solution exists:
221  vecX.setRandom();
222  vecB = A * vecX;
223  vecX.setZero();
224  ldltlo.compute(A);
226  vecX = ldltlo.solve(vecB);
227  VERIFY_IS_APPROX(A * vecX, vecB);
228  }
229 
230  // check non-full rank matrices
231  if(rows>=3)
232  {
233  Index r = internal::random<Index>(1,rows-1);
235  SquareMatrixType A = a * a.adjoint();
236  // Make sure a solution exists:
237  vecX.setRandom();
238  vecB = A * vecX;
239  vecX.setZero();
240  ldltlo.compute(A);
242  vecX = ldltlo.solve(vecB);
243  VERIFY_IS_APPROX(A * vecX, vecB);
244  }
245 
246  // check matrices with a wide spectrum
247  if(rows>=3)
248  {
249  using std::pow;
250  using std::sqrt;
251  RealScalar s = (std::min)(16,std::numeric_limits<RealScalar>::max_exponent10/8);
254  for(Index k=0; k<rows; ++k)
255  d(k) = d(k)*pow(RealScalar(10),internal::random<RealScalar>(-s,s));
256  SquareMatrixType A = a * d.asDiagonal() * a.adjoint();
257  // Make sure a solution exists:
258  vecX.setRandom();
259  vecB = A * vecX;
260  vecX.setZero();
261  ldltlo.compute(A);
263  vecX = ldltlo.solve(vecB);
264 
265  if(ldltlo.vectorD().real().cwiseAbs().minCoeff()>RealScalar(0))
266  {
267  VERIFY_IS_APPROX(A * vecX,vecB);
268  }
269  else
270  {
271  RealScalar large_tol = sqrt(test_precision<RealScalar>());
272  VERIFY((A * vecX).isApprox(vecB, large_tol));
273 
274  ++g_test_level;
275  VERIFY_IS_APPROX(A * vecX,vecB);
276  --g_test_level;
277  }
278  }
279  }
280 
281  // update/downdate
282  CALL_SUBTEST(( test_chol_update<SquareMatrixType,LLT>(symm) ));
283  CALL_SUBTEST(( test_chol_update<SquareMatrixType,LDLT>(symm) ));
284 }
285 
286 template<typename MatrixType> void cholesky_cplx(const MatrixType& m)
287 {
288  // classic test
289  cholesky(m);
290 
291  // test mixing real/scalar types
292 
293  Index rows = m.rows();
294  Index cols = m.cols();
295 
296  typedef typename MatrixType::Scalar Scalar;
297  typedef typename NumTraits<Scalar>::Real RealScalar;
300 
301  RealMatrixType a0 = RealMatrixType::Random(rows,cols);
302  VectorType vecB = VectorType::Random(rows), vecX(rows);
303  MatrixType matB = MatrixType::Random(rows,cols), matX(rows,cols);
304  RealMatrixType symm = a0 * a0.adjoint();
305  // let's make sure the matrix is not singular or near singular
306  for (int k=0; k<3; ++k)
307  {
308  RealMatrixType a1 = RealMatrixType::Random(rows,cols);
309  symm += a1 * a1.adjoint();
310  }
311 
312  {
313  RealMatrixType symmLo = symm.template triangularView<Lower>();
314 
315  LLT<RealMatrixType,Lower> chollo(symmLo);
317 
318  check_solverbase<VectorType, VectorType>(symm, chollo, rows, rows, 1);
319  //check_solverbase<MatrixType, MatrixType>(symm, chollo, rows, cols, rows);
320  }
321 
322  // LDLT
323  {
324  int sign = internal::random<int>()%2 ? 1 : -1;
325 
326  if(sign == -1)
327  {
328  symm = -symm; // test a negative matrix
329  }
330 
331  RealMatrixType symmLo = symm.template triangularView<Lower>();
332 
333  LDLT<RealMatrixType,Lower> ldltlo(symmLo);
334  VERIFY(ldltlo.info()==Success);
336 
337  check_solverbase<VectorType, VectorType>(symm, ldltlo, rows, rows, 1);
338  //check_solverbase<MatrixType, MatrixType>(symm, ldltlo, rows, cols, rows);
339  }
340 }
341 
342 // regression test for bug 241
343 template<typename MatrixType> void cholesky_bug241(const MatrixType& m)
344 {
345  eigen_assert(m.rows() == 2 && m.cols() == 2);
346 
347  typedef typename MatrixType::Scalar Scalar;
349 
351  matA << 1, 1, 1, 1;
352  VectorType vecB;
353  vecB << 1, 1;
354  VectorType vecX = matA.ldlt().solve(vecB);
355  VERIFY_IS_APPROX(matA * vecX, vecB);
356 }
357 
358 // LDLT is not guaranteed to work for indefinite matrices, but happens to work fine if matrix is diagonal.
359 // This test checks that LDLT reports correctly that matrix is indefinite.
360 // See http://forum.kde.org/viewtopic.php?f=74&t=106942 and bug 736
361 template<typename MatrixType> void cholesky_definiteness(const MatrixType& m)
362 {
363  eigen_assert(m.rows() == 2 && m.cols() == 2);
364  MatrixType mat;
365  LDLT<MatrixType> ldlt(2);
366 
367  {
368  mat << 1, 0, 0, -1;
369  ldlt.compute(mat);
370  VERIFY(ldlt.info()==Success);
371  VERIFY(!ldlt.isNegative());
372  VERIFY(!ldlt.isPositive());
374  }
375  {
376  mat << 1, 2, 2, 1;
377  ldlt.compute(mat);
378  VERIFY(ldlt.info()==Success);
379  VERIFY(!ldlt.isNegative());
380  VERIFY(!ldlt.isPositive());
382  }
383  {
384  mat << 0, 0, 0, 0;
385  ldlt.compute(mat);
386  VERIFY(ldlt.info()==Success);
387  VERIFY(ldlt.isNegative());
388  VERIFY(ldlt.isPositive());
390  }
391  {
392  mat << 0, 0, 0, 1;
393  ldlt.compute(mat);
394  VERIFY(ldlt.info()==Success);
395  VERIFY(!ldlt.isNegative());
396  VERIFY(ldlt.isPositive());
398  }
399  {
400  mat << -1, 0, 0, 0;
401  ldlt.compute(mat);
402  VERIFY(ldlt.info()==Success);
403  VERIFY(ldlt.isNegative());
404  VERIFY(!ldlt.isPositive());
406  }
407 }
408 
409 template<typename>
411 {
412  MatrixXd mat;
413  LDLT<MatrixXd> ldlt;
414 
415  {
416  mat.resize(2,2);
417  mat << 0, 1, 1, 0;
418  ldlt.compute(mat);
420  VERIFY(ldlt.info()==NumericalIssue);
421  }
422 #if (!EIGEN_ARCH_i386) || defined(EIGEN_VECTORIZE_SSE2)
423  {
424  mat.resize(3,3);
425  mat << -1, -3, 3,
426  -3, -8.9999999999999999999, 1,
427  3, 1, 0;
428  ldlt.compute(mat);
429  VERIFY(ldlt.info()==NumericalIssue);
431  }
432 #endif
433  {
434  mat.resize(3,3);
435  mat << 1, 2, 3,
436  2, 4, 1,
437  3, 1, 0;
438  ldlt.compute(mat);
439  VERIFY(ldlt.info()==NumericalIssue);
441  }
442 
443  {
444  mat.resize(8,8);
445  mat << 0.1, 0, -0.1, 0, 0, 0, 1, 0,
446  0, 4.24667, 0, 2.00333, 0, 0, 0, 0,
447  -0.1, 0, 0.2, 0, -0.1, 0, 0, 0,
448  0, 2.00333, 0, 8.49333, 0, 2.00333, 0, 0,
449  0, 0, -0.1, 0, 0.1, 0, 0, 1,
450  0, 0, 0, 2.00333, 0, 4.24667, 0, 0,
451  1, 0, 0, 0, 0, 0, 0, 0,
452  0, 0, 0, 0, 1, 0, 0, 0;
453  ldlt.compute(mat);
454  VERIFY(ldlt.info()==NumericalIssue);
456  }
457 
458  // bug 1479
459  {
460  mat.resize(4,4);
461  mat << 1, 2, 0, 1,
462  2, 4, 0, 2,
463  0, 0, 0, 1,
464  1, 2, 1, 1;
465  ldlt.compute(mat);
466  VERIFY(ldlt.info()==NumericalIssue);
468  }
469 }
470 
471 template<typename MatrixType> void cholesky_verify_assert()
472 {
473  MatrixType tmp;
474 
476  VERIFY_RAISES_ASSERT(llt.matrixL())
477  VERIFY_RAISES_ASSERT(llt.matrixU())
478  VERIFY_RAISES_ASSERT(llt.solve(tmp))
479  VERIFY_RAISES_ASSERT(llt.transpose().solve(tmp))
480  VERIFY_RAISES_ASSERT(llt.adjoint().solve(tmp))
481  VERIFY_RAISES_ASSERT(llt.solveInPlace(tmp))
482 
483  LDLT<MatrixType> ldlt;
489  VERIFY_RAISES_ASSERT(ldlt.solve(tmp))
490  VERIFY_RAISES_ASSERT(ldlt.transpose().solve(tmp))
491  VERIFY_RAISES_ASSERT(ldlt.adjoint().solve(tmp))
493 }
494 
496 {
497  int s = 0;
498  for(int i = 0; i < g_repeat; i++) {
500  CALL_SUBTEST_3( cholesky(Matrix2d()) );
501  CALL_SUBTEST_3( cholesky_bug241(Matrix2d()) );
502  CALL_SUBTEST_3( cholesky_definiteness(Matrix2d()) );
503  CALL_SUBTEST_4( cholesky(Matrix3f()) );
504  CALL_SUBTEST_5( cholesky(Matrix4d()) );
505 
506  s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
507  CALL_SUBTEST_2( cholesky(MatrixXd(s,s)) );
509 
510  s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2);
511  CALL_SUBTEST_6( cholesky_cplx(MatrixXcd(s,s)) );
513  }
514  // empty matrix, regression test for Bug 785:
515  CALL_SUBTEST_2( cholesky(MatrixXd(0,0)) );
516 
517  // This does not work yet:
518  // CALL_SUBTEST_2( cholesky(Matrix<double,0,0>()) );
519 
520  CALL_SUBTEST_4( cholesky_verify_assert<Matrix3f>() );
521  CALL_SUBTEST_7( cholesky_verify_assert<Matrix3d>() );
522  CALL_SUBTEST_8( cholesky_verify_assert<MatrixXf>() );
523  CALL_SUBTEST_2( cholesky_verify_assert<MatrixXd>() );
524 
525  // Test problem size constructors
528 
529  CALL_SUBTEST_2( cholesky_faillure_cases<void>() );
530 
532 }
matA
MatrixXf matA(2, 2)
Eigen::NumericalIssue
@ NumericalIssue
Definition: Constants.h:444
llt
EIGEN_DONT_INLINE void llt(const Mat &A, const Mat &B, Mat &C)
Definition: llt.cpp:5
matB
MatrixXf matB(2, 2)
Eigen::LLT::rcond
RealScalar rcond() const
Definition: LLT.h:166
s
RealScalar s
Definition: level1_cplx_impl.h:126
d
static const double d[K][N]
Definition: igam.h:11
Eigen::LDLT::reconstructedMatrix
MatrixType reconstructedMatrix() const
Definition: LDLT.h:643
EIGEN_DECLARE_TEST
EIGEN_DECLARE_TEST(cholesky)
Definition: 3rdparty/Eigen/test/cholesky.cpp:495
MatrixType
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
symm
int EIGEN_BLAS_FUNC() symm(const char *side, const char *uplo, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
Definition: level3_impl.h:287
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
sign
const EIGEN_DEVICE_FUNC SignReturnType sign() const
Definition: ArrayCwiseUnaryOps.h:219
Eigen::LDLT::rcond
RealScalar rcond() const
Definition: LDLT.h:221
Eigen::LDLT::isNegative
bool isNegative(void) const
Definition: LDLT.h:185
m1
Matrix3d m1
Definition: IOFormat.cpp:2
Eigen::Success
@ Success
Definition: Constants.h:442
Eigen::internal::isApprox
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: Eigen/src/Core/MathFunctions.h:1947
Eigen::LDLT::matrixU
Traits::MatrixU matrixU() const
Definition: LDLT.h:149
mat
MatrixXf mat
Definition: Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
CALL_SUBTEST_9
#define CALL_SUBTEST_9(FUNC)
Definition: split_test_helper.h:52
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
sampling::sigma
static const double sigma
Definition: testGaussianBayesNet.cpp:170
VERIFY_RAISES_ASSERT
#define VERIFY_RAISES_ASSERT(a)
Definition: main.h:340
A
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
matrix_l1_norm
MatrixType::RealScalar matrix_l1_norm(const MatrixType &m)
Definition: 3rdparty/Eigen/test/cholesky.cpp:18
CALL_SUBTEST_4
#define CALL_SUBTEST_4(FUNC)
Definition: split_test_helper.h:22
VERIFY_IS_NOT_APPROX
#define VERIFY_IS_NOT_APPROX(a, b)
Definition: integer_types.cpp:17
align_3::a1
Point2 a1
Definition: testPose2.cpp:769
m2
MatrixType m2(n_dims)
CALL_SUBTEST_3
#define CALL_SUBTEST_3(FUNC)
Definition: split_test_helper.h:16
Eigen::LLT::compute
LLT & compute(const EigenBase< InputType > &matrix)
CALL_SUBTEST_1
#define CALL_SUBTEST_1(FUNC)
Definition: split_test_helper.h:4
nb_temporaries
static long int nb_temporaries
Definition: test/sparse_product.cpp:16
Eigen::SolverBase< LDLT< _MatrixType, _UpLo > >::transpose
ConstTransposeReturnType transpose() const
Definition: SolverBase.h:121
Eigen::LDLT::compute
LDLT & compute(const EigenBase< InputType > &matrix)
cholesky_definiteness
void cholesky_definiteness(const MatrixType &m)
Definition: 3rdparty/Eigen/test/cholesky.cpp:361
Eigen::LDLT::matrixL
Traits::MatrixL matrixL() const
Definition: LDLT.h:156
Eigen::LLT::matrixL
Traits::MatrixL matrixL() const
Definition: LLT.h:135
Eigen::LDLT::vectorD
Diagonal< const MatrixType > vectorD() const
Definition: LDLT.h:171
Eigen::Dynamic
const int Dynamic
Definition: Constants.h:22
cholesky_verify_assert
void cholesky_verify_assert()
Definition: 3rdparty/Eigen/test/cholesky.cpp:471
Eigen::LDLT::adjoint
const LDLT & adjoint() const
Definition: LDLT.h:247
test_chol_update
void test_chol_update(const MatrixType &symm)
Definition: 3rdparty/Eigen/test/cholesky.cpp:24
CALL_SUBTEST_5
#define CALL_SUBTEST_5(FUNC)
Definition: split_test_helper.h:28
Eigen::g_repeat
static int g_repeat
Definition: main.h:169
Eigen::LDLT
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:59
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
Eigen::LLT::reconstructedMatrix
MatrixType reconstructedMatrix() const
Definition: LLT.h:528
cholesky_faillure_cases
void cholesky_faillure_cases()
Definition: 3rdparty/Eigen/test/cholesky.cpp:410
ceres::pow
Jet< T, N > pow(const Jet< T, N > &f, double g)
Definition: jet.h:570
CALL_SUBTEST_6
#define CALL_SUBTEST_6(FUNC)
Definition: split_test_helper.h:34
CALL_SUBTEST_2
#define CALL_SUBTEST_2(FUNC)
Definition: split_test_helper.h:10
VERIFY_IS_APPROX
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:15
cholesky
void cholesky(const MatrixType &m)
Definition: 3rdparty/Eigen/test/cholesky.cpp:56
RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:47
Eigen::ArrayBase::pow
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow(const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
Definition: GlobalFunctions.h:143
cholesky_bug241
void cholesky_bug241(const MatrixType &m)
Definition: 3rdparty/Eigen/test/cholesky.cpp:343
Eigen::LLT
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:66
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
solverbase.h
cholesky
Definition: testMatrix.cpp:964
Eigen::LLT::info
ComputationInfo info() const
Reports whether previous computation was successful.
Definition: LLT.h:191
Eigen::LDLT::solveInPlace
bool solveInPlace(MatrixBase< Derived > &bAndX) const
Definition: LDLT.h:629
main.h
EIGEN_TEST_MAX_SIZE
#define EIGEN_TEST_MAX_SIZE
Definition: boostmultiprec.cpp:16
VERIFY_EVALUATION_COUNT
#define VERIFY_EVALUATION_COUNT(XPR, N)
Definition: test/sparse_product.cpp:27
min
#define min(a, b)
Definition: datatypes.h:19
cholesky_cplx
void cholesky_cplx(const MatrixType &m)
Definition: 3rdparty/Eigen/test/cholesky.cpp:286
Eigen::LLT::matrixU
Traits::MatrixU matrixU() const
Definition: LLT.h:128
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
VectorType
Definition: FFTW.cpp:65
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
Eigen::g_test_level
static int g_test_level
Definition: main.h:168
Eigen::LDLT::info
ComputationInfo info() const
Reports whether previous computation was successful.
Definition: LDLT.h:257
triangularView< Lower >
A triangularView< Lower >().adjoint().solveInPlace(B)
CALL_SUBTEST_7
#define CALL_SUBTEST_7(FUNC)
Definition: split_test_helper.h:40
CALL_SUBTEST_8
#define CALL_SUBTEST_8(FUNC)
Definition: split_test_helper.h:46
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
test_callbacks.value
value
Definition: test_callbacks.py:160
ceres::sqrt
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
TEST_SET_BUT_UNUSED_VARIABLE
#define TEST_SET_BUT_UNUSED_VARIABLE(X)
Definition: main.h:121
STATIC_CHECK
#define STATIC_CHECK(COND)
Definition: main.h:397
Eigen::SolverBase< LLT< _MatrixType, _UpLo > >::solve
const Solve< LLT< _MatrixType, _UpLo >, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
Eigen::LDLT::transpositionsP
const TranspositionType & transpositionsP() const
Definition: LDLT.h:164
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
CALL_SUBTEST
#define CALL_SUBTEST(FUNC)
Definition: main.h:399
VERIFY
#define VERIFY(a)
Definition: main.h:380
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::LDLT::isPositive
bool isPositive() const
Definition: LDLT.h:178


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:58