diff options
-rw-r--r-- | numpy/linalg/tests/test_regression.py | 10 | ||||
-rw-r--r-- | numpy/linalg/umath_linalg.c.src | 2 |
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 846a76889..a09d2c10a 100644 --- a/numpy/linalg/umath_linalg.c.src +++ b/numpy/linalg/umath_linalg.c.src @@ -3052,7 +3052,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", |