[Numpy-discussion] vectorization of vectorization
Thu Aug 19 16:22:32 CDT 2010
Here's my problem: for each value t of an array (from 0 to 1e6) a smaller array is computed (size between 2-6). To compute the smaller array, I have a function (which can be easily vectorized if necessary) which takes t and an array of powers of t. The return is an array of modified Bessel function values, i.e.:
def funct(order, t, power):
return special.iv(order, t)**power
Note that order and power are arrays after this vectorization:
vec_func = sp.vectorization(func)
Right this is how it's used:
for i in range(1000000):
y[i] = vec_func(orders, t, powers).prod()
Of course, it is desirable to vectorize it it terms of t. I have tried different methods but still cannot make it work. Any suggestions or ointers?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion