Commit e365726c authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed example of iteration through a SparseMat (bug #2310)

parent a09c88ab
......@@ -2187,14 +2187,14 @@ The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Su
for(; it != it_end; ++it)
{
// print element indices and the element value
const Node* n = it.node();
printf("(")
const SparseMat::Node* n = it.node();
printf("(");
for(int i = 0; i < dims; i++)
printf("
printf(":
printf("%d%s", n->idx[i], i < dims-1 ? ", " : ")");
printf(": %g\n", it.value<float>());
s += *it;
}
printf("Element sum is
printf("Element sum is %g\n", s);
..
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment