Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

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

563477 views
1
/****************************************************************************
2
**
3
*A delete_tables.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 "pcp_vars.h"
12
13
/* subroutine to delete all word and subgroup tables
14
entries, depending upon the value of type;
15
if type = 1 delete only the word table entries;
16
if type = 2, delete only the subgroup table entries;
17
if type = 0, delete both */
18
19
void delete_tables(int type, struct pcp_vars *pcp)
20
{
21
register int *y = y_address;
22
23
register int i;
24
register int j;
25
register int n;
26
register int p1;
27
register int nsubgp = pcp->nsubgp;
28
register int address;
29
30
/* delete all entries (pointers) in the words table */
31
if (type != 2) {
32
if ((n = pcp->nwords) != 0) {
33
address = pcp->words;
34
for (i = 1; i <= n; i++)
35
if ((p1 = -y[address + i]) != 0)
36
y[p1] = 0;
37
38
/* shift up the subgroup table, if it exists */
39
if (type && pcp->nsubgp) {
40
j = pcp->structure + 1;
41
for (i = 1; i <= nsubgp; i++, j--) {
42
p1 = y[j - n];
43
y[j] = p1;
44
if (p1 != 0)
45
y[-p1] = j;
46
}
47
pcp->subgrp = j - 1;
48
pcp->submlg = pcp->subgrp - pcp->lastg;
49
}
50
pcp->words = pcp->structure;
51
pcp->nwords = 0;
52
}
53
}
54
55
/* delete all entries (pointers) in the subgroup table */
56
if (type != 1) {
57
address = pcp->subgrp;
58
for (i = 1; i <= nsubgp; i++) {
59
if ((p1 = -y[address + i]) != 0) {
60
y[address + i] = 0;
61
y[p1] = 0;
62
}
63
}
64
pcp->nsubgp = 0;
65
pcp->subgrp = pcp->words;
66
pcp->submlg = pcp->subgrp - pcp->lastg;
67
}
68
}
69
70