diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-03-14 10:22:02 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-03-14 10:22:02 -0600 |
commit | cd97607e2f14ac5489215549cb7ff7123394386f (patch) | |
tree | 94e311b36e16ca676b07540ed87d34b8439e7550 /numpy/polynomial/legendre.py | |
parent | 782ba88d601ffe0f2f8373b01279d362d402de8b (diff) | |
parent | c2e4c9c034a3446de643fb4f8e96d21249abb7b9 (diff) | |
download | numpy-cd97607e2f14ac5489215549cb7ff7123394386f.tar.gz |
Merge branch 'poly'
Diffstat (limited to 'numpy/polynomial/legendre.py')
-rw-r--r-- | numpy/polynomial/legendre.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index 9aec256cd..3ea68a5e6 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -227,52 +227,6 @@ def legline(off, scl) : return np.array([off]) -def legtimesx(cs): - """Multiply a Legendre series by x. - - Multiply the Legendre series `cs` by x, where x is the independent - variable. - - - Parameters - ---------- - cs : array_like - 1-d array of Legendre series coefficients ordered from low to - high. - - Returns - ------- - out : ndarray - Array representing the result of the multiplication. - - Notes - ----- - The multiplication uses the recursion relationship for Legendre - polynomials in the form - - .. math:: - - xP_i(x) = ((i + 1)*P_{i + 1}(x) + i*P_{i - 1}(x))/(2i + 1) - - """ - # cs is a trimmed copy - [cs] = pu.as_series([cs]) - # The zero series needs special treatment - if len(cs) == 1 and cs[0] == 0: - return cs - - prd = np.empty(len(cs) + 1, dtype=cs.dtype) - prd[0] = cs[0]*0 - prd[1] = cs[0] - for i in range(1, len(cs)): - j = i + 1 - k = i - 1 - s = i + j - prd[j] = (cs[i]*j)/s - prd[k] += (cs[i]*i)/s - return prd - - def legfromroots(roots) : """ Generate a Legendre series with the given roots. |