Benoit Jacob | fabaa69 | 2008-12-18 20:36:25 +0000 | [diff] [blame^] | 1 | MatrixXd m(3,3); |
| 2 | m << 1,1,0, |
| 3 | 1,3,2, |
| 4 | 0,1,1; |
| 5 | cout << "Here is the matrix m:" << endl << m << endl; |
| 6 | LU<Matrix3d> lu(m); |
| 7 | // allocate the matrix img with the correct size to avoid reallocation |
| 8 | MatrixXd img(m.rows(), lu.rank()); |
| 9 | lu.computeImage(&img); |
| 10 | cout << "Notice that the middle column is the sum of the two others, so the " |
| 11 | << "columns are linearly dependent." << endl; |
| 12 | cout << "Here is a matrix whose columns have the same span but are linearly independent:" |
| 13 | << endl << img << endl; |