TutorialLinAlgComputeTwice.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 using namespace std;
5 using namespace Eigen;
6 
7 int main()
8 {
9  Matrix2f A, b;
11  A << 2, -1, -1, 3;
12  b << 1, 2, 3, 1;
13  cout << "Here is the matrix A:\n" << A << endl;
14  cout << "Here is the right hand side b:\n" << b << endl;
15  cout << "Computing LLT decomposition..." << endl;
16  llt.compute(A);
17  cout << "The solution is:\n" << llt.solve(b) << endl;
18  A(1,1)++;
19  cout << "The matrix A is now:\n" << A << endl;
20  cout << "Computing LLT decomposition..." << endl;
21  llt.compute(A);
22  cout << "The solution is now:\n" << llt.solve(b) << endl;
23 }
const Solve< LLT< _MatrixType, _UpLo >, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
Scalar * b
Definition: benchVecAdd.cpp:17
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Definition: BFloat16.h:88
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
EIGEN_DONT_INLINE void llt(const Mat &A, const Mat &B, Mat &C)
Definition: llt.cpp:5
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:66
LLT & compute(const EigenBase< InputType > &matrix)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:40:38