#8392: Check when defining a permutation by one-line notation (list of int)
----------------------------------------------+-----------------------------
Reporter: nborie | Owner: nborie
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.0
Component: combinatorics | Resolution:
Keywords: permutation, check, assert | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
----------------------------------------------+-----------------------------
Comment (by nthiery):
The current patch breaks integer vectors; it would need to further fix
WeightedIntegerVectors to not abuse anymore Permutation with multiple
entries.
{{{
sage: WeightedIntegerVectors(8, [1,1,2]).list()
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "/opt/sage-5.0.rc0/local/lib/python2.7/site-
packages/sage/categories/finite_enumerated_sets.py", line 308, in list
self._list = self._list_from_iterator()
File "/opt/sage-5.0.rc0/local/lib/python2.7/site-
packages/sage/categories/finite_enumerated_sets.py", line 142, in
_list_from_iterator
return [x for x in self]
File "/opt/sage-5.0.rc0/local/lib/python2.7/site-
packages/sage/combinat/integer_vector_weighted.py", line 259, in __iter__
yield perm._left_to_right_multiply_on_right(Permutation_class(x))
File "/opt/sage-5.0.rc0/local/lib/python2.7/site-
packages/sage/combinat/permutation.py", line 910, in
_left_to_right_multiply_on_right
#Pad the permutations if they are of
File "/opt/sage-5.0.rc0/local/lib/python2.7/site-
packages/sage/combinat/permutation.py", line 286, in Permutation
if n != len(l) or sorted(l) != range(1,n+1):
ValueError: the list l (=[0, 0, 4]) must contain each integer of {1,...,n}
one time
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8392#comment:3>
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.