Previous Up Next

2.10.4  Transform a cycle into permutation : cycle2perm

cycle2perm takes on cycle as argument.
cycle2perm returns the permutation of size n corresponding to the cycle given as argument, where n is choosen as small as possible (see also permu2cycles and cycles2permu).
Input :

cycle2perm([1,3,5])

Output :

[0,3,2,5,4,1]

Previous Up Next