mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
update doc snippets
This commit is contained in:
parent
890bff977e
commit
d1db1352f5
@ -1,13 +0,0 @@
|
||||
MatrixXd m(3,3);
|
||||
m << 1,1,0,
|
||||
1,3,2,
|
||||
0,1,1;
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
LU<Matrix3d> lu(m);
|
||||
// allocate the matrix img with the correct size to avoid reallocation
|
||||
MatrixXd img(m.rows(), lu.rank());
|
||||
lu.computeImage(&img);
|
||||
cout << "Notice that the middle column is the sum of the two others, so the "
|
||||
<< "columns are linearly dependent." << endl;
|
||||
cout << "Here is a matrix whose columns have the same span but are linearly independent:"
|
||||
<< endl << img << endl;
|
@ -1,10 +0,0 @@
|
||||
MatrixXf m = MatrixXf::Random(3,5);
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
LU<MatrixXf> lu(m);
|
||||
// allocate the matrix ker with the correct size to avoid reallocation
|
||||
MatrixXf ker(m.rows(), lu.dimensionOfKernel());
|
||||
lu.computeKernel(&ker);
|
||||
cout << "Here is a matrix whose columns form a basis of the kernel of m:"
|
||||
<< endl << ker << endl;
|
||||
cout << "By definition of the kernel, m*ker is zero:"
|
||||
<< endl << m*ker << endl;
|
@ -6,4 +6,4 @@ cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Notice that the middle column is the sum of the two others, so the "
|
||||
<< "columns are linearly dependent." << endl;
|
||||
cout << "Here is a matrix whose columns have the same span but are linearly independent:"
|
||||
<< endl << m.lu().image() << endl;
|
||||
<< endl << m.lu().image(m) << endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user