Boost logo

Ublas :

Subject: Re: [ublas] size1 and size2
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2009-09-10 14:48:37

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"

Am Thursday 10 September 2009 schrieb Marco Guazzone:
> On Thu, Sep 10, 2009 at 12:39 PM, Marco Guazzone
> <marco.guazzone_at_[hidden]> wrote:
> > On Thu, Sep 10, 2009 at 10:16 AM, Rutger ter Borg
<rutger_at_[hidden]> wrote:
> >> I would vote for col_size and row_size, or column_size and
> >> row_size. Having a "size" in the name is more consistent with STL.
> >
> > Good choice, maybe "cols_size" and "rows_size"?
> The same should apply to iterators. Something like:
> iterator1 ==> row_iterator
> iterator2 ==> column_iterator
> reverse_iterator1 ==> reverse_row_iterator

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.)

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

Will anyone take the task to provide a set of free functions that simply
call the existing member functions?