-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Milestone
Description
Is your feature request related to a problem? Please describe.
Even if the original input matrices were given as arrays, each of them is first turned into a LinearOperator:
A = _makeOperator(A, (n, n))
B = _makeOperator(B, (n, n))
When lobpcg is requested to compute > 20% of eigenvalues, it simply switches to eigh
, but before that needs to recover the matrices back:
A_dense = A(np.eye(n, dtype=A.dtype))
B_dense = None if B is None else B(np.eye(n, dtype=B.dtype))
vals, vecs = eigh(A_dense, B_dense, eigvals=eigvals,
check_finite=False)
which is a dramatic waste.
Describe the solution you'd like
Unless original input matrices were given as LinearOperator's, avoid
A_dense = A(np.eye(n, dtype=A.dtype))
B_dense = None if B is None else B(np.eye(n, dtype=B.dtype))
when computing > 20% of eigenvalues and call eigh
directly on the original matrices.