From: Jeremy Graham Siek (jsiek_at_[hidden])
Date: 2004-07-05 20:06:48
You are confusing the matrix abstraction with the multi-dimensional
A *linear algebra* algorithm will never need to be generalized
in the fashion you advocate below. That's because matrices are
about systems of equations. A system of equations has a certain
number of unknowns and a certain number of equations.
Once the system is represented as a matrix, the number of rows
corresponds to the number of equations, and the number of
columns corresponds to the number of unknowns. That's it.
There's no more numbers to talk about.
Another way to look at this is to focus on the mathematical concept
*Linear Operator*. A linear operator is something that you can multiply
with a vector of a certain size to get another vector of a certain size.
The "number of columns" of the linear operator is the required size
of the input vector, and the "number of rows" of the linear operator is
the required size of the output vector.
On Jul 5, 2004, at 6:04 PM, Aleksey Gurtovoy wrote:
> Neither 'size1' nor 'num_rows' are generic, though. What you want is
> something like
> template< int n > size(int_<n>);
> The particular int_<n> specializations then can be typedef'ed to
> something more mnemonic, e.g.
> typedef int_<0> rows;
> or even
> extern int_<0> rows;
> The lack of this genericity will force you, sooner or later, to resort
> to code duplication. I believe Vesa made the same point a long time
> ago... yep: http://thread.gmane.org/gmane.comp.lib.boost.devel/60338.
> Aleksey Gurtovoy
> MetaCommunications Engineering
> Unsubscribe & other changes:
Jeremy Siek <jsiek_at_[hidden]>
Ph.D. Candidate, Indiana University Bloomington
C++ Booster (http://www.boost.org)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk