[SciPy-User] Matrix multiplication operator PEP

Fernando Perez fperez.net at gmail.com
Sun Feb 23 19:16:54 EST 2014


Great info, but it might be better to record it in the PEP PR:

https://github.com/numpy/numpy/pull/4351

so it makes it into the final document. I think Nathaniel wanted to
continue the discussion there, so it's not spread across lists.

Cheers

f


On Sun, Feb 23, 2014 at 2:26 PM, Geordie McBain <gdmcbain at freeshell.org>wrote:

> 2014-02-22 21:03 GMT+11:00 Dinesh Vadhia <dineshbvadhia at hotmail.com>:
> > +1
> >
> > Btw, what do other languages use as their "@" matrix multiplication
> > operator.
>
> I skimmed a few examples from
> http://rosettacode.org/wiki/Matrix_multiplication:
>
> APL: +.×
> IDL: #
> J: +/ .*
> Julia: *
> K: _mul
> Mathematica: .
> MATLAB/Octave: * (with .* for elementwise)
> Maxima: . (with * for elementwise)
> Pari/GP: *
> R: %*%
> Ruby: * (but only for a special matrix class)
> TI-83 BASIC: *
>
> I'd say APL's use of non-ASCII characters was historically unpopular.
> IDL's hash clashes with Python's comment.  J uses an ASCII reworking
> of APL, I think, so it's got a much more elaborate idea of combining
> multiple infix operators together; powerful but perhaps not really
> Pythonic.  The dot of Mathematica and Maxima is nice but clashes with
> Python's object attribute/method/module accessor.  Julia, Octave,
> Pari/GP, and TI-83 BASIC's star is nice but would be
> backward-incompatible with NumPy's elementwise multiplication; Ruby's
> star relies on the subclass idea eloquently rebutted by the original
> poster.  R's and K's multicharacter things are pretty ugly.
>
> --
> G. D. McBain
>
> Theory of Lift - Introductory Computational Aerodynamics in MATLAB/Octave
> Out now - http://www.wileyeurope.com/remtitle.cgi?111995228X
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20140223/bea3430f/attachment.html>


More information about the SciPy-User mailing list