Discussion: new operators for numerical computation

Tim Hochberg tim.hochberg at ieee.org
Thu Jul 20 18:18:18 EDT 2000


"Pete Shinners" <pete at visionart.com> writes:

> > (*)  outer product
> > (.)  inner product
> > (|)  matrix solve
> > (**) matrix power
> 
> 
> heh, in an effort to keep this discussion from being "half-assed" (HA)
> i'd like to voice that i also think this syntax is very useful
> and very clean. i'd be glad to see it come around for the next
> big release
> 
> but while we're at it, i would hope that we don't overlook the
> potential of elementwise assignment operators. sometimes those
> matrices can get rather large, and rather than create a new
> temporary matrix for every operation, it would be nice to have
> it done "in place"
> 
> MatrixA (*)= MatrixB
> MatrixA (.)= MatrixB

Whatever the final syntax [(*), @*, .*, ?], we should keep in mind
that in place operations will be possible only a fraction of the
time. In order for the operation to done in place, the resulting
matrix must be the same size as MatrixA. This never happens for outer
product (modulo some edge cases), For inner product and solve, this
happens if A and B are the same size. Power always works.

This isn't to say that the X= operations wouldn't work; they'd work
fine, the just wouldn't always save any space. This makes their
addition somewhat less compelling from my point of view, especially
since they start to look awfully long. On the other hand,orthoganality
is nice too.

-tim



More information about the Python-list mailing list