Re: [glas] dense and sparse vectors
From: Theodore Papadopoulo (Theodore.Papadopoulo_at_[hidden])
Date: 2005-08-02 05:17:05
On Mon, 2005-08-01 at 15:23 +0200, Toon Knapen wrote:
> The Collection concept is inherited from by DenseCollection and
> SparseCollection. The DenseCollection basically adds the begin() and
> end() members to the collection concept. The SparseCollection concept
> the other hand adds iterators over all non-zero's and over all
> The members to get the begin and end iterator over all non-zero's are
> called nz_begin() and nz_end(), while the the begin and end iterator
> over all elements are called all_begin() and all_end(). Note thus
> the SparseCollection is not a refinement of the DenseCollection. The
> basic reason for this is that the begin() member of the
> would have to be mapped to either the nz_begin() or to the all_begin
> To which actually the user wants to map it to depends on the
> So for the sake of flexibility there is no inheritance relationship
> between the DenseCollection and SparseCollection. Later we will see
> however that adaptors allow to adapt a model of SparseCollection to be
> a model of DenseCollection.
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
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...).