summaryrefslogtreecommitdiff
path: root/numpy/polynomial/hermite.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-03-13 12:50:26 -0600
committerGitHub <noreply@github.com>2019-03-13 12:50:26 -0600
commit84f9576f3d62ffd0aea64f73a02d90dcbc8cc767 (patch)
treec39d34bffee9773552508f1bd83f112db3a40abb /numpy/polynomial/hermite.py
parenta1d6cf7c319ad89988f03a1478783aaf0630a27c (diff)
parent43c79ff448534e1d672e5c6013f9659d27d69aa0 (diff)
downloadnumpy-84f9576f3d62ffd0aea64f73a02d90dcbc8cc767.tar.gz
Merge pull request #13111 from eric-wieser/unify-polydiv
MAINT: Unify polydiv
Diffstat (limited to 'numpy/polynomial/hermite.py')
-rw-r--r--numpy/polynomial/hermite.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index 3e0e92cb2..caa47001a 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -550,26 +550,7 @@ def hermdiv(c1, c2):
(array([1., 2., 3.]), array([1., 1.]))
"""
- # c1, c2 are trimmed copies
- [c1, c2] = pu.as_series([c1, c2])
- if c2[-1] == 0:
- raise ZeroDivisionError()
-
- lc1 = len(c1)
- lc2 = len(c2)
- if lc1 < lc2:
- return c1[:1]*0, c1
- elif lc2 == 1:
- return c1/c2[-1], c1[:1]*0
- else:
- quo = np.empty(lc1 - lc2 + 1, dtype=c1.dtype)
- rem = c1
- for i in range(lc1 - lc2, - 1, -1):
- p = hermmul([0]*i + [1], c2)
- q = rem[-1]/p[-1]
- rem = rem[:-1] - q*p[:-1]
- quo[i] = q
- return quo, pu.trimseq(rem)
+ return pu._div(hermmul, c1, c2)
def hermpow(c, pow, maxpower=16):