[Numpy-discussion] output arguments
Thomas Breuel
tmbdev@gmail....
Wed Jul 25 17:47:21 CDT 2007
> > 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?
output=a would put the output of the operation into a
increment=a would increment the values in a by the result of the operation
increment=a,scale=eps would increment the values in a by the result of
multiplying the result by eps.
I think a good goal for a numerical scripting language should be to allow
people to express common numerical algorithms without extraneous array
allocations for intermediate results; with a few dozen such primitives, a
lot of native code can be avoided in my experience.
> 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.
Thanks; I'll have to take a look. I don't remember whether LAPACK contains
these low-level ops itself.
Cheers,
Thomas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070726/c8f525f5/attachment.html
More information about the Numpy-discussion
mailing list