Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-07-29 16:14:37


Am Freitag, 18. Juli 2008 22:52 schrieb Niko Vuokko:
> How do I iterate over the strict upper triangle of a
> compressed_matrix? I came up with some in the lines of (abbr.)
>
> for(iterator1 i1 = mat.begin1(); i1 != mat.end1(); ++i1) {
> s = i1.index1();
> for(iterator2 i2(mat, 1, s, s+1, ???); i2 != i1.end(); ++i2)
> ...
> }
> }
>
> but don't know how to fill in that last parameter. Is this sensible
> or is there a better way to do this? Performance is essential so I
> don't want to use find functions if there's another way.

the missing parameters are the pointers into index1_array and
index2_array. So you can iterate through both arrays similar to the
find1/find2 methods.

mfg
Gunter