Date: Wednesday, January 4, 2023 @ 16:10:08
  Author: arojas
Revision: 1375140

upgpkg: sagemath 9.7-5: Fixed patch for singular

Modified:
  sagemath/trunk/PKGBUILD
  sagemath/trunk/sagemath-singular-4.3.1.p3.patch

----------------------------------+
 PKGBUILD                         |    4 
 sagemath-singular-4.3.1.p3.patch |  170 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 170 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-01-04 15:42:52 UTC (rev 1375139)
+++ PKGBUILD    2023-01-04 16:10:08 UTC (rev 1375140)
@@ -7,7 +7,7 @@
 
 pkgname=sagemath
 pkgver=9.7
-pkgrel=4
+pkgrel=5
 pkgdesc='Open Source Mathematics Software, free alternative to Magma, Maple, 
Mathematica, and Matlab'
 arch=(x86_64)
 url='http://www.sagemath.org'
@@ -75,7 +75,7 @@
             'bdf56f85b608da12074780271ae134b02a03278f7b53a183f6dd97d8d72073e0'
             '56a83abecf2ff5a500442adc7a50abbb70006037dd39c39dcdb04b3ca9fb51e2'
             '8930fcfc0ec8dc2c49c7bc1e853dbc33d8bf8fc0508f22f28980858b7264048f'
