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

BUG: sparse/linalg: fix expm for np.matrix inputs #10906

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

pv
Copy link
Member

@pv pv commented Oct 6, 2019

Reference issue

Closes: gh-5546

What does this implement/fix?

The expm implementation contains code that does not work with np.matrix (at least the MatrixPower linear operator part of it has _rmatvec that assumes self._A is ndarray). This is a minimal fix to avoid problems, by converting matrix inputs to ndarray.

Additional information

Expm returned np.ndarray output for np.matrix input also previously, so there's no behavior change.

@pv pv added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg backport-candidate This fix should be ported by a maintainer to previous SciPy versions. labels Oct 6, 2019
@lobpcg
Copy link
Contributor

lobpcg commented Oct 7, 2019

Looks good!

@perimosocordiae
Copy link
Member

Test failures look unrelated, so I'll merge.

@perimosocordiae perimosocordiae merged commit 2d6327e into scipy:master Oct 8, 2019
@tylerjereddy tylerjereddy added this to the 1.4.0 milestone Oct 15, 2019
tylerjereddy pushed a commit to tylerjereddy/scipy that referenced this pull request Oct 23, 2019
@tylerjereddy tylerjereddy modified the milestones: 1.4.0, 1.3.2 Oct 31, 2019
@tylerjereddy tylerjereddy removed the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Nov 29, 2019
tylerjereddy pushed a commit to tylerjereddy/scipy that referenced this pull request Jan 20, 2020
tylerjereddy added a commit to tylerjereddy/scipy that referenced this pull request Jan 20, 2020
* update SciPy 1.2.3 release notes to
include backports for: scipygh-11126, scipygh-10906,
scipygh-10633, scipygh-10138, and scipygh-10076.

* briefly mention in the notes that this
is part of the Python 2.7 LTS support series
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 this pull request may close these issues.

ValueError raised if scipy.sparse.linalg.expm recieves array larger than 200x200
4 participants