#19084: libSingular functions' ring parameter defaults to the last used ring
-------------------------------------+-------------------------------------
       Reporter:  klee               |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.9
      Component:  interfaces         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Kwankyu Lee        |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/klee/libsingular                 |  f4d7ffc4e5499913919ec6c8efe4140b91502134
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Replying to [comment:4 klee]:
 > > A pro of your current approach is that you might avoid having to
 create a dummy ring, thus saving the slight memory penalty for it.
 > This is not true since a dummy ring is created initially.

 If the first call that arrives does have a ring parameter (the usual
 circumstance) then doesn't that ring get used? You could just leave
 `last_ring` uninitialized and only give it your dummy value if the value
 is required before `last_ring = ring` is executed. But as I discussed, I
 think there are drawbacks reusing rings of interest to the user for this
 purpose.

 Note, by the way, that we have a `currRingHdl` just above it, which also
 gets initialized to a dummy value. If we're going to keep a dummy ring
 around on sage level, we might as well make the singular dummy ring the
 matching singular ring to that sage dummy ring. That should significantly
 simplify proper reference counting of that object, if we ever figure out
 how to properly interface with singular's reference counts (we currently
 don't).

 > A pro of my approach, I think, is reusing the user's "current" ring,
 thus minimizing switching of the internal Singular (current) ring, which
 seems a good thing.

 Do we check that? In that case you might want to do some timing. Note that
 most calls will have a ring anyway, so you'll have to search hard for an
 example where it matters.

 > As I am not sure about the seriousness of the issues you raised, I will
 wait for Martin's opinion about this. If the two experts, Martin and you,
 concern about my approach, then I will adopt your suggestion.

 Yes, good plan (although I wouldn't call myself an expert on libSingular--
 I've just seen some truly horrible debugging of memory leaks around it)

--
Ticket URL: <http://trac.sagemath.org/ticket/19084#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to