diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-01-23 20:07:49 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-01-23 20:18:12 -0700 |
commit | ccbbfd5fd4c0377672aff5701e3624254b3a3138 (patch) | |
tree | 1421292845385ce62fe804ea6aee7c210b27966c /numpy/polynomial/tests/test_polynomial.py | |
parent | 855b66f3eeab166ee504d73952b61b4b713f3c6f (diff) | |
download | numpy-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_polynomial.py')
-rw-r--r-- | numpy/polynomial/tests/test_polynomial.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py index bae711cbf..bd09c07f6 100644 --- a/numpy/polynomial/tests/test_polynomial.py +++ b/numpy/polynomial/tests/test_polynomial.py @@ -440,6 +440,11 @@ class TestMisc(TestCase) : # wcoef2d = poly.polyfit(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(poly.polyfit(x, x, 1), [0, 1]) + def test_polytrim(self) : coef = [2, -1, 1, 0] |