Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using A = scipy.sparse.*_array fails and is hard to debug #386

Open
wolfgang-noichl opened this issue May 16, 2023 · 0 comments
Open

Using A = scipy.sparse.*_array fails and is hard to debug #386

wolfgang-noichl opened this issue May 16, 2023 · 0 comments
Assignees
Labels

Comments

@wolfgang-noichl
Copy link
Contributor

Minimum example:

import numpy as np
import scipy

from pyamg.gallery import poisson
pyamg.solve(scipy.sparse.csr_array(poisson((100,100))), b=np.random.randn(100*100))

This can easily happen when building A "by hand".

I didn't look into the source so far, but believe this is because some dot product becomes a element-wise multiplication somewhere.
I think checking the type or replacing * by @ or something alike should do the trick? Scipy documentation recommends *_array instead of the matrix classes, making this kind of error more likely.

@lukeolson lukeolson self-assigned this Nov 1, 2023
@lukeolson lukeolson added the fix label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants