Discussion: new operators for numerical computation

Robin Becker robin at jessikat.fsnet.co.uk
Wed Jul 26 06:02:01 EDT 2000


In article <m3lmypfdwe.fsf at chinon.cnrs-orleans.fr>, Konrad Hinsen
<hinsen at cnrs-orleans.fr> writes
>
...
>> 1. MatPy currently does a pretty good job of addressing many of
>> the concerns for linear algebra.  The syntax for inverse (A.I())
>> and transpose (A.T()) are both simple and allow for class specific
>> implementations (e.g. for a triangular matrix).
>
>You raise an important point: adding operators may not be the best
>solution at all.
>
>With the ongoing rework of NumPy that turns arrays into Python classes
>with an underlying C implementation, it would be possible to have an
>"array" and a "matrix" class with different semantics, but sharing
>most of the code and having equal performance. Conversion between the
>two would also be possible at basically no cost, and C modules could
>be written to accept both.
>
>Having two different classes with different semantics is perfectly
>normal in Python. It would only be a problem if there were important
>application domains that require both semantics mixed together, but I
>am not aware of such domains.

I like these ideas a lot. I could have my matrices do what I normally
want with just plain *.
-- 
Robin Becker



More information about the Python-list mailing list