summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests/test_chebyshev.py
diff options
context:
space:
mode:
authorJeffrey Yancey <jeffrey@octane5.com>2018-08-26 14:50:37 -0600
committerJeffrey Yancey <jeffrey@octane5.com>2018-08-26 14:50:37 -0600
commitbfc0020621a931726e219a013e08e9f96e767a33 (patch)
treeb0c2156238dce955b00c6dd93cc8e526db5cccfe /numpy/polynomial/tests/test_chebyshev.py
parent52c67eb9a213b9df87f98d6f1f70398e147de425 (diff)
downloadnumpy-bfc0020621a931726e219a013e08e9f96e767a33.tar.gz
TST: add missing tests for all polynomial subclass pow fns.
Diffstat (limited to 'numpy/polynomial/tests/test_chebyshev.py')
-rw-r--r--numpy/polynomial/tests/test_chebyshev.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py
index 439dfa08d..6169b4120 100644
--- a/numpy/polynomial/tests/test_chebyshev.py
+++ b/numpy/polynomial/tests/test_chebyshev.py
@@ -3,6 +3,8 @@
"""
from __future__ import division, absolute_import, print_function
+from functools import reduce
+
import numpy as np
import numpy.polynomial.chebyshev as cheb
from numpy.polynomial.polynomial import polyval
@@ -111,6 +113,15 @@ class TestArithmetic(object):
res = cheb.chebadd(cheb.chebmul(quo, ci), rem)
assert_equal(trim(res), trim(tgt), err_msg=msg)
+ def test_chebpow(self):
+ for i in range(5):
+ for j in range(5):
+ msg = "At i=%d, j=%d" % (i, j)
+ c = np.arange(i + 1)
+ tgt = reduce(cheb.chebmul, [c]*j) if j else np.array([1])
+ res = cheb.chebpow(c, j)
+ assert_equal(trim(res), trim(tgt), err_msg=msg)
+
class TestEvaluation(object):
# coefficients of 1 + 2*x + 3*x**2