[Numpy-discussion] output arguments

Robert Kern robert.kern at gmail.com
Mon Jul 23 23:50:47 EDT 2007


Thomas Breuel wrote:
> Hi,
> 
> core NumPy doesn't seem to support a lot of output arguments, or common
> composite operations.  For example, a common operation is something like
> 
> a = outer(b,c)
> 
> or
> 
> a += outer(b,c)
> 
> There are some workarounds, but they aren't pretty.  Consistently
> providing output arguments throughout NumPy would help; is there any
> reason this isn't being done? 

Time.

> For example, it would be nice if "outer"
> supported:
> 
> outer(b,c,output=a)
> outer(b,c,increment=a)
> outer(b,c,increment=a,scale=eps)
> 
> or maybe one could specify an accumulation ufunc, with addition,
> multiplication, min, and max being fast, and with an optional scale
> parameter.

What would the increment and scale parameters do? Why should they be part of the
 outer() interface? Have you looked at the .outer() method on the add, multiply,
minimum, and maximum ufuncs?

> Another approach might be to provide, in addition to the convenient
> high-level NumPy operations, direct bindings for BLAS and/or similar
> libraries, with Fortran-like procedural interfaces, but I can't find any
> such libraries in NumPy or SciPy.  Am I missing something?

scipy.linalg.flapack, etc.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco



More information about the NumPy-Discussion mailing list