Jason Grout wrote:
> William Stein wrote:
>> On Mon, Jun 15, 2009 at 7:34 PM, Jason Grout<jason-s...@creativetrax.com> 
>> wrote:
>>> Bill Hart wrote:
>>>> Can I ask what applications this "Hadamard product" has?
>> I've never used it, but I guess it must be really really important in
>> numerical computation, since most shockingly it is the *default* for
>> A*B in numpy!!
>>
>> sage: import numpy
>> sage: a = numpy.array([[1,2],[3,4]])
>> sage: a*a
>> array([[1, 4],
>>        [9, 16]], dtype=object)
> 
> 
> It's just default because you aren't using the numpy "matrix" class, 
> just the "array" class.  Of course, the product of two arrays is the 
> element-wise product.  See http://www.scipy.org/NumPy_for_Matlab_Users

For reasons which should be clear in my other post, I really dislike the 
entire concept of the matrix class in NumPy, well supported or not. 
Either do array manipulation or linear algebra, but something in between 
just muddies all the concepts. (I.e. they don't have Vector or 
DiagonalMatrix and so on -- it's just a quick hack to bolt linear 
algebra * and ** operators on to array manipulation.)

-- 
Dag Sverre

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to