Gael Guennebaud | 4111316 | 2009-02-01 20:47:19 +0000 | [diff] [blame] | 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 | if(m.qr().solve(y, &x)) | ||||
8 | { | ||||
9 | assert(y.isApprox(m*x)); | ||||
10 | cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; | ||||
11 | } | ||||
12 | else | ||||
13 | cout << "The equation mx=y does not have any solution." << endl; | ||||
14 |