Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2002-05-03 03:14:08


Salut,

On Thursday 02 May 2002 21:56, Joerg Walter wrote:
> ----- Original Message -----
> From: "Paul C. Leopardi" <leopardi_at_[hidden]>

> > To do this, GluCat routines use MTL iterators which provide iteration
> > over the non-zero entries of a matrix. This means GluCat can iterate over
[..]

> Iteration over a matrix is possible in the following way:
>
> for (numerics::sparse_matrix<double>::const_iterator1 itmr =
> m.begin1 ();
> itmr != m.end1 ();
> ++ itmr) {
> for (numerics::sparse_matrix<double>::const_iterator2 itmc =
> itmr.begin ();
> itmc != itmr.end ();
> ++ itmc) {
> std::cout << *itmc << std::endl;
> }
> }

I would also like to have an iterator, that iterates over all elements of a
matrix in the fastest way (depending on the storage scheme).
For dense matrices, it should iterate over all elements, for hemitean on one
upper or lower triangle block, for sparse matrices over the non-zero elements,
etc. For dense matrices stored as a block, or for sparse matrices stored in a
std::map this should be more efficient the two loop version.

Best wishes
Peter


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