summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests/test_regression.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/linalg/tests/test_regression.py')
-rw-r--r--numpy/linalg/tests/test_regression.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py
index 4ff14a6a5..18d212cdc 100644
--- a/numpy/linalg/tests/test_regression.py
+++ b/numpy/linalg/tests/test_regression.py
@@ -69,5 +69,22 @@ class TestRegression(TestCase):
bp = linalg.cholesky(b)
assert_array_equal(ap, bp)
+ def test_large_svd_32bit(self):
+ # 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)
+ assert_equal(np.linalg.matrix_rank(a), 1)
+ assert_array_less(1, np.linalg.norm(a, ord=2))
+
+
if __name__ == '__main__':
run_module_suite()