diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-12-18 20:36:25 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-12-18 20:36:25 +0000 |
commit | fabaa6915be063a5390ad78c4ddd86b335691418 (patch) | |
tree | 9dbd25fadf56402587629e76ec9a1dd0a0727739 /doc | |
parent | b27a3644a24248606092357a0b11aae56e6dbb91 (diff) |
* fix in IO.h, a useless copy was made because of assignment from
Derived to MatrixBase.
* the optimization of eval() for Matrix now consists in a partial
specialization of ei_eval, which returns a reference type for Matrix.
No overriding of eval() in Matrix anymore. Consequence: careful,
ei_eval is no longer guaranteed to give a plain matrix type!
For that, use ei_plain_matrix_type, or the PlainMatrixType typedef.
* so lots of changes to adapt to that everywhere. Hope this doesn't
break (too much) MSVC compilation.
* add code examples for the new image() stuff.
* lower a bit the precision for floats in the unit tests as
we were already doing some workarounds in inverse.cpp and we got some
failed tests.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/snippets/LU_computeImage.cpp | 13 | ||||
-rw-r--r-- | doc/snippets/LU_image.cpp | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/doc/snippets/LU_computeImage.cpp b/doc/snippets/LU_computeImage.cpp new file mode 100644 index 000000000..5c812cc4c --- /dev/null +++ b/doc/snippets/LU_computeImage.cpp @@ -0,0 +1,13 @@ +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; diff --git a/doc/snippets/LU_image.cpp b/doc/snippets/LU_image.cpp new file mode 100644 index 000000000..0d1088a2f --- /dev/null +++ b/doc/snippets/LU_image.cpp @@ -0,0 +1,9 @@ +Matrix3d m; +m << 1,1,0, + 1,3,2, + 0,1,1; +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; |