Boost logo

Boost Users :

From: Ed Johnson (ed_at_[hidden])
Date: 2006-05-30 17:20:37


Hi,

I read through the Ublas documentation but did not see any examples with
the iterator1 and iterator2 being used with a matrix. I am having
trouble working with them.

Does anyone know how to recreate this example using the iterators?
http://www.boost.org/libs/numeric/ublas/doc/matrix.htm

int main () {
    using namespace boost::numeric::ublas;
    matrix<double> m (3, 3);
    for (unsigned i = 0; i < m.size1 (); ++ i)
        for (unsigned j = 0; j < m.size2 (); ++ j)
            m (i, j) = 3 * i + j;
    std::cout << m << std::endl;
}

Many thanks,

Ed Johnson


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