Barred Permutations Permutations How to build a PERMUTATIONobject How to handle PERMUTATIONobjects

How to handle PERMUTATIONobjects

The present subsection contains information on routines, which are handling PERMUTATION objects.

A routine which builds a quadratic MATRIXobject, the so-called diagram that corresponds to the permutation in question:

A routine which applies the divided difference labeled by the PERMUTATIONobject perm to the POLYNOMobject poly, giving a new POLYNOMobject res: A routine that tests whether the two PERMUTATIONobjects a and b differ only by an elementary transposition: A routine that allows to print a PERMUTATIONobject a to the file given by the file pointer fp (this works for the kind VECTOR and ZYKEL of the PERMUTATION object a): The next routine provides the Lehmer code of the permutation. Recall that the lehmercode is a bijection between the permutations and the sequences of natural numbers. Hence, if a is a PERMUTATIONobject, then b becomes a VECTOR of INTEGER objects, and if a is a VECTOR of INTEGER objects, then b becomes a PERMUTATIONobject. It is possible to enter a==b. Here is a routine that allows to construct a permutation with a given cycle-type. You enter a PARTITION object, and b becomes a PERMUTATION object, lying in the class labeled by a. It is possible to enter a == b; a must be a partition of kind VECTOR Here is an example:
Example:
#include "def.h"
#include "macro.h"
main()
{
OP a;
anfang();
a=callocobject();
scan(PARTITION,a); println(a);
m_part_perm(a,a); println(a);
freeall(a);
ende(); 
}
Here is a routine that allows you to compute the number of inversions of the PERMUTATIONobject a. The result is the INTEGERobject b. The next routine allows to apply the PERMUTATIONobject a to a POLYNOMobject b. It changes the entries of the self-part of b according to the permutation, the result becomes the POLYNOMobject c. This works for arbitrary length of a. Using the following routine you can apply the PERMUTATIONobject a to a VECTORobject b. It changes the entries of b according to the permutation, the result becomes the VECTORobject c. The length of the PERMUTATION a must be smaller or equal to the length of the VECTOR b. The following routine computes the permutation matrix. This is the matrix with 1 at the place (i,ai) and 0 elsewhere. The permutation a must be of the kind LIST. a and b may be equal. The return value is OK if no error occured.
Example:
#include "def.h"
#include "macro.h"
main()
{
OP a;
anfang();
a=callocobject();
scan(PERMUTATION,a); println(a);
perm_matrix(a,a); println(a);
freeall(a);
ende(); 
}
Now we are going to describe a routine that allows to generate at random permutations of prescribed degree: If a is an INTEGERobject, then b becomes a random permutation of the given degree a. The kind of the PERMUTATION b is VECTOR. The next routine computes a reduced decomposition of a permutation. The input is a PERMUTATIONobject perm, and the result is a VECTOR of INTEGER. The next routine computes the signum a of the permutation b. The signum a is an INTEGERobject. There is also a routine which tests the installation of PERMUTATIONobjects: We have mentioned, that there are two different kinds of PERMUTATION objects, they are called VECTOR and ZYKEL. In order to change one kind into the other, there are the following routines: The next routine is a test for vexillarity of permutations. It returns TRUE if perm is a vexillary permutation, i.e. it contains no subpermutation 2143. part becomes a partition useful for special purposes, a better method is to specify part=NULL. The following routine computes the cyclestructure of the permutation perm, the result is a PARTITIONobject part, and perm and part may be equal.
Example:
#include "def.h"
#include "macro.h"
main()
{
OP a;
anfang();
a=callocobject();
scan(INTEGER,a); println(a);
random_permutation(a,a); println(a);
zykeltyp(a,a); println(a);
freeall(a);
ende(); 
}
The following routine computes the up-down-sequence of a PERMUTATION perm, the result is a VECTOR of 1's and 0's, 1 for each up and 0 for each down. Now we add an array of general routines that can be applied to PERMUTATIONobjects, too:
comp() copy() dec() even()
einsp() fprint() fprintln() inc()
invers() last() lehmercode() length()
mult() next() objectread() objectwrite()
odd() print() println() scan()
tex()

harald.fripertinger "at" uni-graz.at, May 26, 2011

Barred Permutations Permutations How to build a PERMUTATIONobject Uni-Graz Mathematik How to handle PERMUTATIONobjects Valid HTML 4.0 Transitional Valid CSS!