From 43c79ff448534e1d672e5c6013f9659d27d69aa0 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Tue, 12 Mar 2019 22:45:16 -0700 Subject: MAINT: Unify polynomial division functions These division functions are all the same - the algorithm used does not care about the basis. Note that while chebdiv and polydiv could be implemented in terms of this function, their current implementations are more optimal and exploit the properties of a multiplication by a basis polynomial. --- numpy/polynomial/polynomial.py | 1 + 1 file changed, 1 insertion(+) (limited to 'numpy/polynomial/polynomial.py') diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index 8c6b604d5..f63d9dd74 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -397,6 +397,7 @@ def polydiv(c1, c2): if c2[-1] == 0: raise ZeroDivisionError() + # note: this is more efficient than `pu._div(polymul, c1, c2)` lc1 = len(c1) lc2 = len(c2) if lc1 < lc2: -- cgit v1.2.1