summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests/test_hermite_e.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-01-23 20:07:49 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-01-23 20:18:12 -0700
commitccbbfd5fd4c0377672aff5701e3624254b3a3138 (patch)
tree1421292845385ce62fe804ea6aee7c210b27966c /numpy/polynomial/tests/test_hermite_e.py
parent855b66f3eeab166ee504d73952b61b4b713f3c6f (diff)
downloadnumpy-ccbbfd5fd4c0377672aff5701e3624254b3a3138.tar.gz
TST: Add Test for column scaling in the polynomial package fits.
The test uses the complex set of sample points [1, 1j, -1, -1j] whose squared sum is exactly zero. This would fail before the column scaling was fixed.
Diffstat (limited to 'numpy/polynomial/tests/test_hermite_e.py')
-rw-r--r--numpy/polynomial/tests/test_hermite_e.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_hermite_e.py b/numpy/polynomial/tests/test_hermite_e.py
index 018fe8595..f6bfe5e5e 100644
--- a/numpy/polynomial/tests/test_hermite_e.py
+++ b/numpy/polynomial/tests/test_hermite_e.py
@@ -422,6 +422,10 @@ class TestFitting(TestCase):
#
wcoef2d = herme.hermefit(x, np.array([yw,yw]).T, 3, w=w)
assert_almost_equal(wcoef2d, np.array([coef3,coef3]).T)
+ # test scaling with complex values x points whose square
+ # is zero when summed.
+ x = [1, 1j, -1, -1j]
+ assert_almost_equal(herme.hermefit(x, x, 1), [0, 1])
class TestGauss(TestCase):