SG::Perm2ListInv
--
calculates the set of inversions of a permutation
SG::Perm2ListInv(perm)
perm | - | any list denoting a permutation |
The SG::Perm2ListInv
function calculates the list of all inversions of a
permutation. The result is in lexicographic ordering.
The set of inversions is a set of pairs of positions (i,j) such
that i<j and
perm
[j]<perm
[i].
>> muEC::SG::Perm2ListInv( [4,1,3,2] );
[{1, 2}, {1, 3}, {1, 4}, {3, 4}]
MuPAD Combinat, an open source algebraic combinatorics package