#12225: Finite and lazy factorial languages
-----------------------------+----------------------------------------------
Reporter: vdelecroix | Owner: vdelecroix
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.8
Component: combinatorics | Keywords: word, factorial language,
symbolic dynamics
Work_issues: | Upstream: N/A
Reviewer: | Author: Vincent Delecroix
Merged: | Dependencies: #12224
-----------------------------+----------------------------------------------
Comment(by slabbe):
> > Nice ticket!
>
> Thanks! It now needs work!
Indeed...
> I have some patch almost ready for it. It is just an update of
suffix_trie into a prefix_suffix_trie. The data structure I used is
perhaps not optimal (many dictionnaries that points toward other
dictionnaries). It would be very nice to have a low-level implementation
as the one used in Graph as well as a sparse and a dense version
(certainly another ticket).
I once rewrote the code of suffix_tree and was able to improve timing
(something like 40%) just by choosing better data structures (dict instead
of list or vice versa). My patches does not apply anymore because of
conflicts but it is here :
http://sage.math.washington.edu/home/slabbe/patches/ (starts with
suffix_something). I did not push it any further, because I wanted instead
to rewrite suffix tree code in cython, which we did for the suffix tree.
But this construction is quadratic in the length of the (finite) word, and
I want it to be linear. So, my next step was to implement the suffix_trie
in cython, but I never did...
> Before submitting a patch, I want to fix #12224 (Use Parent/Element and
GradedEnumeratedSets for Language).
>
> I have a questions for you : do we remove suffix_trie and use this new
class instead ? (I made some timings and it seems that mine is twice
slower, which is not so good or not so bad) Anyway, if yes, it is for
another ticket.
Well, I would say not to delete it first. Just add a new implementation
beside it. And, for some time, one could choose the algorithm or
implementation. Later, we could delete the initial implementation.
{{{
sage: w.factors(algorithm="first slow python implementation")
sage: w.factors(algorithm="cython implementation")
}}}
Sébastien
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12225#comment:4>
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 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.