8000 Bad results of SVD on some (non-contiguous?) arrays (Trac #178) · Issue #776 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Bad results of SVD on some (non-contiguous?) arrays (Trac #178) #776

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 t 8000 erms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 2 comments
Closed

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/178 on 2006-07-13 by @bthyreau, assigned to unknown.

Hi, The svd functions may return fully wrong values on the svn trunk (Here: 0.9.9.2800).
It worked with 0.9.8, still.
Short script to trigger the problem:

from numpy import *
from numpy.linalg import svd
from numpy.random import rand
K = rand(10003 * 2).reshape(10003, 2).astype(float32)
K3 = K[:,0:1]
r1 = svd(K3.copy(), 0)[0]
r2 = svd(K3, 0)[0]
(r1 == r2).all()

The last line should return True, but returns False presently. Note that strangely enough, it starts failing for me at sizes of about 10010. Thanks

@numpy-gitbot
Copy link
Author

@alberts wrote on 2006-07-13

This looks similar to the problem mentioned in #763. The following error from Valgrind 3.1.0 seems to indicate the main culprit (tested with r2813):

==7522== Conditional jump or move depends on uninitialised value(s)
==7522==    at 0x4632701: PyArray_Scalar (arrayobject.c:1289)
==7522==    by 0x4632EF5: PyArray_Return (arrayobject.c:1444)
==7522==    by 0x4696EF6: PyUFunc_GenericReduction (ufuncobject.c:2559)
==7522==    by 0x5F15CFC: PyCFunction_Call (in /usr/lib/libpython2.4.so.1.0)
==7522==    by 0x5EEB586: PyObject_Call (in /usr/lib/libpython2.4.so.1.0)
==7522==    by 0x463D318: PyArray_GenericReduceFunction (arrayobject.c:3211)
==7522==    by 0x46669E3: PyArray_All (multiarraymodule.c:781)
==7522==    by 0x4666A77: array_all (arraymethods.c:1380)
==7522==    by 0x5F15CFC: PyCFunction_Call (in /usr/lib/libpython2.4.so.1.0)
==7522==    by 0x5F50E2A: PyEval_EvalFrame (in /usr/lib/libpython2.4.so.1.0)
...

@numpy-gitbot
Copy link
Author

@teoliphant wrote on 2006-07-18

This was a problem with _broacast_cast and strided_cast in particular where the index was not being updated to reflect all the converted values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0