source: pacpussensors/trunk/Vislab/lib3dv-1.2.0/lib3dv/eigen/doc/snippets/LLT_example.cpp

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

Doc

File size: 519 bytes
Line 
1MatrixXd A(3,3);
2A << 4,-1,2, -1,6,0, 2,0,5;
3cout << "The matrix A is" << endl << A << endl;
4
5LLT<MatrixXd> lltOfA(A); // compute the Cholesky decomposition of A
6MatrixXd L = lltOfA.matrixL(); // retrieve factor L in the decomposition
7// The previous two lines can also be written as "L = A.llt().matrixL()"
8
9cout << "The Cholesky factor L is" << endl << L << endl;
10cout << "To check this, let us compute L * L.transpose()" << endl;
11cout << L * L.transpose() << endl;
12cout << "This should equal the matrix A" << endl;
Note: See TracBrowser for help on using the repository browser.