#5038: [with patch, needs work] Add support for word path
-----------------------------+----------------------------------------------
Reporter: slabbe | Owner: slabbe
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-combinat
Component: combinatorics | Keywords:
Work_issues: | Author: Sebastien Labbe
Reviewer: Mike Hansen | Merged:
-----------------------------+----------------------------------------------
Comment(by saliola):
Replying to [comment:12 slabbe]:
> But since I still want to know if a wordpath is a palindrome and other
questions already implemented for words, something like below could exist
:
You need to decide whether or not a "wordpath" is a word. If it is, then
it
should inherit all the methods. A user will be totally confused if it is
supposed to be a word but doesn't behave like one.
If it is not a word, then having a {{{to_word}}} method is fine, but it
needs to return a word. In your suggestion, it returns {{{None}}} but this
is unusual since most {{{to_*}}} methods in Sage (at least in
combinatorics
code) do not modify the original object but return a new object.
Perhaps you want to work with paths instead of word paths?
> Of course I would want the {{{to_word}}} to be constant time (no copy) :
I am thinking of simply adding the {{{FiniteWord}}} class to the base
classes of {{{p}}}.
The creation of u in the following is constant time:
{{{
sage: w = Word([0,1,1,0,1,0,0,1])
sage: u = Word(w._data)
}}}
Hope this helps.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5038#comment:13>
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
-~----------~----~----~----~------~----~------~--~---