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 pretty_filterfns.h 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
/* header file supplied by Sarah Rees */
11
12
#ifndef ANUPQ_PRETTY_FILTER_H
13
#define ANUPQ_PRETTY_FILTER_H
14
15
#include <stdlib.h>
16
17
typedef int gen_type; /*name for generator*/
18
19
#define anu_valloc(A,N) (A *)malloc((unsigned)(sizeof(A)*(N)))
20
#define vzalloc(A,N) (A *)calloc((unsigned)N,(unsigned)sizeof(A))
21
#define inv(g) inv_of[(g)]
22
23
typedef struct {
24
gen_type *g;
25
int first; /* the position of the first entry in the word */
26
int last; /* position of last entry; if word is empty,
27
define this to be position BEFORE first entry */
28
int space; /* this should be a power of 2 */
29
char type; /* initialised to 0, 'c' for commutator, or 's' for string */
30
int n; /* used if the word is a power of that pointed to by the "g" field.
31
0 means the same as 1, i.e. the word is not a proper power */
32
} word;
33
34
typedef struct word_link {
35
word * wp;
36
struct word_link * next;
37
} word_link;
38
39
typedef struct word_traverser {
40
word * wp;
41
int posn;
42
} word_traverser;
43
44
extern char word_delget_first(word *wp, gen_type *gp);
45
extern char word_del_last(word *wp);
46
extern char word_next(word_traverser *wtp, gen_type *gp);
47
extern char read_next_gen(word *wp, FILE *file);
48
extern char read_next_word(word *wp, FILE *file);
49
extern char word_get_last(word *wp, gen_type *gp);
50
extern char find_keyword(char *label, FILE *rfile);
51
extern char read_next_string(char *cp, int n, FILE *rfile);
52
extern char read_next_int(int *kp, FILE *rfile);
53
extern char word_eq(word *w1p, word *w2p);
54
55
word_link * word_link_create(void);
56
void word_link_init (word_link * wlp);
57
void word_link_clear (word_link * wlp);
58
59
void word_expand (word *wp);
60
void word2prog_word (word *user_wordp, word *prog_wordp);
61
62
void default_inverse_array (void);
63
int read_char (FILE *rfile);
64
void find_char (char c, FILE *rfile);
65
66
#define word_length(wp) (((wp)->last) + 1 - ((wp)->first))
67
68
extern int num_gens;
69
extern int paired_gens;
70
extern gen_type * inv_of;
71
extern int * pairnumber;
72
extern word * user_gen_name;
73
extern int gen_array_size;
74
75
76
#endif
77
78