gtsam
3rdparty
Eigen
doc
snippets
LLT_example.cpp
Go to the documentation of this file.
1
MatrixXd
A
(3,3);
2
A
<< 4,-1,2, -1,6,0, 2,0,5;
3
cout <<
"The matrix A is"
<< endl <<
A
<< endl;
4
5
LLT<MatrixXd>
lltOfA
(
A
);
// compute the Cholesky decomposition of A
6
MatrixXd
L
=
lltOfA
.matrixL();
// retrieve factor L in the decomposition
7
// The previous two lines can also be written as "L = A.llt().matrixL()"
8
9
cout <<
"The Cholesky factor L is"
<< endl <<
L
<< endl;
10
cout <<
"To check this, let us compute L * L.transpose()"
<< endl;
11
cout <<
L
*
L
.transpose() << endl;
12
cout <<
"This should equal the matrix A"
<< endl;
L
MatrixXd L
Definition:
LLT_example.cpp:6
A
MatrixXd A(3, 3)
A
Definition:
test_numpy_dtypes.cpp:298
lltOfA
A<< 4,-1, 2, -1, 6, 0, 2, 0, 5;cout<< "The matrix A is"<< endl<< A<< endl;LLT< MatrixXd > lltOfA(A)
gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:33