aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-12-11 17:18:14 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-12-11 17:18:14 +0100
commit1aa6c7f1222325aa2be692ffd6a8201b948956ec (patch)
tree45f0258ce3bd525a79c4d2b1420120648c9b52f7 /doc
parentd738bedc5b159fb4ebb304a6632867ddddc67626 (diff)
fix sparse insertion example
Diffstat (limited to 'doc')
-rw-r--r--doc/C09_TutorialSparse.dox2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/C09_TutorialSparse.dox b/doc/C09_TutorialSparse.dox
index 6022cc514..cf0baa559 100644
--- a/doc/C09_TutorialSparse.dox
+++ b/doc/C09_TutorialSparse.dox
@@ -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