Subject: Re: [ublas] size1 and size2
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2009-09-11 04:08:39
On Thu, Sep 10, 2009 at 8:48 PM, Gunter Winkler <guwi17_at_[hidden]> wrote:
> Hello all,
> I suggest to only add new free functions because this can be easily done
> in a separate header file like "matix_utils.hpp" and "vector_utils.hpp"
Hmmm, but in this way we risk to give an inconsistent interface.
In MTL4 we have both member functions and free functions
> I'd try to stay close to MTL4 if possible.
> lets summarize the need :
> num_rows(MAT); num_cols(MAT); size(VEC);
> maybe also: size<tag::row>(MAT); size<tag::column>(MAT)
> What do you think about a similar approach for iterators. Sometime one
> needs an "major" and "minor" iterator (no matter what the orientation
> of the matrix is). Sometimes one needs an explicit row-iterator whose
> value type is essentially a reference to a matrix row. (BTW. IMO the
> original iterator design of uBLAS is very bad for non-dense matrices.)
Good idea, this is close both to MTL4 and to GLAS.
For iterators, there are also the find* functions.
It seems there's no equivalent in MTL4
> maybe we start with:
> miter = begin<tag::major>(MAT);
> subiter = begin<tag::minor>(miter);
> fastiter = begin<tag::nz>(MAT); // iterate over all non-zeros
> (see also http://www.osl.iu.edu/research/mtl/mtl4/doc/iteration.html)
> Will anyone take the task to provide a set of free functions that simply
> call the existing member functions?
I have little experience with uBlas and little free time.
But if nobody can take the task I can try... A slow devel is better
than nothing ;)