summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <argriffi@ncsu.edu>2014-05-22 18:18:46 -0400
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-08-04 23:39:47 +0200
commit1351ff8055212c93e0c62eeb08625c4a32cfe26a (patch)
tree46caf383b3247ff2ebc5400d0f603a2351b9ea18
parent386458024eef1edb1c2efc995109e64fe69be160 (diff)
downloadnumpy-1351ff8055212c93e0c62eeb08625c4a32cfe26a.tar.gz
BUG: svd ufunc typo
closes gh-4733
-rw-r--r--numpy/linalg/tests/test_regression.py10
-rw-r--r--numpy/linalg/umath_linalg.c.src2
2 files changed, 10 insertions, 2 deletions
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py
index b0b2b2e30..61aa41e06 100644
--- a/numpy/linalg/tests/test_regression.py
+++ b/numpy/linalg/tests/test_regression.py
@@ -73,7 +73,15 @@ class TestRegression(TestCase):
# See gh-4442, 64bit would require very large/slow matrices.
x = np.eye(1000, 66)
np.linalg.svd(x)
-
+
+ def test_svd_no_uv(self):
+ # gh-4733
+ for shape in (3, 4), (4, 4), (4, 3):
+ for t in float, complex:
+ a = np.ones(shape, dtype=t)
+ w = linalg.svd(a, compute_uv=False)
+ c = np.count_nonzero(np.absolute(w) > 0.5)
+ assert_equal(c, 1)
if __name__ == '__main__':
run_module_suite()
diff --git a/numpy/linalg/umath_linalg.c.src b/numpy/linalg/umath_linalg.c.src
index 35cf545bb..6ceb5375c 100644
--- a/numpy/linalg/umath_linalg.c.src
+++ b/numpy/linalg/umath_linalg.c.src
@@ -3073,7 +3073,7 @@ GUFUNC_DESCRIPTOR_t gufunc_descriptors [] = {
"svd when n>=m. ",
4, 1, 1,
FUNC_ARRAY_NAME(svd_N),
- equal_2_types
+ svd_1_1_types
},
{
"svd_n",