Discussion: new operators for numerical computation

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


hzhu at localhost.localdomain (Huaiyu Zhu) writes:

> Minor questions:
> 
> 1. Is it necessary to distiguish inner and outer?  With Greg's indexing
>    rules these are essentially the same.  Six would be enough.

What are "Greg's indexing rules"? Inner and outer product are entirely
different operations in my mind, although in principle the inner
product can be thought of as an outer product followed by a summation.
I think that implementation issues also call for separate operators;
using indexing tricks might be difficult for sparse matrices, for
example.

> Major questions:
> 
> 1. Is the justification of (op) form mainly on aesthetic?  Or is it an open
>    door for more operator composition within bracket in the future?  If the
>    former, is two extra char of bracket justified?  If the latter, do we
>    need to discuss what the future extensions might be?

I like the possibility of extending this operator concept later, but for
now (in order to keep this discussion within limits) I'd just call it
a set of aesthetically acceptable matrix operators.

> original                after s/\*/(*)/g; s/\//(\/)/g
> 
> "-"*40                  "-"(*)40                # should this work?

No.

> a*2                     a(*)2                   # should this work?

Yes, as an outer product with a scalar (which happens to do
the same as a*2).

> But the main problem of these operators now appears to be that they do not
> look as clean in long formulas as they appear indivitually.
> 
> Why?  In discussions, the () works as a nice delimiter so (op) appear quite
> nice in the text.  But in real codes it interferes with visual parsing of
> existing ().

They still look acceptable to me, but perhaps [*] etc. is better in
the end. Indexing expressions are never as long as expressions in
parentheses.
-- 
-------------------------------------------------------------------------------
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