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