-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
scipy.linalg.lapack.dgesjv
overwrites original arrays if called on a transposed array
#13191
Comments
Transpose is returning a view and copy is still taking the original array. If you replace the line with amatt = amat.T.copy() then probably it should work but I'll check it properly later when I have some time in case others didn't already. |
To be consistent with the note at the top of the docs, shouldn't this function have an |
ouch, if it is not there, then we forgot to add it in the wrapper. |
Doesn't seem to be there: >>> lapack.dgejsv(amat, overwrite_a=False)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-29-c2555ce2437c> in <module>
----> 1 lapack.dgejsv(amat, overwrite_a=False)
TypeError: 'overwrite_a' is an invalid keyword argument for _flapack.dgejsv() |
Another hint was given to me by @pmli [...] I think the issue is in C vs. Fortran ordering. Quoting from scipy.linalg.lapack docs:
Also, this might be related to double vs. single precision (as mentioned ibid. in the second paragraph). For arrays that only had integer values, this issue did not occur. |
This reformulation, in fact, avoids this issue. |
This is an issue in the wrapper. We usually add a copying option and f2py creates an @tylerjereddy I'm going to fix this asap. Could you please tag accordingly whether we can squeeze it into 1.6 otherwise 1.7 is fine. |
The wrapper for
dgejsv
inscipy.linalg.lapack
(cp. #11354) seems to have troubles with the transpose (even if deep copies are used). Ifdgejsv
is called on an array that had been transposed, it overwrites it. This does not happen for the the untransposed.The computed values are not affected.
Reproducing code example:
Error message:
Output
Scipy/Numpy/Python version information:
The text was updated successfully, but these errors were encountered: