diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/polynomial/tests/test_chebyshev.py | 4 | ||||
-rw-r--r-- | numpy/polynomial/tests/test_hermite.py | 4 | ||||
-rw-r--r-- | numpy/polynomial/tests/test_hermite_e.py | 4 | ||||
-rw-r--r-- | numpy/polynomial/tests/test_laguerre.py | 4 | ||||
-rw-r--r-- | numpy/polynomial/tests/test_legendre.py | 4 | ||||
-rw-r--r-- | numpy/polynomial/tests/test_polynomial.py | 5 |
6 files changed, 25 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py index 331cc17bc..95da83631 100644 --- a/numpy/polynomial/tests/test_chebyshev.py +++ b/numpy/polynomial/tests/test_chebyshev.py @@ -435,6 +435,10 @@ class TestFitting(TestCase): # wcoef2d = cheb.chebfit(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(cheb.chebfit(x, x, 1), [0, 1]) class TestGauss(TestCase): diff --git a/numpy/polynomial/tests/test_hermite.py b/numpy/polynomial/tests/test_hermite.py index b5649a693..a0ef3b515 100644 --- a/numpy/polynomial/tests/test_hermite.py +++ b/numpy/polynomial/tests/test_hermite.py @@ -425,6 +425,10 @@ class TestFitting(TestCase): # wcoef2d = herm.hermfit(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(herm.hermfit(x, x, 1), [0, .5]) class TestGauss(TestCase): 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): diff --git a/numpy/polynomial/tests/test_laguerre.py b/numpy/polynomial/tests/test_laguerre.py index 14fafe37d..b6e0376a2 100644 --- a/numpy/polynomial/tests/test_laguerre.py +++ b/numpy/polynomial/tests/test_laguerre.py @@ -420,6 +420,10 @@ class TestFitting(TestCase): # wcoef2d = lag.lagfit(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(lag.lagfit(x, x, 1), [1, -1]) class TestGauss(TestCase): diff --git a/numpy/polynomial/tests/test_legendre.py b/numpy/polynomial/tests/test_legendre.py index cdfaa96f1..3180db907 100644 --- a/numpy/polynomial/tests/test_legendre.py +++ b/numpy/polynomial/tests/test_legendre.py @@ -423,6 +423,10 @@ class TestFitting(TestCase): # wcoef2d = leg.legfit(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(leg.legfit(x, x, 1), [0, 1]) class TestGauss(TestCase): 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] |