[Numpy-discussion] adding a .M attribute to the array.

Konrad Hinsen hinsen at cnrs-orleans.fr
Thu Mar 7 01:12:05 CST 2002


"eric" <eric at enthought.com> writes:

> Matrix.Matrix objects. This attribute approach will work, but I
> wonder if trying the "adding an operator to Python" approach one
> more time would be worth while. At Python10 developer's day, Guido

If it were only one operator, perhaps, although I might even give up
on Python completely if starts to use Perlish notations like ~@!.

But if you really want to have a short-hand syntax for the common
matrix operations, you'd need multiplication, division (shorthand for
multiplying by inverse), power, transpose and hermitian transpose.

If you want to go the "operator way", the goal should rather be
something like APL, with composite operators. Matrix multiplication
would then be a special case of a reduction operator that uses
multiplication and addition (in APL this is written as "+.x"). Note
that I am *not* suggesting this, my opinion is still that matrices and
arrays should be semantically different types.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the Numpy-discussion mailing list