[Previous] [Next] [Contents]

SG::Perm2Code -- calculates the code of a permutation

Call(s)


SG::Perm2Code(perm)

Parameters

perm- any list denoting a permutation

Introduction

The SG::Perm2Code function calculates the Lehmer code of a permutation.

Let [c1, c2, ...] be the code of perm, then ci is equal to the number of indices j>i such that perm[j]<perm[i].

Example 1

>> muEC::SG::Perm2Code( [4,1,5,2,3] );
                              [3, 0, 2, 0, 0]
>> muEC::SG::Code2Perm( % );
                              [4, 1, 5, 2, 3]

Related Functions

Code2Perm

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package