CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
/****************************************************************************
2
**
3
*A find_permutation.c ANUPQ source Eamonn O'Brien
4
**
5
*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany
6
*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia
7
**
8
*/
9
10
#include "pq_defs.h"
11
#include "pga_vars.h"
12
#include "pq_functions.h"
13
14
/* for each k, find the first permutation, d[k], which brings k into orbit */
15
16
char *find_permutation(int *b, char *c, struct pga_vars *pga)
17
{
18
register int i, j, k, l;
19
char *d;
20
21
d = allocate_char_vector(pga->Degree, 1, TRUE);
22
23
/*
24
d = (char *) calloc (pga->Degree, sizeof (char));
25
--d;
26
*/
27
28
for (i = 1; i <= pga->nmr_orbits; ++i) {
29
j = pga->rep[i];
30
/* trace the orbit with leading term j */
31
k = j;
32
l = b[j];
33
while (l != 0) {
34
d[l] = d[k] + c[k];
35
k = l;
36
l = b[l];
37
}
38
}
39
40
return d;
41
}
42
43