source: pacpussensors/trunk/Vislab/lib3dv-1.2.0/lib3dv/eigen/doc/examples/TutorialLinAlgComputeTwice.cpp

Last change on this file was 136, checked in by ldecherf, 8 years ago

Doc

File size: 622 bytes
Line 
1#include <iostream>
2#include <Eigen/Dense>
3
4using namespace std;
5using namespace Eigen;
6
7int main()
8{
9 Matrix2f A, b;
10 LLT<Matrix2f> llt;
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}
Note: See TracBrowser for help on using the repository browser.