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 | MatrixXf m = MatrixXf::Random(3,5);
|
---|
| 11 | cout << "Here is the matrix m:" << endl << m << endl;
|
---|
| 12 | MatrixXf ker = m.fullPivLu().kernel();
|
---|
| 13 | cout << "Here is a matrix whose columns form a basis of the kernel of m:"
|
---|
| 14 | << endl << ker << endl;
|
---|
| 15 | cout << "By definition of the kernel, m*ker is zero:"
|
---|
| 16 | << endl << m*ker << endl;
|
---|
| 17 |
|
---|
| 18 | return 0;
|
---|
| 19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.