Boost logo

Boost :

From: jhrwalter (walter_at_[hidden])
Date: 2002-02-12 03:44:46


--- In boost_at_y..., Peter Schmitteckert (boost) <boost_at_s...> wrote:
> Dear all,
>
> wouldn't it be nice to have an iterator for matrices,
> which iterates over all elements in the fastest way
> possible.
 
I'm not sure ;-)
 
> In my Application I have to update all elements of a
> matrix, so I'd like to write
>
> numerics::matrix<...> m;
> // ....
> for( matrix::iterator it = m.b.begin(); it != m.end(); ++it )
> *it = MySpecialFormula( *it );

If we grant access to the internal representation, one could write
something like
 
matrix<...> m;
// ....
for( matrix<...>::array_type::iterator it = m.data().begin(); it !=
m.data().end(); ++it )
    *it = MySpecialFormula( *it );

instead.
 
> I was only able to find iterator1 / iterator2 in ublas::matrix.
>
> Best wishes,
> Peter
 
Regards
 
Joerg
 
P.S.: Sorry for the delay.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk