TutorialLinAlgComputeTwice.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 int main()
5 {
8  A << 2, -1, -1, 3;
9  b << 1, 2, 3, 1;
10  std::cout << "Here is the matrix A:\n" << A << std::endl;
11  std::cout << "Here is the right hand side b:\n" << b << std::endl;
12  std::cout << "Computing LLT decomposition..." << std::endl;
13  llt.compute(A);
14  std::cout << "The solution is:\n" << llt.solve(b) << std::endl;
15  A(1,1)++;
16  std::cout << "The matrix A is now:\n" << A << std::endl;
17  std::cout << "Computing LLT decomposition..." << std::endl;
18  llt.compute(A);
19  std::cout << "The solution is now:\n" << llt.solve(b) << std::endl;
20 }
Array< int, 3, 1 > b
MatrixXcf A
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:70
LLT & compute(const EigenBase< InputType > &matrix)
const Solve< LLT, Rhs > solve(const MatrixBase< Rhs > &b) const
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182