#12997: LyndonWords from composition beginning by 0's
-------------------------------------------------------+--------------------
       Reporter:  Adrien                               |         Owner:  
sage-combinat   
           Type:  defect                               |        Status:  
positive_review 
       Priority:  minor                                |     Milestone:  
sage-5.9        
      Component:  combinatorics                        |    Resolution:         
         
       Keywords:  lyndon words, sage-combinat, days45  |   Work issues:         
         
Report Upstream:  N/A                                  |     Reviewers:  Travis 
Scrimshaw
        Authors:  Adrien Brochier                      |     Merged in:         
         
   Dependencies:                                       |      Stopgaps:         
         
-------------------------------------------------------+--------------------
Changes (by chapoton):

  * status:  needs_review => positive_review


Old description:

> {{{LyndonWords}}}, when applied to a composition starting with 0's, gives
> a wrong result, e.g.:
> {{{
> for w in LyndonWords(list([0,1])):
>     print w
> }}}
> return 1 instead of 2, and in a similar vein
> {{{
> for w in LyndonWords(list([0,2])):
>     print w
> }}}
> return '12'
>
> The problem is also described here : http://groups.google.com/group/sage-
> combinat-devel/browse_thread/thread/5c4b691a692b56b0#
>
> The problem is that necklace._sfc() ignores 0's at the begining of a
> list.
>
> A modified lyndon_word.py file which fix the problem is attached.

New description:

 {{{LyndonWords}}}, when applied to a composition starting with 0's, gives
 a wrong result, e.g.:
 {{{
 for w in LyndonWords(list([0,1])):
     print w
 }}}
 return 1 instead of 2, and in a similar vein
 {{{
 for w in LyndonWords(list([0,2])):
     print w
 }}}
 return '12'

 The problem is also described here : http://groups.google.com/group/sage-
 combinat-devel/browse_thread/thread/5c4b691a692b56b0#

 The problem is that necklace._sfc() ignores 0's at the begining of a list.

 A modified lyndon_word.py file which fix the problem is attached.

 Apply:

  * [attachment:trac_12997-LyndonWords-compositions.patch]
  * [attachment:trac_12997-LyndonWords-review-ts.patch]
  * [attachment:trac_12997-Lyndon-review-fc.patch]

--

Comment:

 Ok, this looks good to me.

 I have added a patch to change the "raise" to python3 syntax

 positive review

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12997#comment:9>
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