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

splu does not work for non-vector inputs #3363

Closed
pv opened this issue Feb 21, 2014 · 1 comment · Fixed by #3367
Closed

splu does not work for non-vector inputs #3363

pv opened this issue Feb 21, 2014 · 1 comment · Fixed by #3367
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg
Milestone

Comments

@pv
Copy link
Member

pv commented Feb 21, 2014

splu does not actually work when called with a non-vector rhs:

import numpy as np
from scipy.sparse.linalg import splu
A = np.random.rand(2,2)
b = np.random.rand(2,2)
x2 = splu(A).solve(b)
x1 = np.linalg.solve(A, b)
print(abs(x1 - x2).max())
# -> 2.2361768860074456

works for vectors:

x2 = np.array([splu(A).solve(b[:,j]) for j in range(2)]).T
print(abs(x1 - x2).max())
# -> 0

Raises an error for some rhs shapes:

b = np.random.rand(2,1)
x2 = splu(A).solve(b)
# -> SystemError
@pv pv added this to the 0.14.0 milestone Feb 21, 2014
@pv pv added defect labels Feb 21, 2014
@pv
Copy link
Member Author

pv commented Feb 21, 2014

Not a recent regression, also 0.7.2 does the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant