Doc: improve documentation of Map<SparseMatrix>

This commit is contained in:
Gael Guennebaud
2016-06-01 10:03:32 +02:00
parent da4970ead2
commit 77e652d8ad
2 changed files with 31 additions and 5 deletions

View File

@@ -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</td>
</tr>
<tr class="alt"><td colspan="2">Mapping external buffers</td></tr>
<tr class="alt">
<td>
\code
int outerIndexPtr[cols+1];
int innerIndices[nnz];
double values[nnz];
Map<SparseMatrix<double> > sm1(rows,cols,nnz,outerIndexPtr, // read-write
innerIndices,values);
Map<const SparseMatrix<double> > sm2(...); // read-only
\endcode
</td>
<td>As for dense matrices, class Map<SparseMatrixType> can be used to see external buffers as an %Eigen's SparseMatrix object. </td>
</tr>
</table>
*/
}