Skip to content

Commit

Permalink
make matvec compatible with scipy sparse arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
FMatti committed Jul 3, 2024
1 parent 57923e0 commit eadee2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roughly/approximate/krylov.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _preprocess(self, A, X, k, dtype=None):
self.n, self.m = X.shape
self.k = k

self.matvec = (lambda x: A @ x) if isinstance(A, np.ndarray) else A
self.matvec = (lambda x: A @ x) if isinstance(A, np.ndarray | sp.sparse.sparray) else A
self.dtype = A.dtype if dtype is None else dtype
return X

Expand Down

0 comments on commit eadee2b

Please sign in to comment.