-            '66e363c15580aa6102e10e50ce249e91ff5d5d27c0b89c1a71edf11da3607d6f')
+            'c2685c8a1fb272eef58f830897fda9e6f6671fde1ced59cc55bd5cddb2da7b19')
 
 prepare(){
   cd sage-$pkgver

Modified: sagemath-singular-4.3.1.p3.patch
===================================================================
--- sagemath-singular-4.3.1.p3.patch    2023-01-04 15:42:52 UTC (rev 1375139)
+++ sagemath-singular-4.3.1.p3.patch    2023-01-04 16:10:08 UTC (rev 1375140)
@@ -1,3 +1,23 @@
+diff --git a/build/pkgs/singular/checksums.ini 
b/build/pkgs/singular/checksums.ini
+index 2e33a405d3..313463d2fe 100644
+--- a/build/pkgs/singular/checksums.ini
++++ b/build/pkgs/singular/checksums.ini
+@@ -1,5 +1,5 @@
+ tarball=singular-VERSION.tar.gz
+-sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
+-md5=abb1e37c794472e7760655358ab66054
+-cksum=17455733
++sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
++md5=fc0a4f5720dadba45a52ee94324ce00c
++cksum=1573851737
+ 
upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
+diff --git a/build/pkgs/singular/package-version.txt 
b/build/pkgs/singular/package-version.txt
+index 11300c77e7..66e2bede53 100644
+--- a/build/pkgs/singular/package-version.txt
++++ b/build/pkgs/singular/package-version.txt
+@@ -1 +1 @@
+-4.3.1p1
++4.3.1p3
 diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
 index 8e3ac314b6..747a6b1e2f 100644
 --- a/src/sage/libs/singular/decl.pxd
@@ -11,8 +31,51 @@
  
      # deep copy p
  
+diff --git a/src/sage/libs/singular/singular.pyx 
b/src/sage/libs/singular/singular.pyx
+index d8ea7b07f3..368ee09d50 100644
+--- a/src/sage/libs/singular/singular.pyx
++++ b/src/sage/libs/singular/singular.pyx
+@@ -1726,20 +1726,17 @@ cdef int overflow_check(unsigned long e, ring *_ring) 
except -1:
+ 
+     Whether an overflow occurs or not partially depends
+     on the number of variables in the ring. See trac ticket
+-    :trac:`11856`. With Singular 4, it is by default optimized
+-    for at least 4 variables on 64-bit and 2 variables on 32-bit,
+-    which in both cases makes a maximal default exponent of
+-    2^16-1.
++    :trac:`11856`.
+ 
+     EXAMPLES::
+ 
+         sage: P.<x,y> = QQ[]
+-        sage: y^(2^16-1)
+-        y^65535
+-        sage: y^2^16
++        sage: y^(2^30)
++        y^1073741824
++        sage: y^2^32
+         Traceback (most recent call last):
+         ...
+-        OverflowError: exponent overflow (65536)
++        OverflowError: exponent overflow (4294967296)
+     """
+     if unlikely(e > _ring.bitmask):
+         raise OverflowError("exponent overflow (%d)"%(e))
+diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py 
b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+index 7dc058a22f..71494eddbc 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -60,7 +60,7 @@ We compute in a quotient of a polynomial ring over 
`\ZZ/17\ZZ`::
+ Note that the result of a computation is not necessarily reduced::
+ 
+     sage: (a+b)^17
+-    256*a*b^16 + 256*b^17
++    a*b^16 + b^17
+     sage: S(17) == 0
+     True
+ 
 diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx 
b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index 4dad016b33..1dc8950434 100644
+index 4dad016b33..1003c45d97 100644
 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
 +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
 @@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
@@ -24,12 +87,115 @@
      pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
      pDiff, singclap_resultant, p_Normalize,
      prCopyR, prCopyR_NoSort)
+@@ -1587,7 +1587,7 @@ cdef class 
MPolynomialRing_libsingular(MPolynomialRing_base):
+             9/4
+ 
+             sage: P.monomial_quotient(x,y) # Note the wrong result
+-            x*y^65535*z^65535
++            x*y^1048575*z^1048575
+ 
+             sage: P.monomial_quotient(x,P(1))
+             x
+@@ -2247,7 +2247,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
+             9/4*x^2 - 1/4*y^2 - y - 1
+ 
+             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
+-            sage: (x^2^15) * x^2^15
++            sage: (x^2^32) * x^2^32
+             Traceback (most recent call last):
+             ...
+             OverflowError: exponent overflow (...)
+@@ -2371,7 +2371,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
+             ValueError: not a 2nd power
+ 
+             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
+-            sage: (x+y^2^15)^10
++            sage: (x+y^2^32)^10
+             Traceback (most recent call last):
+             ....
+             OverflowError: exponent overflow (...)
+@@ -3452,16 +3452,16 @@ cdef class MPolynomial_libsingular(MPolynomial):
+         We are catching overflows::
+ 
+             sage: R.<x,y> = QQ[]
+-            sage: n=100; f = x^n
++            sage: n=10000; f = x^n
+             sage: try:
+             ....:     f.subs(x = x^n)
+             ....:     print("no overflow")
+             ....: except OverflowError:
+             ....:     print("overflow")
+-            x^10000
++            x^100000000
+             no overflow
+ 
+-            sage: n = 1000
++            sage: n = 100000
+             sage: try:
+             ....:     f = x^n
+             ....:     f.subs(x = x^n)
 @@ -4567,7 +4567,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
          l = []
          for i from 0 <= i < IDELEMS(res):
              for j from 1 <= j <= IDELEMS(_I):
 -                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
-+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], j)) )
++                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
  
          id_Delete(&fI, r)
          id_Delete(&_I, r)
+@@ -4635,7 +4635,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
+ 
+             sage: f = 3*x
+             sage: f.reduce([2*x,y])
+-            3*x
++            x
+ 
+         The reduction is not canonical when ``I`` is not a Groebner
+         basis::
+diff --git a/src/sage/rings/polynomial/plural.pyx 
b/src/sage/rings/polynomial/plural.pyx
+index 1c9f35e56b..587511c388 100644
+--- a/src/sage/rings/polynomial/plural.pyx
++++ b/src/sage/rings/polynomial/plural.pyx
+@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
+             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
+             sage: P.inject_variables()
+             Defining x, z, y
+-            sage: (x^2^15) * x^2^15
++            sage: (x^2^31) * x^2^31
+             Traceback (most recent call last):
+             ...
+-            OverflowError: exponent overflow (65536)
++            OverflowError: exponent overflow (2147483648)
+         """
+         # all currently implemented rings are commutative
+         cdef poly *_p
+@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
+             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
+             sage: P.inject_variables()
+             Defining x, z, y
+-            sage: (x+y^2^15)^10
++            sage: (x+y^2^31)^10
+             Traceback (most recent call last):
+             ....
+-            OverflowError: exponent overflow (327680)
++            OverflowError: exponent overflow (2147483648)
+         """
+         if type(exp) is not Integer:
+             try:
+diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
+index b5d83ef71b..f1dc37cad0 100644
+--- a/src/sage/structure/element.pyx
++++ b/src/sage/structure/element.pyx
+@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
+         with Singular 4::
+ 
+             sage: K.<x,y> = ZZ[]
+-            sage: (x^12345)^54321
++            sage: (x^123456)^654321
+             Traceback (most recent call last):
+             ...
+-            OverflowError: exponent overflow (670592745)
++            OverflowError: exponent overflow (80779853376)
+         """
+         return arith_generic_power(self, n)
+ 

Reply via email to