There are a lot of overheads for performing repeated operations in numpy / scipy, because most operations return a new object.
for instance
for i in range(100):
x = A*x
I would like to avoid this by passing a reference to the operation, as in C
for i in range(100):
np.dot(A,x,x_new)
x,x_new = x_new,x
Is there any way to do this? I would like this not just for multiplication, but for all operations that return a matrix or vector.
source
share