Skip to content

Instantly share code, notes, and snippets.

@jakevdp
Created June 13, 2011 22:03
Show Gist options
  • Select an option

  • Save jakevdp/1023833 to your computer and use it in GitHub Desktop.

Select an option

Save jakevdp/1023833 to your computer and use it in GitHub Desktop.
ARPACK memory error
import numpy as np
from scipy.sparse.linalg import eigs
N = 6
k = 2
# with this random seed, I get a memory error on the third iteration below
np.random.seed(2301)
A = np.random.random((N,N))
for i in range(3):
print i
evals2, evecs2 = eigs(A, k)
@jakevdp
Copy link
Author

jakevdp commented Jun 13, 2011

Given that many of the memory errors are on or after an allocated block of size 240 bytes = 30 doubles, I think this has to do with the array "v" passed to dnaupd. In this case, the shape of v is (n,ncv) where ncv=2*k+1, with n=6 and k=2 in our case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment