From 7c2d4883fe1ebc454068b47e9e2cd1815577fb4b Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 6 May 2021 12:06:46 +0300 Subject: [PATCH] polys: removed PolyElement.extract_ground() --- diofant/polys/euclidtools.py | 8 +++++++- diofant/polys/rings.py | 12 ------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/diofant/polys/euclidtools.py b/diofant/polys/euclidtools.py index 46a5aa682b2..a84c2d2d299 100644 --- a/diofant/polys/euclidtools.py +++ b/diofant/polys/euclidtools.py @@ -194,7 +194,13 @@ def _zz_heu_gcd(self, f, g): x0 = ring.gens[0] domain = ring.domain - gcd, f, g = f.extract_ground(g) + fc = f.content() + gc = g.content() + + gcd = self.domain.gcd(fc, gc) + + f = f.quo_ground(gcd) + g = g.quo_ground(gcd) f_norm = f.max_norm() g_norm = g.max_norm() diff --git a/diofant/polys/rings.py b/diofant/polys/rings.py index 0f093fc51dc..5d326d11ba7 100644 --- a/diofant/polys/rings.py +++ b/diofant/polys/rings.py @@ -1221,18 +1221,6 @@ def trunc_ground(self, p): poly._strip_zero() return poly - def extract_ground(self, g): - f = self - fc = f.content() - gc = g.content() - - gcd = f.ring.domain.gcd(fc, gc) - - f = f.quo_ground(gcd) - g = g.quo_ground(gcd) - - return gcd, f, g - def _norm(self, norm_func): if not self: return self.ring.domain.zero