fix sparse insertion example

This commit is contained in:
Gael Guennebaud 2011-12-11 17:18:14 +01:00
parent d738bedc5b
commit 1aa6c7f122

View File

@ -157,7 +157,7 @@ For instance, the cost of inserting nnz non zeros in a a single purely random in
A typical scenario to insert nonzeros is illustrated bellow:
\code
1: SparseMatrix<double> mat(rows,cols); // default is column major
2: mat.reserve(VectorXi::Constant(rows,6));
2: mat.reserve(VectorXi::Constant(cols,6));
3: for each i,j such that v_ij != 0
4: mat.insert(i,j) = v_ij; // alternative: mat.coeffRef(i,j) += v_ij;
5: mat.makeCompressed(); // optional