TutorialLinAlgComputeTwice.cpp File Reference
#include <iostream>
#include <Eigen/Dense>

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
4  {
5  Eigen::Matrix2f A, b;
7  A << 2, -1, -1, 3;
8  b << 1, 2, 3, 1;
9  std::cout << "Here is the matrix A:\n" << A << std::endl;
10  std::cout << "Here is the right hand side b:\n" << b << std::endl;
11  std::cout << "Computing LLT decomposition..." << std::endl;
12  llt.compute(A);
13  std::cout << "The solution is:\n" << llt.solve(b) << std::endl;
14  A(1, 1)++;
15  std::cout << "The matrix A is now:\n" << A << std::endl;
16  std::cout << "Computing LLT decomposition..." << std::endl;
17  llt.compute(A);
18  std::cout << "The solution is now:\n" << llt.solve(b) << std::endl;
19 }
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:70
EIGEN_DONT_INLINE void llt(const Mat &A, const Mat &B, Mat &C)
Definition: llt.cpp:4

References b, and llt().