source:
pacpussensors/trunk/Vislab/lib3dv-1.2.0/lib3dv/eigen/doc/snippets/HouseholderQR_solve.cpp
| Last change on this file was 136, checked in by , 9 years ago | |
|---|---|
| File size: 357 bytes | |
| Line | |
|---|---|
| 1 | typedef Matrix<float,3,3> Matrix3x3; |
| 2 | Matrix3x3 m = Matrix3x3::Random(); |
| 3 | Matrix3f y = Matrix3f::Random(); |
| 4 | cout << "Here is the matrix m:" << endl << m << endl; |
| 5 | cout << "Here is the matrix y:" << endl << y << endl; |
| 6 | Matrix3f x; |
| 7 | x = m.householderQr().solve(y); |
| 8 | assert(y.isApprox(m*x)); |
| 9 | cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; |
Note:
See TracBrowser
for help on using the repository browser.
