gtsam
3rdparty
Eigen
doc
snippets
JacobiSVD_basic.cpp
Go to the documentation of this file.
1
MatrixXf
m
= MatrixXf::Random(3,2);
2
cout <<
"Here is the matrix m:"
<< endl <<
m
<< endl;
3
JacobiSVD<MatrixXf>
svd
(
m
,
ComputeThinU
|
ComputeThinV
);
4
cout <<
"Its singular values are:"
<< endl <<
svd
.singularValues() << endl;
5
cout <<
"Its left singular vectors are the columns of the thin U matrix:"
<< endl <<
svd
.matrixU() << endl;
6
cout <<
"Its right singular vectors are the columns of the thin V matrix:"
<< endl <<
svd
.matrixV() << endl;
7
Vector3f rhs(1, 0, 0);
8
cout <<
"Now consider this rhs vector:"
<< endl << rhs << endl;
9
cout <<
"A least-squares solution of m*x = rhs is:"
<< endl <<
svd
.solve(rhs) << endl;
svd
cout<< "Here is the matrix m:"<< endl<< m<< endl;JacobiSVD< MatrixXf > svd(m, ComputeThinU|ComputeThinV)
Eigen::ComputeThinU
@ ComputeThinU
Definition:
Constants.h:395
Eigen::ComputeThinV
@ ComputeThinV
Definition:
Constants.h:399
m
MatrixXf m
Definition:
JacobiSVD_basic.cpp:1
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:37