#12912: Interface to Fokko Ducloux's Coxeter 3
---------------------------------+------------------------------------------
       Reporter:  nthiery        |         Owner:  sage-combinat
           Type:  enhancement    |        Status:  needs_work   
       Priority:  major          |     Milestone:  sage-5.7     
      Component:  combinatorics  |    Resolution:               
       Keywords:  coxeter        |   Work issues:               
Report Upstream:  N/A            |     Reviewers:               
        Authors:  Mike Hansen    |     Merged in:               
   Dependencies:                 |      Stopgaps:               
---------------------------------+------------------------------------------

Comment (by nthiery):

 Replying to [comment:6 aschilling]:
 > {{{
 > sage: from sage.libs.coxeter.co
 > sage.libs.coxeter.coxeter        sage.libs.coxeter.coxeter_group
 > sage: from sage.libs.coxeter.coxeter import get_CoxGroup as CoxGroup
 > sage: W = CoxGroup(['A',1])
 > sage: W.bruhat_interval([],[])
 > [[]]
 > sage: W = CoxGroup(['A',2])
 > }}}

 Investing further,
 bruhat_interval explicitly destructs the C++ list which is defined
 earlier in this method and passed to Coxeter3's {{{interval}}} function.
 Is
 it really needed? If we comment it out, there is no more segfault.  So
 the destruction must somehow corrupt Coxeter3's internal state (though
 it's strange that the segfault occurs upon constructing a new group)

 Some evidence why it might not be needed:

 - It's a list, not a reference to a list; so c++ should destruct it at
   the end of the function, right?

 - Assignment/copy operators seem to be appropriately defined in
   Coxeter3 for CoxWord element to be put in a list and be destructed
   properly.

 - The pointcare_polynomial does very similar things but does not call
   this destructor at the end (so at least one of the two is wrong).

 - There does not seem to be a memory leak when one comments out the
   destructor, at least not after the third call:

   {{{
     sage: sage: from sage.libs.coxeter.coxeter import CoxGroup as CoxGroup
     sage: W = CoxGroup(['A',7])
     sage: w0 = WeylGroup(['A',7]).long_element().reduced_word()
     sage: sage.misc.getusage.get_memory_usage(t=None)
     sage: 911.23046875
     sage: len(W.bruhat_interval([], W(w0)))
     40320
     sage: sage: sage.misc.getusage.get_memory_usage(t=None)
     5972.0
     sage: len(W.bruhat_interval([], W(w0)))
     40320
     sage: sage.misc.getusage.get_memory_usage(t=None)
     5973.50390625
     sage: len(W.bruhat_interval([], W(w0)))
     40320
     sage: sage.misc.getusage.get_memory_usage(t=None)
     5973.50390625
     sage: len(W.bruhat_interval([], W(w0)))
     40320
     sage: sage.misc.getusage.get_memory_usage(t=None)
     5973.50390625
   }}}

   This is confirmed by looking at the processus memory usage.

 Altogether, I guess I vote for commenting out the questionable
 destructor call, and consider the issue as resolved for now. We will
 see later if any issue arises once we put Coxeter 3 to heavy use.

 Mike, what do you think?

 Cheers,
                        Nicolas

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12912#comment:8>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to