#19494: Make finite word method nb_subword_occurences_in much faster
-------------------------+-------------------------------------------------
Reporter: | Owner:
slabbe | Status: needs_work
Type: | Milestone: sage-6.10
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers: Vincent Delecroix
combinatorics | Work issues:
Keywords: | Commit:
Authors: | 65dae48833cb03071ac122b6e6bdb6ccf4b0340c
Sébastien Labbé | Stopgaps:
Report Upstream: N/A |
Branch: |
public/19494 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by slabbe):
Replying to [comment:25 vdelecroix]:
> I suggest to keep only one algorithm (now that it is right).
I agree.
> The problem did not come from `0` vs `ZZ.zero()` but from the fact that
you need the list to be sorted the other way around (I introduced a
`list.reverse()`) in my commit).
Ok, I see! The doctest was fine because 0110 is a palindrome or something?
Maybe we should change that first doctest then...
> It takes time to import inside a method, I would prefer to not do it.
But it is possible to import the module `collections` and not
`defaultdict`.
OK.
> There is an interesant thing with this simple algorithm, it actually
computes the number of occurrences of all prefixes of `u` in all prefixes
of `v`! But we currently ignore them. People might be interested in more
information... but they can also implement that by themselves.
Maybe, we can add a {{{..NOTE::}}} about it.
--
Ticket URL: <http://trac.sagemath.org/ticket/19494#comment:26>
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.