summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-03-21 13:28:29 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-03-21 13:28:29 +0000
commitea1b8365a1f77e4c23f8289144a554517cac02c8 (patch)
tree236729a3d03955261d4eb2765c613e62f31097d0 /numpy/linalg/tests
parent51a6dc75ae5f6e428493bba7e49150a3d6705aa6 (diff)
downloadnumpy-ea1b8365a1f77e4c23f8289144a554517cac02c8.tar.gz
Add regression test for #662.
Diffstat (limited to 'numpy/linalg/tests')
-rw-r--r--numpy/linalg/tests/test_regression.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py
index 4e2295539..9ea892a15 100644
--- a/numpy/linalg/tests/test_regression.py
+++ b/numpy/linalg/tests/test_regression.py
@@ -3,7 +3,7 @@
from numpy.testing import *
set_package_path()
-from numpy import linalg, arange, float64
+from numpy import linalg, arange, float64, array
restore_path()
rlevel = 1
@@ -30,5 +30,16 @@ class TestRegression(NumpyTestCase):
va, ve = linalg.eig(a)
assert_array_almost_equal(va, rva)
+ def test_eigh_build(self, level = rlevel):
+ """Ticket 662."""
+ rvals = [68.60568999, 89.57756725, 106.67185574]
+
+ cov = array([[ 77.70273908, 3.51489954, 15.64602427],
+ [3.51489954, 88.97013878, -1.07431931],
+ [15.64602427, -1.07431931, 98.18223512]])
+
+ vals, vecs = linalg.eigh(cov)
+ assert_array_almost_equal(vals, rvals)
+
if __name__ == '__main__':
NumpyTest().run()