#6627: [with patch, needs review] fix lyndon and standard factorization of words
---------------------------+------------------------------------------------
Reporter: saliola | Owner: saliola
Type: defect | Status: new
Priority: major | Milestone: sage-combinat
Component: combinatorics | Keywords:
Reviewer: | Author:
Merged: |
---------------------------+------------------------------------------------
Comment(by saliola):
This new implementation is correct and also faster.
{{{
sage: sage: Word([1,2,1,3,1,2,1]).lyndon_factorization()
(1213, 12, 1)
sage: sage: Words('01')('').lyndon_factorization()
()
sage: sage: sage: Word([3,2,1]).standard_factorization()
(32, 1)
sage: sage: Words('123')('').standard_factorization()
()
}}}
I also changed the repr of the (word) Factorization class to use ','
instead of '.' because otherwise the period is confusing if you factor a
long word:
{{{
sage: WordOptions(truncate_length=10)
sage: tm = words.ThueMorseWord()
sage: tm[:100].lyndon_factorization()
(011, 01, 0011, 00101101, 0010110011..., 0010110011..., 0010110011...,
0010110011, 0)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6627#comment:1>
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
-~----------~----~----~----~------~----~------~--~---