Boost logo

Ublas :

Subject: Re: [ublas] size1 and size2
From: er (erwann.rogard_at_[hidden])
Date: 2009-09-14 12:10:39


> Anyway, maybe we can keep the two concept separate. So for a matrix A(m,n):
> A.num_rows() ==> m
> A.num_cols() ==> n
> A.size1() ==> m if row_major OR n if column_major
> A.size2() ==> n if row_major OR m if column_major

Just to make sure I understand, as it is now,

size_type size1 () const Returns the number of rows,

that's always m, right? If so, your naming proposal would probably have
been more explicit, but would now require changing the existing code.

However, you can still "keep the two concepts separate" by adding a
function such as size_major, like this:

Z size_major(const matrix<T,row_major>& mat){
    return basic_row_major<>::size_M(mat.size1(),mat.size2());
    // or return mat.size1();
}

Again, I'm phrasing this more as a question than a statement.