source:
pacpussensors/trunk/Vislab/lib3dv/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp@
136
Last change on this file since 136 was 136, checked in by , 7 years ago | |
---|---|
File size: 408 bytes |
Rev | Line | |
---|---|---|
[136] | 1 | #include <iostream> |
2 | #include <Eigen/Dense> | |
3 | ||
4 | using namespace std; | |
5 | using namespace Eigen; | |
6 | ||
7 | int main() | |
8 | { | |
9 | MatrixXf A = MatrixXf::Random(3, 2); | |
10 | cout << "Here is the matrix A:\n" << A << endl; | |
11 | VectorXf b = VectorXf::Random(3); | |
12 | cout << "Here is the right hand side b:\n" << b << endl; | |
13 | cout << "The least-squares solution is:\n" | |
14 | << A.jacobiSvd(ComputeThinU | ComputeThinV).solve(b) << endl; | |
15 | } |
Note:
See TracBrowser
for help on using the repository browser.