JacobiSVD_basic.cpp
Go to the documentation of this file.
00001 MatrixXf m = MatrixXf::Random(3,2);
00002 cout << "Here is the matrix m:" << endl << m << endl;
00003 JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
00004 cout << "Its singular values are:" << endl << svd.singularValues() << endl;
00005 cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU() << endl;
00006 cout << "Its right singular vectors are the columns of the thin V matrix:" << endl << svd.matrixV() << endl;
00007 Vector3f rhs(1, 0, 0);
00008 cout << "Now consider this rhs vector:" << endl << rhs << endl;
00009 cout << "A least-squares solution of m*x = rhs is:" << endl << svd.solve(rhs) << endl;


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:31:33