From 77e652d8ad3eea056e24e7458ad2ba17688723d5 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 1 Jun 2016 10:03:32 +0200 Subject: Doc: improve documentation of Map --- doc/SparseQuickReference.dox | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'doc/SparseQuickReference.dox') diff --git a/doc/SparseQuickReference.dox b/doc/SparseQuickReference.dox index e0a30edcc..a25622e80 100644 --- a/doc/SparseQuickReference.dox +++ b/doc/SparseQuickReference.dox @@ -206,7 +206,7 @@ See \ref TutorialSparse_SubMatrices and below for read-write sub-matrices. sm1.innerVectors(start, size); // RW sm1.leftCols(size); // RW sm2.rightCols(size); // RO because sm2 is row-major - sm1.middleRows(start, numRows); // RO becasue sm1 is column-major + sm1.middleRows(start, numRows); // RO because sm1 is column-major sm1.middleCols(start, numCols); // RW sm1.col(j); // RW \endcode @@ -253,6 +253,20 @@ If the matrix is not in compressed form, makeCompressed() should be called befor Note that these functions are mostly provided for interoperability purposes with external libraries.\n A better access to the values of the matrix is done by using the InnerIterator class as described in \link TutorialSparse the Tutorial Sparse \endlink section +Mapping external buffers + + +\code +int outerIndexPtr[cols+1]; +int innerIndices[nnz]; +double values[nnz]; +Map > sm1(rows,cols,nnz,outerIndexPtr, // read-write + innerIndices,values); +Map > sm2(...); // read-only +\endcode + +As for dense matrices, class Map can be used to see external buffers as an %Eigen's SparseMatrix object. + */ } -- cgit v1.2.3