Hellooooooo guys.

Here's how you can get an infinite loop in two lines with Permutation.

sage: p =
Permutation([(1,10,11,13,9,3,16,0,22),(8,2,15,18,24,26,20,21,4),(5,6,17,12,25,7,23,14,19)])
sage: p.to_cycles()

Of course it has to be because my permutation goes from 0 to n-1 while the
code expects 1-n.

It is all very nice. Now, if the code does not work, we should just refuse
to build the corresponding permutations, and say it only works with
integers. Otherwise it has to be fixed quicjky or all this code is totally
useless.

By the way : is there any r&%$&$&$&%$ reason why Permutations (with a
terminal s) does not contain Permutation object but LISTS ?

sage: list(Permutations(["a","b","c"]))
[['a', 'b', 'c'], ['a', 'c', 'b'], ['b', 'a', 'c'], ['b', 'c', 'a'], ['c',
'a', 'b'], ['c', 'b', 'a']]
sage: map(type,list(Permutations(["a","b","c"])))
[<type 'list'>, <type 'list'>, <type 'list'>, <type 'list'>, <type 'list'>,
<type 'list'>]

I know, it would be slower otherwise. But it is bad code. This kind of
things should be done with an optional flag if you need it.

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to