From: Michael Orlitzky Date: Mon, 9 Dec 2019 02:23:33 +0000 (-0500) Subject: mjo/polynomial.py: add hacks for SageMath Trac #28855. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b3645cbffe999681a590ffbafa2b2ca9766e68cd;p=sage.d.git mjo/polynomial.py: add hacks for SageMath Trac #28855. --- diff --git a/mjo/polynomial.py b/mjo/polynomial.py index 9ef2902..55ada9a 100644 --- a/mjo/polynomial.py +++ b/mjo/polynomial.py @@ -140,7 +140,8 @@ def multidiv(f, gs): sage: x,y,z = R.gens() sage: s = ZZ.random_element(1,5).abs() sage: gs = [ R.random_element() for idx in range(s) ] - sage: f = R.random_element(ZZ.random_element(10).abs()) + sage: # hack for SageMath Trac #28855 + sage: f = R(R.random_element(ZZ.random_element(10).abs())) sage: (qs, r) = multidiv(f,gs) sage: r != 0 or f in R.ideal(gs) True @@ -153,7 +154,8 @@ def multidiv(f, gs): sage: R = PolynomialRing(QQ, 'x,y,z') sage: s = ZZ.random_element(1,5).abs() sage: gs = [ R.random_element() for idx in range(s) ] - sage: f = R.random_element(ZZ.random_element(10).abs()) + sage: # hack for SageMath Trac #28855 + sage: f = R(R.random_element(ZZ.random_element(10).abs())) sage: (qs, r) = multidiv(f,gs) sage: r + sum( qs[i]*gs[i] for i in range(len(gs)) ) == f True @@ -169,7 +171,8 @@ def multidiv(f, gs): sage: R = PolynomialRing(QQ,'x,y,z') sage: gs = R.random_element().monomials() sage: I = R.ideal(gs) - sage: f = I.random_element(ZZ.random_element(5).abs()) + sage: # hack for SageMath Trac #28855 + sage: f = R(I.random_element(ZZ.random_element(5).abs())) sage: (qs, r) = multidiv(f, gs) sage: r.is_zero() True