#17436: fix bug with leading zeros in Necklaces
------------------------------------------+------------------------
Reporter: zabrocki | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.5
Component: combinatorics | Resolution:
Keywords: necklace, Lyndon words | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
------------------------------------------+------------------------
Comment (by zabrocki):
There seem to be minor bugs that one would not necessarily pick up on
except by reading the code closely. For example:
{{{
sage: Necklaces([1,0,1]).list()[0]
[1, 3]
sage: Necklaces([1,1]).list()[0] in Necklaces([1,1])
True
sage: Necklaces([1,0,1]).list()[0] in Necklaces([1,0,1])
False
}}}
The reason is that implicitly the code is assuming that there are no zeros
in the content/evaluation vector and it checks if the value of the entries
in the necklace smaller or equal to the size of the necklace. If that
check fails it returns False.
--
Ticket URL: <http://trac.sagemath.org/ticket/17436#comment:1>
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.