#19737: SetPartition.to_permutation().cycle_tuples() is not the identity
-------------------------------------+-------------------------------------
       Reporter:  mantepse           |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.0
      Component:  combinatorics      |   Resolution:
       Keywords:  set partitions,    |    Merged in:
  permutations                       |    Reviewers:
        Authors:  Martin Rubey       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  26169d76d77d69d32ef5b7dc75d7f5faad8ee909
  u/mantepse/setpartition_to_permutation___cycle_tuples___is_not_the_identity|  
   Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by mantepse):

 Replying to [comment:9 dimpase]:
 > {{{
 > sage: s=SetPartition([[0,1,2],[3,4]])
 > sage: s.to_permutation()
 >
 ---------------------------------------------------------------------------
 > ValueError                                Traceback (most recent call
 last)
 > ...
 > ValueError: All elements should be strictly positive integers, and I
 just found a negative one.
 > }}}
 >
 > even 0 is negative in this code...

 Please open another ticket for this, since it is a problem with the
 Permutation code:
 {{{
 sage: Permutation(((0,1),))
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 <ipython-input-22-0bc8d0916c3c> in <module>()
 ----> 1 Permutation(((Integer(0),Integer(1)),))

 /home/martin/sage-master/src/sage/misc/classcall_metaclass.pyx in
 sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (/home/martin
 /sage-master/src/build/cythonized/sage/misc/classcall_metaclass.c:1239)()
     324         """
     325         if cls.classcall is not None:
 --> 326             return cls.classcall(cls, *args, **kwds)
     327         else:
     328             # Fast version of type.__call__(cls, *args, **kwds)

 /home/martin/sage-master/local/lib/python2.7/site-
 packages/sage/combinat/permutation.pyc in __classcall_private__(cls, l,
 check_input)
     530                 if isinstance(l[0], tuple):
     531                     n = max(max(x) for x in l)
 --> 532                     return from_cycles(n, [list(x) for x in l])
     533                 else:
     534                     n = max(l)

 /home/martin/sage-master/local/lib/python2.7/site-
 packages/sage/combinat/permutation.pyc in from_cycles(n, cycles, parent)
    6652     # Only positive elements
    6653     if int(flattened_and_sorted[0]) < 1:
 -> 6654         raise ValueError("All elements should be strictly positive
 "
    6655                          "integers, and I just found a negative
 one.")
    6656

 ValueError: All elements should be strictly positive integers, and I just
 found a negative one.

 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/19737#comment:11>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to