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

Path: gap4r8 / pkg / ace-5.2 / src / al1.h
Views: 418346
1
2
/**************************************************************************
3
4
al1.h
5
Colin Ramsay ([email protected])
6
6 Dec 00
7
8
ADVANCED COSET ENUMERATOR, Version 3.001
9
10
Copyright 2000
11
Centre for Discrete Mathematics and Computing,
12
Department of Mathematics and
13
Department of Computer Science & Electrical Engineering,
14
The University of Queensland, QLD 4072.
15
(http://staff.itee.uq.edu.au/havas)
16
17
This is the header file for Level 1 of ACE; that is, a set of basic
18
wrapper routines round the core enumerator. This can also be thought of as
19
a simple interface between application programmes (eg, ACE Level 2) and the
20
clever bits.
21
22
**************************************************************************/
23
24
#include "al0.h"
25
26
#define LLL 75 /* Approx limit on output line length */
27
28
/******************************************************************
29
The memory for the coset table is currently allocated as one
30
contiguous block. This is done by the user; Level 1 expects to be
31
`handed' the workspace for the table, pointed to by costable.
32
DEFWORK should be used as the default number of words (i.e.,
33
entries) in toto. The size is indicated via a size/multiplier
34
combination (workspace/workmult). The usual K/M/G multipliers are
35
used, with a choice of meanings to suit computer scientists, or
36
engineers, or mathematicians. The default (under pressure) is to
37
use powers of 10. While coset numbers are limited to 2G, table
38
sizes can exceed the 32-bit limit. tabsiz indicates the maximum
39
number of rows which can (safely) be fitted into the allocated
40
space (depends on ncol); if this works out to less than 2, the
41
_start() function will complain.
42
******************************************************************/
43
44
#define DEFWORK 1000000
45
46
#ifdef AL1_BINARY
47
# define KILO 1024
48
# define MEGA 1048576
49
# define GIGA 1073741824
50
#else
51
# define KILO 1000
52
# define MEGA 1000000
53
# define GIGA 1000000000
54
#endif
55
56
extern int workspace, workmult, *costable;
57
extern int tabsiz;
58
59
/******************************************************************
60
The group relations and subgroup generators are stored as linked
61
lists. Each item on the list consists of an array of generators
62
(i.e., the word), along with its total length, its exponent &
63
whether or not it was enter as x^2 (ie, as an involn). In the
64
words, -ve numbers represent inverses. The word starts at word[1].
65
Each list has a header containing the list's length and head/tail
66
pointers.
67
******************************************************************/
68
69
typedef struct Wlelt
70
{
71
int *word; /* array of generators */
72
int len, exp; /* total length, and exponent */
73
Logic invol; /* ?entered as an involution */
74
struct Wlelt *next; /* next in list */
75
}
76
Wlelt; /* word list element */
77
78
typedef struct
79
{
80
int len; /* list length */
81
Wlelt *first, *last; /* head & tail of list */
82
}
83
Wlist; /* word list */
84
85
/******************************************************************
86
We find coset rep's by backtracing the table. currrep is the
87
currently active rep've, repsiz is its size & repsp is the space
88
allocated to currrep. Note that the rep is in terms of columns!
89
******************************************************************/
90
91
extern int *currrep, repsiz, repsp;
92
93
/******************************************************************
94
Logic control variables for current enumeration.
95
******************************************************************/
96
97
extern Logic asis; /* TRUE: use presentation as given. FALSE:
98
reduce/reorder relations/generators. */
99
100
/******************************************************************
101
Group stuff:
102
******************************************************************/
103
104
extern char *grpname; /* Enumeration (i.e., group) name */
105
extern Wlist *rellst; /* The group's relator list */
106
extern int trellen; /* Total list length */
107
108
extern int ndgen; /* Number of group generators */
109
extern Logic *geninv; /* Are generators involutions? */
110
extern int *gencol; /* Translates +/- gen'r nos to columns */
111
extern int *colgen; /* col nos to +/- gen'r nos */
112
113
extern Logic galpha; /* True if the generators are letters */
114
extern char algen[28]; /* Translate generator number (1..ndgen, in
115
its order of entry) to its letter (ie, 'a'...'z').
116
A printable string, hence 1+26+1=28 posns! */
117
extern int genal[27]; /* Translate generator letter (where a=1,
118
etc) to its order of entry (ie, number). */
119
120
/******************************************************************
121
Subgroup stuff:
122
******************************************************************/
123
124
extern char *subgrpname; /* Subgroup name */
125
extern Wlist *genlst; /* The subgroup's renerator list */
126
extern int tgenlen; /* Total list length */
127
128
/******************************************************************
129
Many of the Level 0 parameters can be set directly. However, some
130
of them have slightly different meanings at Level 1 (eg, a special
131
value can be used to indicate a `default'), or can effect a
132
continuing enumeration. All of the following variables are
133
`aliases' for Level 0 parameters, and it is up to the _start()
134
function to decide when & how they should be transferred to their
135
Level 0 namesakes.
136
******************************************************************/
137
138
extern int rfactor1, cfactor1;
139
extern int pdsiz1, dedsiz1;
140
extern int maxrow1, ffactor1, nrinsgp1;
141
142
/******************************************************************
143
Externally visible functions defined in util1.c
144
******************************************************************/
145
146
void al1_init(void);
147
void al1_dump(Logic);
148
void al1_prtdetails(int);
149
void al1_rslt(int);
150
Wlist *al1_newwl(void);
151
Wlelt *al1_newelt(void);
152
void al1_addwl(Wlist*, Wlelt*);
153
void al1_concatwl(Wlist*, Wlist*);
154
void al1_emptywl(Wlist*);
155
void al1_prtwl(Wlist*, int);
156
Logic al1_addrep(int);
157
Logic al1_bldrep(int);
158
int al1_trrep(int);
159
int al1_ordrep(void);
160
void al1_prtct(int, int, int, Logic, Logic);
161
162
/******************************************************************
163
Externally visible functions defined in control.c
164
******************************************************************/
165
166
int al1_start(int);
167
168
169