Boost logo

Boost Users :

From: Regis Behmo (regisb_at_[hidden])
Date: 2007-07-19 10:54:46


Hello everyone,
I don't understand how to use iterators with matrices; how can I scan all
the elements of a matrix? The only thing I have managed to do until now is
to read/write the elements of the first row or the first column:

ublas::matrix<int> M(3,3);
int i = 0;
for( ublas::matrix<int>::iterator1 Mit1 = M.begin1(); Mit1 != M.end1();
Mit1++ )
{
    *Mit1 = i;
    i++;
}

Are there such things as row iterators, column iterators, or iterators ocver
all the elements of the matrix?

Thanks
Régis B.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net