Am 10.03.2014 10:46, schrieb Christophe Bal:
Hello,
when reading the draft, I've seen
Elementwise multiplication is useful because it fits the common pattern for
numerical code: it lets us easily and quickly perform a basic operation
(scalar multiplication) on a large number of aligned values without writing
a slow and cumbersome for loop.
Oh. Cumbersome... as in writing a single scalar multiplication.
Plus you still need a "slow and cumbersome" loop to add the products,
and if you use @ to create the elementwise products you also allocate an
array that you don't need if you code it in a Python loop.
And slow... well if speed is a concern, then maybe they should be doing
numerics in C or Fortran.
OMFG. The more I see the details, the less I like it.
>> And this fits into a very general schema;
e.g., in numpy, *all Python operators work elementwise on arrays of all
dimensionalities.*
Sure. It just isn't a widespread operation - not by lines of code anyway.
>> Matrix multiplication is slightly more special-purpose
-- it's only defined on 2d arrays, also known as "matrices" -- but still
used very heavily across all application areas; mathematically, it's one of
the most fundamental operations there is.
That's true.
This is also the case in math so I do not think that it is a good argument.
I really think that @ instead of * for scalar product is the good choice !
Heh.
Don't forget the scientific math world which use more and more Python.
Sure - but then scientific math is still a small niche in the Python world.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/531DA0DE.20801%40durchholz.org.
For more options, visit https://groups.google.com/d/optout.