forked from gap-system/gap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objfgelm.h
156 lines (120 loc) · 4.09 KB
/
objfgelm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/****************************************************************************
**
** This file is part of GAP, a system for computational discrete algebra.
**
** Copyright of GAP belongs to its developers, whose names are too numerous
** to list here. Please refer to the COPYRIGHT file for details.
**
** SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef GAP_OBJFGELM_H
#define GAP_OBJFGELM_H
#include "objects.h"
/****************************************************************************
**
*D AWP_SOMETHING
**
** The following enum constants are positions of non-defining data in the
** types of associative words (AWP = Associative Word Position).
*/
enum {
START_ENUM_RANGE_INIT(AWP_FIRST_ENTRY, POS_FIRST_FREE_TYPE),
// the pure type of the object itself, without knowledge features
AWP_PURE_TYPE,
// the number of bits available for each exponent
AWP_NR_BITS_EXP,
// the number of generators
AWP_NR_GENS,
// the number of bits available for each generator/exponent pair
AWP_NR_BITS_PAIR,
// the construction function to be called by `ObjByVector'
AWP_FUN_OBJ_BY_VECTOR,
// the construction function to be called by `AssocWord'
AWP_FUN_ASSOC_WORD,
END_ENUM_RANGE(AWP_LAST_ENTRY),
};
/****************************************************************************
**
*F BITS_WORDTYPE( <type> )
*/
#define BITS_WORDTYPE( type ) \
( INT_INTOBJ( ELM_PLIST( (type), AWP_NR_BITS_PAIR ) ) )
/****************************************************************************
**
*F EBITS_WORDTYPE( <type> )
*/
#define EBITS_WORDTYPE( type ) \
( INT_INTOBJ( ELM_PLIST( (type), AWP_NR_BITS_EXP ) ) )
/****************************************************************************
**
*F RANK_WORDTYPE( <type> )
*/
#define RANK_WORDTYPE( type ) \
( INT_INTOBJ( ELM_PLIST( (type), AWP_NR_GENS ) ) )
/****************************************************************************
**
*F PURETYPE_WORDTYPE( <type> )
*/
#define PURETYPE_WORDTYPE( type ) \
( ELM_PLIST( (type), AWP_PURE_TYPE ) )
/****************************************************************************
**
*F BITS_WORD( <word> )
*/
#define BITS_WORD( word ) \
( BITS_WORDTYPE( TYPE_DATOBJ( (word) ) ) )
/****************************************************************************
**
*F DATA_WORD( <word> )
**
** 'DATA_WORD' returns a pointer to the data area of <word>.
*/
#define DATA_WORD( word ) \
((UIntN *)( ADDR_OBJ( word ) + 2 ))
#define CONST_DATA_WORD( word ) \
((const UIntN *)( CONST_ADDR_OBJ( word ) + 2 ))
/****************************************************************************
**
*F EBITS_WORD( <word> )
*/
#define EBITS_WORD( word ) \
( EBITS_WORDTYPE( TYPE_DATOBJ( (word) ) ) )
/****************************************************************************
**
*F NPAIRS_WORD( <word> )
**
** 'NPAIRS_WORD' returns the number of pairs of generator number/exponent
** pairs of <word>.
*/
#define NPAIRS_WORD( word ) \
( INT_INTOBJ( CONST_ADDR_OBJ( (word) )[1]) )
/****************************************************************************
**
*F RANK_WORD( <word> )
*/
#define RANK_WORD( word ) \
( RANK_WORDTYPE( TYPE_DATOBJ( (word) ) ) )
/****************************************************************************
**
*F PURETYPE_WORD( <word> )
*/
#define PURETYPE_WORD( word ) \
( PURETYPE_WORDTYPE( TYPE_DATOBJ( (word) ) ) )
/****************************************************************************
**
*F NewWord( <type>, <npairs> )
**
** 'NewWord' returns a new object which has the given <type> and room for
** <npairs> pairs of generator number/exponent.
*/
Obj NewWord(Obj type, UInt npairs);
/****************************************************************************
**
*F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * *
*/
/****************************************************************************
**
*F InitInfoFreeGroupElements() . . . . . . . . . . . table of init functions
*/
StructInitInfo * InitInfoFreeGroupElements ( void );
#endif // GAP_OBJFGELM_H