
Boost : 
From: Jeremy Graham Siek (jsiek_at_[hidden])
Date: 20040705 20:06:48
Hi Aleksey,
You are confusing the matrix abstraction with the multidimensional
array abstraction.
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.
Best Regards,
Jeremy
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:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
_______________________________________________
Jeremy Siek <jsiek_at_[hidden]>
http://www.osl.iu.edu/~jsiek
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