#16935: Faster palindromes function for the Words library
-------------------------------------+-------------------------------------
       Reporter:  nadialafreniere    |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  combinatorics      |   Resolution:
       Keywords:  words, finite      |    Merged in:
  words, palindromes                 |    Reviewers:
        Authors:  Nadia Lafrenière   |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  d535b5f2f292d83d1dc952023dffe5506dd8f7f9
  
u/nadialafreniere/palindromes__list_of_lps_lengths_and_list_of_maximal_palindromes_length|
     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by nadialafreniere):

 Replying to [comment:27 slabbe]:

 I prefer the way you present the length_maximal_palindrome. I think it is
 clearer. I integrated it to the code.

 > I added a raise Value Error when the parity of m is the same as the
 parity of 2j which is an impossible case. I was surprise to realize that
 it breaks the other methods: [...]
 > This means that the impossible case is in fact used. Do you understand
 why?

 I don't know why, but I used a very complicated way to assing a value for
 `m` in the second case of `lengths_maximal_palindromes`. I changed it so
 it is easier to see what it does, and it does not use the impossible case.

 > Finally, I think the palindrome method can now be written as a one liner
 using a list comprehension...
 I changed it. Tell me what you think.

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