[Numpy-discussion] Speeding up numarray -- questions on its design

Robert Kern rkern at ucsd.edu
Tue Jan 18 14:17:30 CST 2005

Travis Oliphant wrote:

>>> 4) Object arrays must be supported.  This was a bad oversight and an
>>> important feature of Numeric arrays.
>> The current implementation does support them (though in a different
>> way, and generally not as efficiently, though Todd is more up on the
>> details here). What aspect of object arrays are you finding lacking?
>> C-api?
> I did not see such support when I looked at it, but given the previous 
> comment, I could easily have missed where that support is provided.  I'm 
> mainly following up on Konrad's comment that his Automatic 
> differentiation does not work with Numarray because of the missing 
> support for object arrays.  There are other applications for object 
> arrays as well.   Most of the support needs to come from the ufunc side.

It's tucked away in numarray.objects. Unfortunately for Konrad's 
application, numarray ufuncs don't recognize that it's being passed an 
object with the special methods defined, and they won't automatically 
create 0-D object "arrays". 0-D object arrays will work just fine when 
using operators (x+y works), but not when explicitly calling the ufuncs 
(add(x,y) does not work). Both methods work fine for 0-D numerical arrays.

Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

More information about the Numpy-discussion mailing list