Benoit Jacob | f04c1cb | 2008-08-11 21:26:37 +0000 | [diff] [blame^] | 1 | MatrixXf m = MatrixXf::Random(3,5); |
2 | cout << "Here is the matrix m:" << endl << m << endl; | ||||
3 | LU<MatrixXf> lu(m); | ||||
4 | // allocate the matrix ker with the correct size to avoid reallocation | ||||
5 | MatrixXf ker(m.rows(), lu.dimensionOfKernel()); | ||||
6 | lu.computeKernel(&ker); | ||||
7 | cout << "Here is a matrix whose columns form a basis of the kernel of m:" | ||||
8 | << endl << ker << endl; | ||||
9 | cout << "By definition of the kernel, m*ker is zero:" | ||||
10 | << endl << m*ker << endl; |