summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2010-08-15 18:16:38 +0000
committerCharles Harris <charlesr.harris@gmail.com>2010-08-15 18:16:38 +0000
commita0f3609e88a998626309f63a9d1288fd591de6aa (patch)
treeed4f1e1cc4fe325c689ae3eb95a59560882658bc /numpy/polynomial/tests
parent6b9762c0a918acb583bee7e387863123e339e46c (diff)
downloadnumpy-a0f3609e88a998626309f63a9d1288fd591de6aa.tar.gz
ENH: Add {cheb,poly}mulx functions as use them to simplify some code.
Fix some documentation.
Diffstat (limited to 'numpy/polynomial/tests')
-rw-r--r--numpy/polynomial/tests/test_chebyshev.py8
-rw-r--r--numpy/polynomial/tests/test_polynomial.py8
2 files changed, 16 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py
index 8ae1dee6f..cc23ba701 100644
--- a/numpy/polynomial/tests/test_chebyshev.py
+++ b/numpy/polynomial/tests/test_chebyshev.py
@@ -78,6 +78,14 @@ class TestArithmetic(TestCase) :
res = ch.chebsub([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg)
+ def test_chebmulx(self):
+ assert_equal(ch.chebmulx([0]), [0])
+ assert_equal(ch.chebmulx([1]), [0,1])
+ for i in range(1, 5):
+ ser = [0]*i + [1]
+ tgt = [0]*(i - 1) + [.5, 0, .5]
+ assert_equal(ch.chebmulx(ser), tgt)
+
def test_chebmul(self) :
for i in range(5) :
for j in range(5) :
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py
index 3a3f26861..5890ac13f 100644
--- a/numpy/polynomial/tests/test_polynomial.py
+++ b/numpy/polynomial/tests/test_polynomial.py
@@ -61,6 +61,14 @@ class TestArithmetic(TestCase) :
res = poly.polysub([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg)
+ def test_polymulx(self):
+ assert_equal(poly.polymulx([0]), [0])
+ assert_equal(poly.polymulx([1]), [0, 1])
+ for i in range(1, 5):
+ ser = [0]*i + [1]
+ tgt = [0]*(i + 1) + [1]
+ assert_equal(poly.polymulx(ser), tgt)
+
def test_polymul(self) :
for i in range(5) :
for j in range(5) :