Opened 3 years ago

Last modified 3 years ago

#21619 new defect

follow-up for upgrade to Singular 4: reuse ZZ and QQ

Reported by: jakobkroeker Owned by:
Priority: major Milestone: sage-7.4
Component: packages: standard Keywords: Singular upgrade
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #17254 Stopgaps:

Description

Two issues I could not solve due to lack of expertise in sage:

-reuse a plain polynomial ring over ZZ and

-reuse Singular polynomial ring over QQ

instead of creating a new one every time,

see

src/sage/libs/singular/singular.pyx

snip

        # if I understand nrnMapGMP/nMapFuncPtr correctly we need first
+        # a source value in ZZr
+        # create ZZr, a plain polynomial ring over ZZ with one variable.
+        #
+        # todo (later): reuse ZZr
+        _name = omStrDup(varname)
+        _ext_names = <char**>omAlloc0(sizeof(char*))
+        _ext_names[0] = omStrDup(_name)
+        _cf = nInitChar( n_Z, NULL) # integer coefficient ring
+        ZZr = rDefault (_cf ,1, _ext_names)
+        rComplete(ZZr,1)
+    # the result of nlInit2gmp() is in a plain polynomial ring over QQ (not an extension ring!),
+    # so we hace to get/create one :
+    #
+    # todo: reuse qqr/ get an existing Singular polynomial ring over Q.
+    varname = "a"
+    _name = omStrDup(varname)
+    cdef char **_ext_names
+    _ext_names = <char**>omAlloc0(sizeof(char*))
+    _ext_names[0] = omStrDup(_name)
+    qqr = rDefault( 0, 1, _ext_names);
+    rComplete(qqr,1)
+    qqr.ShortOut = 0}}}

Change History (2)

comment:1 Changed 3 years ago by jakobkroeker

  • Dependencies changed from 17254 to #17254

comment:2 Changed 3 years ago by jakobkroeker

  • Keywords Singular upgrade added
  • Type changed from PLEASE CHANGE to defect
Note: See TracTickets for help on using tickets.