#6571: [with patch, needs review] Improve iterator of word morphisms
---------------------------+------------------------------------------------
 Reporter:  slabbe         |       Owner:  slabbe         
     Type:  enhancement    |      Status:  assigned       
 Priority:  major          |   Milestone:  sage-4.1.2     
Component:  combinatorics  |    Keywords:  words morphisms
 Reviewer:                 |      Author:  Sébastien Labbé
   Merged:                 |  
---------------------------+------------------------------------------------

Comment(by saliola):

 I made a few changes:

  1. As written, the iter_morphisms method is recursive if it is iterating
 through all morphisms (it calls {{{self.iter_morphisms(composition)}}} for
 all compositions). This is not necessary and it is inefficient. I changed
 the code to avoid doing this.

  2. Switched from {{{Compositions}}} to {{{IntegerListsLex}}} instead: the
 patch converted compositions spit out by {{{Compositions}}} to lists; so I
 changed it because compositions are created from the lists output by
 {{{IntegerListsLex}}}.

  3. {{{IntegerListsLex}}} allows one to specify {{{min_part}}}, so I added
 a {{{min_length}}} keyword option (so erasing morphisms can be obtained by
 taking {{{min_length=0}}}). The default is 1 (the current behaviour).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6571#comment:7>
Sage <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to