summaryrefslogtreecommitdiff
path: root/numpy/polynomial/chebyshev.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2011-12-10 08:35:29 -0700
committerCharles Harris <charlesr.harris@gmail.com>2012-01-09 10:45:12 -0700
commit0a17ccb5dad99e6dd33ab315223f1b0a6ffe98ae (patch)
tree2f716c0f09f3b517c1296cd92bff2dc561ce4a37 /numpy/polynomial/chebyshev.py
parentb8179388d3868be2cc26b6ca12e937c7f83a9d5c (diff)
downloadnumpy-0a17ccb5dad99e6dd33ab315223f1b0a6ffe98ae.tar.gz
STY: Whitespace cleanup and double space between function definitions.
Diffstat (limited to 'numpy/polynomial/chebyshev.py')
-rw-r--r--numpy/polynomial/chebyshev.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index a6482fc72..b4f50d90e 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -121,6 +121,7 @@ def _cseries_to_zseries(cs) :
zs[n-1:] = cs/2
return zs + zs[::-1]
+
def _zseries_to_cseries(zs) :
"""Covert z-series to a Chebyshev series.
@@ -145,6 +146,7 @@ def _zseries_to_cseries(zs) :
cs[1:n] *= 2
return cs
+
def _zseries_mul(z1, z2) :
"""Multiply two z-series.
@@ -171,6 +173,7 @@ def _zseries_mul(z1, z2) :
"""
return np.convolve(z1, z2)
+
def _zseries_div(z1, z2) :
"""Divide the first z-series by the second.
@@ -237,6 +240,7 @@ def _zseries_div(z1, z2) :
rem = z1[i+1:i-1+len2].copy()
return quo, rem
+
def _zseries_der(zs) :
"""Differentiate a z-series.
@@ -268,6 +272,7 @@ def _zseries_der(zs) :
d, r = _zseries_div(zs, ns)
return d
+
def _zseries_int(zs) :
"""Integrate a z-series.
@@ -434,6 +439,7 @@ chebone = np.array([1])
# Chebyshev coefficients representing the identity x.
chebx = np.array([0,1])
+
def chebline(off, scl) :
"""
Chebyshev series whose graph is a straight line.
@@ -469,6 +475,7 @@ def chebline(off, scl) :
else :
return np.array([off])
+
def chebfromroots(roots) :
"""
Generate a Chebyshev series with the given roots.
@@ -787,6 +794,7 @@ def chebdiv(c1, c2):
rem = pu.trimseq(_zseries_to_cseries(rem))
return quo, rem
+
def chebpow(cs, pow, maxpower=16) :
"""Raise a Chebyshev series to a power.
@@ -838,6 +846,7 @@ def chebpow(cs, pow, maxpower=16) :
prd = np.convolve(prd, zs)
return _zseries_to_cseries(prd)
+
def chebder(cs, m=1, scl=1) :
"""
Differentiate a Chebyshev series.
@@ -1015,6 +1024,7 @@ def chebint(cs, m=1, k=[], lbnd=0, scl=1):
cs[0] += k[i] - chebval(lbnd, cs)
return cs
+
def chebval(x, cs):
"""Evaluate a Chebyshev series.
@@ -1075,6 +1085,7 @@ def chebval(x, cs):
c1 = tmp + c1*x2
return c0 + c1*x
+
def chebvander(x, deg) :
"""Vandermonde matrix of given degree.