Boost logo

Glas :

Re: [glas] dense and sparse vectors

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2005-08-02 07:38:26


Theodore Papadopoulo wrote:

> I'll certainly have a close look at all of this... as soon as I have
> some time ;-(.
>
> Just a quick reaction though. I somewhat dislike the various xx_begin()
> and xx_end() functions. In my code, I managed to keep the standard begin
> () and end() function differing the call of the actual functions in the
> constructors of the iterators. Namely, begin just returns a BEGIN<xx>
> structure and the same for end() (and END<xx>) structure, and then the
> iterator constructors use the information stored in these structures to
> initialize themselves.

So IIUC 'begin()' returns a structure and this structure on this
structure is passed on to the constructor of an iterator? So 'begin()'
and 'end()' do not return an iterator, right?
Could you enlighten me with e.g. a 5-line pseudo-code that shows how you
create an iterator over all non-zero's of a sparse matrix and an
iterator over all (including the structural zero's) elements in the
sparse matrix.

>
> Overall, this has worked very nicely and leads to a quite natural
> notation. Would it be possible to use it in Glas ??
>
> If yes, I can offer to do some implementation of it (ir would give me an
> opportunity to have the close look at the code...).

Sure by all means. I'm interested to see what you mean exactly. I do not
really like 'nz_begin()' and 'all_begin()' either but I could not come
up with a viable alternative.

You can checkout my current code from the CVS for instance (it's on a
branch called 'tk1'), adapt some files according to your ideas and post
these to the ml.

toon