diff options
author | David Cournapeau <cournape@gmail.com> | 2008-03-21 13:35:50 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-03-21 13:35:50 +0000 |
commit | 971218b462b888ea045ab78edae7d36f35dcbaf9 (patch) | |
tree | 44f798fa0c5d4e01c5b401c6b5959ad8b6e6c2b9 /numpy/linalg/tests/test_regression.py | |
parent | ea1b8365a1f77e4c23f8289144a554517cac02c8 (diff) | |
download | numpy-971218b462b888ea045ab78edae7d36f35dcbaf9.tar.gz |
Add regression for #627.
Diffstat (limited to 'numpy/linalg/tests/test_regression.py')
-rw-r--r-- | numpy/linalg/tests/test_regression.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py index 9ea892a15..f712adb54 100644 --- a/numpy/linalg/tests/test_regression.py +++ b/numpy/linalg/tests/test_regression.py @@ -3,7 +3,8 @@ from numpy.testing import * set_package_path() -from numpy import linalg, arange, float64, array +import numpy as np +from numpy import linalg, arange, float64, array, dot, transpose restore_path() rlevel = 1 @@ -41,5 +42,15 @@ class TestRegression(NumpyTestCase): vals, vecs = linalg.eigh(cov) assert_array_almost_equal(vals, rvals) + def test_svd_build(self, level = rlevel): + """Ticket 627.""" + a = array([[ 0., 1.], [ 1., 1.], [ 2., 1.], [ 3., 1.]]) + m, n = a.shape + u, s, vh = linalg.svd(a) + + b = dot(transpose(u[:, n:]), a) + + assert_array_almost_equal(b, np.zeros((2, 2))) + if __name__ == '__main__': NumpyTest().run() |