diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-01-24 15:22:44 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-01-24 15:22:44 +0000 |
commit | 56c7e164f026c2a07ca6d4d3d81fcce2fd0c570e (patch) | |
tree | fc5612d89bda361eb5b2a1f126b14d2a937632ab /doc | |
parent | 81b0ab53cfcbe9569c3bc67e1c42a9075997da4c (diff) |
add partial count redux (adapted patch from Ricard Marxer)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/TutorialSparse.dox | 1 | ||||
-rw-r--r-- | doc/snippets/PartialRedux_count.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/TutorialSparse.dox b/doc/TutorialSparse.dox index d9d5e9e0c..a8bfe006e 100644 --- a/doc/TutorialSparse.dox +++ b/doc/TutorialSparse.dox @@ -21,7 +21,6 @@ namespace Eigen { In many applications (e.g., finite element methods) it is common to deal with very large matrices where only a few coefficients are different than zero. Both in term of memory consumption and performance, it is fundamental to use an adequate representation storing only nonzero coefficients. Such a matrix is called a sparse matrix. - \b Declaring \b sparse \b matrices \b and \b vectors \n The SparseMatrix class is the main sparse matrix representation of the Eigen's sparse module which offers high performance, low memory usage, and compatibility with most of sparse linear algebra packages. Because of its limited flexibility, we also provide a DynamicSparseMatrix variante taillored for low-level sparse matrix assembly. Both of them can be either row major or column major: diff --git a/doc/snippets/PartialRedux_count.cpp b/doc/snippets/PartialRedux_count.cpp new file mode 100644 index 000000000..914a5dee3 --- /dev/null +++ b/doc/snippets/PartialRedux_count.cpp @@ -0,0 +1,3 @@ +Matrix3d m = Matrix3d::Random(); +cout << "Here is the matrix m:" << endl << m << endl; +cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl << (m.cwise() >= 0.5).rowwise().count() << endl; |