[Numpy-discussion] question about in-place operations
massimo.dipierro at gmail.com
Tue May 22 11:06:31 EDT 2012
Thank you this does it.
On May 22, 2012, at 9:59 AM, Robert Kern wrote:
> On Tue, May 22, 2012 at 3:47 PM, Massimo DiPierro
> <massimo.dipierro at gmail.com> wrote:
>> Thank you. I will look into numexpr.
>> Anyway, I do not need arbitrary expressions. If there were something like
>> with support for scale in int, float, complex, this would be sufficient for me.
> BLAS has the xAXPY functions, which will do this for float and complex.
> import numpy as np
> from scipy.linalg import fblas
> def add_scaled_inplace(a, scale, b):
> if np.issubdtype(a.dtype, complex):
> fblas.zaxpy(b, a, a=scale)
> fblas.daxpy(b, a, a=scale)
> Robert Kern
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
More information about the NumPy-Discussion