Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-01-24 09:48:35

On Thu, 24 Jan 2002, jhrwalter wrote:
walter> --- In boost_at_y..., Jeremy Siek <jsiek_at_c...> wrote:
walter> >
walter> > It is not important for the matrix dimension functions and the
walter> > multidimensional array dimension functions to have the same names,
walter> because
walter> > they are different abstractions. There have been many posts in the
walter> past,
walter> > by myself and other, about why matricies and arrays, though
walter> agonizingly
walter> > similar in representation, and really very different entities
walter> > mathematically, and should be treated differently in software (with
walter> which
walter> > we hope to model the mathematics).
walter>
walter> May be that's correct for matrices and multidimensional arrays. But
walter> I'm not sure, if the same holds for matrices and tensors.

Ok, that may be, but I haven't seen any posts regarding concept
definitions for tensors yet. If you have a tensor abstraction in mind,
could you do up a quick sketch of what it would look like?

walter> > If you think of a matrix as a linear operator (which I hope is what
walter> we are
walter> > aiming for with a linear algebra library), the number of columns is
walter> the
walter> > dimension of the range, and the number of rows is the dimension of
walter> the
walter> > domain. Half jokingly, I think domain_size() and range_size() would
walter> be
walter> > better names than number of rows and columns.
walter>
walter> Interesting idea, but I'm not sure, if this is ok for left
walter> multiplication with a vector.

Sure it does. Isn't x * A really A^T * x. When you transpose a matrix, the
number of rows and columns get swapped. Therefore, with the matrix
transposed, the new number of columns (the old num rows) corresponds to
the size of x, and the new number of rows matches the result vector.

walter> > However, the common usage is
walter> > the field is "number of rows" and "number of columns". If you don't
walter> name
walter> > the functions accordingly, you'll be forever answering emails about
walter> what
walter> > "size1" means.
walter>
walter> Good point.
walter>
walter> It seems to me, that the intermediate results of our (inofficial)
walter> poll are:
walter> nrows/ncols: 2
walter> size1/size2: ?
walter>
walter> So let me ask the question the other way round: are there any
walter> objections, if we rename size1()/size2() to row_count()/column_count
walter> (), index1()/index2() to row_index()/column_index() and iterator1
walter> ()/iterator2() to row_iterator()/column_iterator()?

That's better, but I'm not a big fan of "row_count". Someone could read it
as the length of a row, instead of the number of rows. I think "num_rows"
is better (and that is nice and consistent with the naming scheme in the
BGL, which uses num_vertices and num_edge).

Cheers,
Jeremy

----------------------------------------------------------------------
Jeremy Siek http://php.indiana.edu/~jsiek/
Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------