Rev | Line | |
---|
[136] | 1 | #include <Eigen/Dense>
|
---|
| 2 | #include <iostream>
|
---|
| 3 |
|
---|
| 4 | using namespace Eigen;
|
---|
| 5 | using namespace std;
|
---|
| 6 |
|
---|
| 7 | int main(int, char**)
|
---|
| 8 | {
|
---|
| 9 | cout.precision(3);
|
---|
| 10 | Matrix3f m = Matrix3f::Random();
|
---|
| 11 | Matrix3f y = Matrix3f::Random();
|
---|
| 12 | cout << "Here is the matrix m:" << endl << m << endl;
|
---|
| 13 | cout << "Here is the matrix y:" << endl << y << endl;
|
---|
| 14 | Matrix3f x;
|
---|
| 15 | x = m.fullPivHouseholderQr().solve(y);
|
---|
| 16 | assert(y.isApprox(m*x));
|
---|
| 17 | cout << "Here is a solution x to the equation mx=y:" << endl << x << endl;
|
---|
| 18 |
|
---|
| 19 | return 0;
|
---|
| 20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.