Discussion: new operators for numerical computation

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Jul 24 06:36:38 EDT 2000


hzhu at localhost.localdomain (Huaiyu Zhu) writes:

> This looks like a good idea.  The question is whether we need to put this
> into the infix operators or as class methods.

First of all into the existing function equivalents of the operators
we are talking about. Maybe later into the operators. Of course
assuming that we follow the J approach, one could in principle make
data and value ranks properties of the arrays. I don't know if this
approach has ever been tried out in practice.

> Another example concerns the inner and outer products.  Suppose we define a
> class of tensor-with-indices, we could do innerproduct like
> 
> a = b.index((2,3)) * c.index((2,4))     # a_ilmnp = b_ijkl c_mjnkp

What exactly does your index method return?

> Is this similar to what you proposed? It looks to me this is can be handled
> by the existing Python mechanism of method overloading.

No, because in the J approach ranks are a feature of functions and
operators, not of data.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



More information about the Python-list mailing list