diff options
author | Antonio Rojas | 2022-01-09 13:57:44 +0100 |
---|---|---|
committer | Antonio Rojas | 2022-01-09 13:57:44 +0100 |
commit | 210622d5c0b61b7b076e647d979faddf8b11fb28 (patch) | |
tree | d6a2812aac5ec94958264dfc4d6f8057d4b83ab3 | |
parent | b4d7c1ca04f9c7d1de599f451d5c0ec75db2461f (diff) | |
download | aur-210622d5c0b61b7b076e647d979faddf8b11fb28.tar.gz |
Drop merged patches
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 12 | ||||
-rw-r--r-- | sagemath-lrcalc2.patch | 6 | ||||
-rw-r--r-- | sagemath-python3.10.patch | 136 | ||||
-rw-r--r-- | sagemath-singular-4.2.1.p1.patch | 352 |
5 files changed, 7 insertions, 507 deletions
@@ -1,6 +1,6 @@ pkgbase = sagemath-git pkgdesc = Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab - pkgver = 9.5.beta9.r0.gc5af19568c + pkgver = 9.5.rc0.r0.g38323507f6 pkgrel = 1 url = http://www.sagemath.org arch = x86_64 @@ -101,18 +101,14 @@ pkgbase = sagemath-git source = latte-count.patch source = test-optional.patch source = sagemath-lrcalc2.patch - source = sagemath-singular-4.2.1.p1.patch source = sagemath-linbox-1.7.patch - source = sagemath-python3.10.patch source = sagemath-bliss-0.77.patch sha256sums = SKIP sha256sums = eee5fa15d8c7be7e009166dbde3ea24bb10d7793dc12880516f278f86b1a6694 sha256sums = 2f310081357996b7d3bf813e63d07c0fc04d6724adbfbd1beeb554e9476e2e4c sha256sums = d1310321bf07491658e83087a6ddb0011738fa17a1dc3275d6d5c6907eaf3df8 - sha256sums = 8534700f78690a9f1b07df25b281138ed870fdfb70ab4df3818df79d5468ec9f - sha256sums = 1f0c44a4998ed239a3d77e3028b98b6f2c28a95e9bb4b8557523cc8f12ffba34 + sha256sums = c8a1fb98f454dfd52101373e478e396d83a7d55c2c658b1d246a86603cbb15e8 sha256sums = eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3 - sha256sums = b9ca4fb0e3083e73560df5f0aca7e87d7aa8c05eca3eea49c704bcee102919c7 sha256sums = 49ede468b8e1e7b8d7a390aab9ff1a6e899a0c5e487632cbf76902d80c637505 pkgname = sagemath-git @@ -6,7 +6,7 @@ # Contributor: Stefan Husmann <stefan-husmann at t-online dot de> pkgname=sagemath-git -pkgver=9.5.beta9.r0.gc5af19568c +pkgver=9.5.rc0.r0.g38323507f6 pkgrel=1 pkgdesc='Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab' arch=(x86_64) @@ -55,18 +55,14 @@ source=(git://git.sagemath.org/sage.git#branch=develop latte-count.patch test-optional.patch sagemath-lrcalc2.patch - sagemath-singular-4.2.1.p1.patch sagemath-linbox-1.7.patch - sagemath-python3.10.patch sagemath-bliss-0.77.patch) sha256sums=('SKIP' 'eee5fa15d8c7be7e009166dbde3ea24bb10d7793dc12880516f278f86b1a6694' '2f310081357996b7d3bf813e63d07c0fc04d6724adbfbd1beeb554e9476e2e4c' 'd1310321bf07491658e83087a6ddb0011738fa17a1dc3275d6d5c6907eaf3df8' - '8534700f78690a9f1b07df25b281138ed870fdfb70ab4df3818df79d5468ec9f' - '1f0c44a4998ed239a3d77e3028b98b6f2c28a95e9bb4b8557523cc8f12ffba34' + 'c8a1fb98f454dfd52101373e478e396d83a7d55c2c658b1d246a86603cbb15e8' 'eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3' - 'b9ca4fb0e3083e73560df5f0aca7e87d7aa8c05eca3eea49c704bcee102919c7' '49ede468b8e1e7b8d7a390aab9ff1a6e899a0c5e487632cbf76902d80c637505') pkgver() { @@ -80,12 +76,8 @@ prepare(){ # Upstream patches # Replace lrcalc.pyx with a wrapper over lrcalc's python bindings https://trac.sagemath.org/ticket/31355 patch -p1 -i ../sagemath-lrcalc2.patch -# Fix build with singular 4.2.1.p1 https://trac.sagemath.org/ticket/32907 - patch -p1 -i ../sagemath-singular-4.2.1.p1.patch # Fix build with linbox 1.7 https://trac.sagemath.org/ticket/32959 patch -p1 -i ../sagemath-linbox-1.7.patch -# Fix tests with Python 3.10 https://trac.sagemath.org/ticket/30766 - patch -p1 -i ../sagemath-python3.10.patch # Fix build with bliss 0.77 https://trac.sagemath.org/ticket/33010 patch -p1 -i ../sagemath-bliss-0.77.patch diff --git a/sagemath-lrcalc2.patch b/sagemath-lrcalc2.patch index 48fb8fc44a8b..47e06450608d 100644 --- a/sagemath-lrcalc2.patch +++ b/sagemath-lrcalc2.patch @@ -227,12 +227,12 @@ index 0000000000..a6a7b9cd72 @@ -0,0 +1 @@ +standard diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies -index 1ba845c8f2..cb57fe3859 100644 +index 9c7797b1f4..3369d4d905 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ --FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) ratpoints rw sage_conf singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup -+FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) ratpoints rw sage_conf singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup +-FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) ratpoints requests rw sage_conf singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup ++FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml jinja2 jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) ratpoints requests rw sage_conf singular symmetrica zn_poly $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup ---------- All lines of this file are ignored except the first. diff --git a/sagemath-python3.10.patch b/sagemath-python3.10.patch deleted file mode 100644 index d05c8c56fbe7..000000000000 --- a/sagemath-python3.10.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff --git a/src/sage/cpython/atexit.pyx b/src/sage/cpython/atexit.pyx -index 5b0c6d1..3ba391b 100644 ---- a/src/sage/cpython/atexit.pyx -+++ b/src/sage/cpython/atexit.pyx -@@ -144,43 +144,63 @@ cdef class restore_atexit: - - from cpython.ref cimport PyObject - --# Internal structures defined in the CPython source in --# Modules/atexitmodule.c and subject to (but unlikely to) change. Watch --# https://bugs.python.org/issue32082 for a request to (eventually) --# re-expose more of the atexit module's internals to Python --ctypedef struct atexit_callback: -- PyObject* func -- PyObject* args -- PyObject* kwargs -- -- --ctypedef struct atexitmodule_state: -- atexit_callback** atexit_callbacks -- int ncallbacks -- int callback_len -- -- --cdef extern from "Python.h": -- void* PyModule_GetState(object module) -- -+# Implement "_atexit_callbacks()" for each supported python version -+cdef extern from *: -+ """ -+ #if PY_VERSION_HEX >= 0x030a0000 -+ /********** Python 3.10 **********/ -+ #define Py_BUILD_CORE -+ #undef _PyGC_FINALIZED -+ #include "internal/pycore_interp.h" -+ #include "internal/pycore_pystate.h" -+ static atexit_callback ** _atexit_callbacks(PyObject *self) { -+ PyInterpreterState *interp = _PyInterpreterState_GET(); -+ struct atexit_state state = interp->atexit; -+ return state.callbacks; -+ } -+ #else -+ /********** Python < 3.10 **********/ -+ /* Internal structures defined in the CPython source in -+ * Modules/atexitmodule.c and subject to (but unlikely to) change. Watch -+ * https://bugs.python.org/issue32082 for a request to (eventually) -+ * re-expose more of the atexit module's internals to Python -+ * typedef struct -+ */ -+ typedef struct { -+ PyObject *func; -+ PyObject *args; -+ PyObject *kwargs; -+ } atexit_callback; -+ typedef struct { -+ atexit_callback **atexit_callbacks; -+ int ncallbacks; -+ int callback_len; -+ } atexitmodule_state; -+ static atexit_callback ** _atexit_callbacks(PyObject *self) { -+ atexitmodule_state *state = PyModule_GetState(self); -+ return state->atexit_callbacks; -+ } -+ #endif -+ """ -+ ctypedef struct atexit_callback: -+ PyObject* func -+ PyObject* args -+ PyObject* kwargs -+ atexit_callback** _atexit_callbacks(object module) - - def _get_exithandlers(): - """Return list of exit handlers registered with the atexit module.""" -- cdef atexitmodule_state* state -+ cdef atexit_callback ** callbacks - cdef atexit_callback callback - cdef list exithandlers - cdef int idx - cdef object kwargs - -- state = <atexitmodule_state*>PyModule_GetState(atexit) -- -- if not state: -- raise RuntimeError("atexit module state missing or corrupt") -- - exithandlers = [] -+ callbacks = _atexit_callbacks(atexit) - -- for idx in range(state.ncallbacks): -- callback = state.atexit_callbacks[idx][0] -+ for idx in range(atexit._ncallbacks()): -+ callback = callbacks[idx][0] - if callback.kwargs: - kwargs = <object>callback.kwargs - else: -@@ -207,4 +227,5 @@ def _set_exithandlers(exithandlers): - - def _clear_exithandlers(): - """Clear the atexit module of all registered exit handlers.""" -+ - atexit._clear() -diff --git a/src/sage_docbuild/utils.py b/src/sage_docbuild/utils.py -index 956d703f..3e4793e 100644 ---- a/src/sage_docbuild/utils.py -+++ b/src/sage_docbuild/utils.py -@@ -79,7 +79,7 @@ def build_many(target, args, processes=None): - ....: # Task 4 is a poison pill - ....: 1 / 0 - ....: else: -- ....: time.sleep(0.5) -+ ....: time.sleep(float(0.5)) - ....: print('Processed task %s' % N) - ....: - -@@ -104,7 +104,7 @@ def build_many(target, args, processes=None): - ....: # Task 4 is a poison pill - ....: os.kill(os.getpid(), signal.SIGKILL) - ....: else: -- ....: time.sleep(0.5) -+ ....: time.sleep(float(0.5)) - ....: print('Processed task %s' % N) - ....: - sage: build_many(target, range(8), processes=8) -diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 -index 5c866c8..d2012aa 100644 ---- a/src/setup.cfg.m4 -+++ b/src/setup.cfg.m4 -@@ -26,7 +26,7 @@ classifiers = - Topic :: Scientific/Engineering :: Mathematics - - [options] --python_requires = >=3.7, <3.10 -+python_requires = >=3.7, <3.11 - install_requires = - sage_conf - esyscmd(`sage-get-system-packages install-requires \ diff --git a/sagemath-singular-4.2.1.p1.patch b/sagemath-singular-4.2.1.p1.patch deleted file mode 100644 index a16e2930f0d6..000000000000 --- a/sagemath-singular-4.2.1.p1.patch +++ /dev/null @@ -1,352 +0,0 @@ -diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd -index 997cb63..d5cf044 100644 ---- a/src/sage/libs/singular/decl.pxd -+++ b/src/sage/libs/singular/decl.pxd -@@ -748,21 +748,21 @@ cdef extern from "singular/Singular/libsingular.h": - - # general number constructor - -- number *n_Init(int n, ring *r) -+ number *n_Init(int n, n_Procs_s *cf) - - # general number destructor - -- void n_Delete(number **n, ring *r) -+ void n_Delete(number **n, n_Procs_s *cf) - - # Copy this number -- number *n_Copy(number *n, ring* r) -+ number *n_Copy(number *n, n_Procs_s *cf) - - # Invert this number - int n_IsUnit(number *n, const n_Procs_s *cf) - number *n_Invers(number *n, const n_Procs_s *cf) - - # Characteristic of coefficient domain -- int n_GetChar(const ring* r) -+ int n_GetChar(const n_Procs_s *cf) - - # rational number from int - -diff --git a/src/sage/libs/singular/polynomial.pyx b/src/sage/libs/singular/polynomial.pyx -index f6d244e..1b881e2 100644 ---- a/src/sage/libs/singular/polynomial.pyx -+++ b/src/sage/libs/singular/polynomial.pyx -@@ -132,7 +132,7 @@ cdef int singular_polynomial_rmul(poly **ret, poly *p, RingElement n, ring *r): - rChangeCurrRing(r) - cdef number *_n = sa2si(n, r) - ret[0] = pp_Mult_nn(p, _n, r) -- n_Delete(&_n, r) -+ n_Delete(&_n, r.cf) - return 0 - - cdef int singular_polynomial_call(poly **ret, poly *p, ring *r, list args, poly *(*get_element)(object)): -@@ -277,7 +277,7 @@ cdef int singular_polynomial_cmp(poly *p, poly *q, ring *r): - h = r.cf.cfSub(p_GetCoeff(p, r),p_GetCoeff(q, r),r.cf) - # compare coeffs - ret = -1+r.cf.cfIsZero(h,r.cf)+2*r.cf.cfGreaterZero(h, r.cf) # -1: <, 0:==, 1: > -- n_Delete(&h, r) -+ n_Delete(&h, r.cf) - p = pNext(p) - q = pNext(q) - -@@ -348,7 +348,7 @@ cdef int singular_polynomial_div_coeff(poly** ret, poly *p, poly *q, ring *r) ex - cdef number *n = p_GetCoeff(q, r) - n = r.cf.cfInvers(n,r.cf) - ret[0] = pp_Mult_nn(p, n, r) -- n_Delete(&n, r) -+ n_Delete(&n, r.cf) - sig_off() - return 0 - -diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx -index d45de78..b235b90 100644 ---- a/src/sage/libs/singular/singular.pyx -+++ b/src/sage/libs/singular/singular.pyx -@@ -1399,7 +1399,7 @@ cdef number *sa2si(Element elem, ring * _ring): - """ - cdef int i = 0 - if isinstance(elem._parent, FiniteField_prime_modn): -- return n_Init(int(elem),_ring) -+ return n_Init(int(elem),_ring.cf) - - elif isinstance(elem._parent, RationalField): - return sa2si_QQ(elem, _ring) -@@ -1420,7 +1420,7 @@ cdef number *sa2si(Element elem, ring * _ring): - return sa2si_NF(elem, _ring) - elif isinstance(elem._parent, IntegerModRing_generic): - if _ring.cf.type == n_unknown: -- return n_Init(int(elem),_ring) -+ return n_Init(int(elem),_ring.cf) - return sa2si_ZZmod(elem, _ring) - elif isinstance(elem._parent, FractionField_generic) and isinstance(elem._parent.base(), (MPolynomialRing_libsingular, PolynomialRing_field)): - if isinstance(elem._parent.base().base_ring(), RationalField): -diff --git a/src/sage/modular/modform_hecketriangle/abstract_space.py b/src/sage/modular/modform_hecketriangle/abstract_space.py -index e073fc1..ad4307e 100644 ---- a/src/sage/modular/modform_hecketriangle/abstract_space.py -+++ b/src/sage/modular/modform_hecketriangle/abstract_space.py -@@ -1161,8 +1161,8 @@ class FormsSpace_abstract(FormsRing_abstract): - - sage: MF.F_basis_pol(2) - x^13*y*d^2 - 2*x^8*y^3*d^2 + x^3*y^5*d^2 -- sage: MF.F_basis_pol(1) -- (-81*x^13*y*d + 62*x^8*y^3*d + 19*x^3*y^5*d)/(-100) -+ sage: MF.F_basis_pol(1) * 100 -+ 81*x^13*y*d - 62*x^8*y^3*d - 19*x^3*y^5*d - sage: MF.F_basis_pol(0) - (141913*x^13*y + 168974*x^8*y^3 + 9113*x^3*y^5)/320000 - -diff --git a/src/sage/modular/modform_hecketriangle/readme.py b/src/sage/modular/modform_hecketriangle/readme.py -index 29e3ab1..b005972 100644 ---- a/src/sage/modular/modform_hecketriangle/readme.py -+++ b/src/sage/modular/modform_hecketriangle/readme.py -@@ -757,8 +757,8 @@ Modular forms ring and spaces for Hecke triangle groups: - - General Eisenstein series in some arithmetic cases:: - -- sage: ModularFormsRing(n=4).EisensteinSeries(k=8) -- (-25*f_rho^4 - 9*f_i^2)/(-34) -+ sage: ModularFormsRing(n=4).EisensteinSeries(k=8) * 34 -+ 25*f_rho^4 + 9*f_i^2 - sage: ModularForms(n=3, k=12).EisensteinSeries() - 1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + O(q^5) - sage: ModularForms(n=6, k=12).EisensteinSeries() -diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py -index 7c308fd..be1c70c 100644 ---- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py -+++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py -@@ -1578,7 +1578,7 @@ class FractionWithFactoredDenominator(RingElement): - (1, [(x*y + x + y - 1, 2)]) - sage: alpha = [4, 3] - sage: decomp = F.asymptotic_decomposition(alpha); decomp -- (0, []) + (-2*r*(1/x + 1) - 1/2/x - 1/2, [(x*y + x + y - 1, 1)]) -+ (0, []) + (... - 1/2, [(x*y + x + y - 1, 1)]) - sage: F1 = decomp[1] - sage: p = {y: 1/3, x: 1/2} - sage: asy = F1.asymptotics(p, alpha, 2, verbose=True) -diff --git a/src/sage/rings/polynomial/hilbert.pyx b/src/sage/rings/polynomial/hilbert.pyx -index e33e5e4..4cd91d0 100644 ---- a/src/sage/rings/polynomial/hilbert.pyx -+++ b/src/sage/rings/polynomial/hilbert.pyx -@@ -576,13 +576,10 @@ def hilbert_poincare_series(I, grading=None): - sage: hilbert_poincare_series(J).denominator().factor() - (t - 1)^14 - -- This example exceeds the current capabilities of Singular:: -+ This example exceeded the capabilities of Singular before version 4.2.1p2:: - - sage: J.hilbert_numerator(algorithm='singular') -- Traceback (most recent call last): -- ... -- RuntimeError: error in Singular function call 'hilb': -- int overflow in hilb 1 -+ 120*t^33 - 3465*t^32 + 48180*t^31 - 429374*t^30 + 2753520*t^29 - 13522410*t^28 + 52832780*t^27 - 168384150*t^26 + 445188744*t^25 - 987193350*t^24 + 1847488500*t^23 + 1372406746*t^22 - 403422496*t^21 - 8403314*t^20 - 471656596*t^19 + 1806623746*t^18 + 752776200*t^17 + 752776200*t^16 - 1580830020*t^15 + 1673936550*t^14 - 1294246800*t^13 + 786893250*t^12 - 382391100*t^11 + 146679390*t^10 - 42299400*t^9 + 7837830*t^8 - 172260*t^7 - 468930*t^6 + 183744*t^5 - 39270*t^4 + 5060*t^3 - 330*t^2 + 1 - - """ - cdef Polynomial_integer_dense_flint HP -diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py -index 70f2138..2b6c9fb 100644 ---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py -+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py -@@ -154,7 +154,7 @@ when the system has no solutions over the rationals. - which is not 1. :: - - sage: I.groebner_basis() -- [x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + y + 26532, 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878] -+ [x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + ..., 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878] - - Now for each prime `p` dividing this integer 164878, the Groebner - basis of I modulo `p` will be non-trivial and will thus give a -diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx -index 6f884ea..dcbc2a5 100644 ---- a/src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx -+++ b/src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx -@@ -329,7 +329,7 @@ def interred_libsingular(I): - n = r.cf.cfInvers(n,r.cf) - result.m[j] = pp_Mult_nn(p, n, r) - p_Delete(&p,r) -- n_Delete(&n,r) -+ n_Delete(&n,r.cf) - - id_Delete(&i,r) - -diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx -index 5d34e62..ee90c9d 100644 ---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx -+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx -@@ -1667,7 +1667,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): - else: - raise ArithmeticError("Cannot divide these coefficients.") - else: -- p_SetCoeff0(res, n_Init(1, r), r) -+ p_SetCoeff0(res, n_Init(1, r.cf), r) - return new_MP(self, res) - - def monomial_divides(self, MPolynomial_libsingular a, MPolynomial_libsingular b): -@@ -1820,7 +1820,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): - if r is not currRing: - rChangeCurrRing(r) - flt = pMDivide(f._poly, h._poly) -- p_SetCoeff(flt, n_Init(1, r), r) -+ p_SetCoeff(flt, n_Init(1, r.cf), r) - return (new_MP(self, flt), h) - return (self._zero_element, self._zero_element) - -@@ -2900,7 +2900,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - flag = 1 - if flag == 0: - newptemp = p_LmInit(p,r) -- p_SetCoeff(newptemp,n_Copy(p_GetCoeff(p,r),r),r) -+ p_SetCoeff(newptemp,n_Copy(p_GetCoeff(p,r),r.cf),r) - for i from 0<=i<gens: - if exps[i] != -1: - p_SetExp(newptemp,i+1,0,r) -@@ -3202,7 +3202,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - t = pNext(p) - p.next = NULL - coeff = si2sa(p_GetCoeff(p, _ring), _ring, base) -- p_SetCoeff(p, n_Init(1,_ring), _ring) -+ p_SetCoeff(p, n_Init(1,_ring.cf), _ring) - p_Setm(p, _ring) - yield (coeff, new_MP(parent, p)) - p = t -@@ -3744,7 +3744,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - while p: - t = pNext(p) - p.next = NULL -- p_SetCoeff(p, n_Init(1,_ring), _ring) -+ p_SetCoeff(p, n_Init(1,_ring.cf), _ring) - p_Setm(p, _ring) - l.append( new_MP(parent,p) ) - p = t -@@ -4021,7 +4021,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - if self._poly == NULL: - return self._parent._zero_element - _p = p_Head(self._poly, _ring) -- p_SetCoeff(_p, n_Init(1,_ring), _ring) -+ p_SetCoeff(_p, n_Init(1,_ring.cf), _ring) - p_Setm(_p,_ring) - return new_MP(self._parent, _p) - -@@ -4170,7 +4170,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - elif p_IsOne(_right._poly, r): - return self - -- if n_GetChar(r) > 1<<29: -+ if n_GetChar(r.cf) > 1<<29: - raise NotImplementedError("Division of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") - - if r.cf.type != n_unknown: -@@ -4181,7 +4181,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - while p: - if p_DivisibleBy(_right._poly, p, r): - temp = p_MDivide(p, _right._poly, r) -- p_SetCoeff0(temp, n_Copy(p_GetCoeff(p, r), r), r) -+ p_SetCoeff0(temp, n_Copy(p_GetCoeff(p, r), r.cf), r) - quo = p_Add_q(quo, temp, r) - p = pNext(p) - return new_MP(parent, quo) -@@ -4486,7 +4486,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - except Exception: - raise NotImplementedError("Factorization of multivariate polynomials over %s is not implemented."%self._parent._base) - -- if n_GetChar(_ring) > 1<<29: -+ if n_GetChar(_ring.cf) > 1<<29: - raise NotImplementedError("Factorization of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") - - # I make a temporary copy of the poly in self because singclap_factorize appears to modify it's parameter -@@ -4870,7 +4870,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - if _ring.cf.type == n_Znm or _ring.cf.type == n_Zn or _ring.cf.type == n_Z2m : - raise NotImplementedError("GCD over rings not implemented.") - -- if n_GetChar(_ring) > 1<<29: -+ if n_GetChar(_ring.cf) > 1<<29: - raise NotImplementedError("GCD of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") - - cdef int count = singular_polynomial_length_bounded(self._poly,20) \ -@@ -4920,7 +4920,8 @@ cdef class MPolynomial_libsingular(MPolynomial): - - sage: Pol.<x,y,z> = ZZ[] - sage: p = -x*y + x*z + 54*x - 2 -- sage: (5*p^2).lcm(3*p) == 15*p^2 -+ sage: q = (5*p^2).lcm(3*p) -+ sage: q * q.lc().sign() == 15*p^2 - True - sage: lcm(2*x, 2*y) - 2*x*y -@@ -4943,7 +4944,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - else: - _g = <MPolynomial_libsingular>g - -- if n_GetChar(_ring) > 1<<29: -+ if n_GetChar(_ring.cf) > 1<<29: - raise NotImplementedError("LCM of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") - - cdef int count = singular_polynomial_length_bounded(self._poly,20) \ -@@ -5023,7 +5024,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - py_rem = self - right*py_quo - return py_quo, py_rem - -- if n_GetChar(r) > 1<<29: -+ if n_GetChar(r.cf) > 1<<29: - raise NotImplementedError("Division of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") - - cdef int count = singular_polynomial_length_bounded(self._poly,15) -@@ -5478,7 +5479,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - raise TypeError("second parameter needs to be an element of self.parent() or None") - - -- if n_GetChar(_ring) > 1<<29: -+ if n_GetChar(_ring.cf) > 1<<29: - raise NotImplementedError("Resultants of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.") - - if is_IntegerRing(self._parent._base): -diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx -index 972d220..8fbf375 100644 ---- a/src/sage/rings/polynomial/plural.pyx -+++ b/src/sage/rings/polynomial/plural.pyx -@@ -1081,7 +1081,7 @@ cdef class NCPolynomialRing_plural(Ring): - else: - raise ArithmeticError("Cannot divide these coefficients.") - else: -- p_SetCoeff0(res, n_Init(1, r), r) -+ p_SetCoeff0(res, n_Init(1, r.cf), r) - return new_NCP(self, res) - - def monomial_divides(self, NCPolynomial_plural a, NCPolynomial_plural b): -@@ -1269,7 +1269,7 @@ cdef class NCPolynomialRing_plural(Ring): - h = <NCPolynomial_plural>g - if p_LmDivisibleBy(h._poly, m, r): - flt = pMDivide(f._poly, h._poly) -- p_SetCoeff(flt, n_Init(1, r), r) -+ p_SetCoeff(flt, n_Init(1, r.cf), r) - return (new_NCP(self,flt), h) - return (self._zero_element, self._zero_element) - -@@ -2130,7 +2130,7 @@ cdef class NCPolynomial_plural(RingElement): - flag = 1 - if flag == 0: - newptemp = p_LmInit(p,r) -- p_SetCoeff(newptemp,n_Copy(p_GetCoeff(p,r),r),r) -+ p_SetCoeff(newptemp,n_Copy(p_GetCoeff(p,r),r.cf),r) - for i from 0<=i<gens: - if exps[i] != -1: - p_SetExp(newptemp,i+1,0,r) -@@ -2563,7 +2563,7 @@ cdef class NCPolynomial_plural(RingElement): - while p: - t = pNext(p) - p.next = NULL -- p_SetCoeff(p, n_Init(1,_ring), _ring) -+ p_SetCoeff(p, n_Init(1,_ring.cf), _ring) - p_Setm(p, _ring) - l.append( new_NCP(parent,p) ) - p = t -@@ -2668,7 +2668,7 @@ cdef class NCPolynomial_plural(RingElement): - if self._poly == NULL: - return (<NCPolynomialRing_plural>self._parent)._zero_element - _p = p_Head(self._poly, _ring) -- p_SetCoeff(_p, n_Init(1,_ring), _ring) -+ p_SetCoeff(_p, n_Init(1,_ring.cf), _ring) - p_Setm(_p,_ring) - return new_NCP((<NCPolynomialRing_plural>self._parent), _p) - |