-
Notifications
You must be signed in to change notification settings - Fork 5
/
typeA.h
210 lines (175 loc) · 7.17 KB
/
typeA.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/*
This is typeA.h
Coxeter version 3.0 Copyright (C) 2002 Fokko du Cloux
See file main.cpp for full copyright notice
This module declares some special features for groups of type A. Currently
this is just at the level of i/o, being able to input and output elements
as permutations.
*/
#ifndef TYPEA_H /* guard against multiple inclusions */
#define TYPEA_H
#include "globals.h"
#include "fcoxgroup.h"
namespace coxeter {
using namespace fcoxgroup;
//******** type declarations *************************************************
class TypeAInterface;
class TypeACoxGroup;
class TypeABigRankCoxGroup;
class GeneralTypeABRCoxGroup;
class TypeAMedRankCoxGroup;
class GeneralTypeAMRCoxGroup;
class TypeASmallRankCoxGroup;
class GeneralTypeASRCoxGroup;
class TypeASmallCoxGroup;
class GeneralTypeASCoxGroup;
//******** function declarations *********************************************
void coxWordToPermutation(CoxWord& a, const CoxWord& g);
void permutationToCoxWord(CoxWord& g, const CoxWord& a);
//******** type definitions **************************************************
class TypeACoxGroup:public FiniteCoxGroup {
TypeAInterface* d_typeAInterface;
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(TypeACoxGroup));}
TypeACoxGroup(const Rank& l);
virtual ~TypeACoxGroup();
// accessors
void coxWordToPermutation(CoxWord& a, const CoxWord& g) const;
bool hasPermutationInput() const; /* inlined */
bool hasPermutationOutput() const; /* inlined */
void permutationToCoxWord(CoxWord& g, const CoxWord& a) const;
const TypeAInterface& typeAInterface() const; /* inlined */
// manipulators
void setPermutationInput(bool b); /* inlined */
void setPermutationOutput(bool b); /* inlined */
TypeAInterface& typeAInterface(); /* inlined */
// i/o
virtual bool parseGroupElement(ParseInterface& P) const;
};
class TypeABigRankCoxGroup:public TypeACoxGroup {
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(TypeABigRankCoxGroup));}
TypeABigRankCoxGroup(const Rank& l):TypeACoxGroup(l) {};
virtual ~TypeABigRankCoxGroup() {};
};
class GeneralTypeABRCoxGroup:public TypeABigRankCoxGroup { // leaf class
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralTypeABRCoxGroup));}
GeneralTypeABRCoxGroup(const Rank& l):TypeABigRankCoxGroup(l) {};
~GeneralTypeABRCoxGroup() {};
};
class TypeAMedRankCoxGroup:public TypeACoxGroup {
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(TypeAMedRankCoxGroup));}
TypeAMedRankCoxGroup(const Rank& l);
virtual ~TypeAMedRankCoxGroup();
};
class GeneralTypeAMRCoxGroup:public TypeAMedRankCoxGroup { // leaf class
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralTypeAMRCoxGroup));}
GeneralTypeAMRCoxGroup(const Rank& l):TypeAMedRankCoxGroup(l) {};
~GeneralTypeAMRCoxGroup() {};
};
class TypeASmallRankCoxGroup:public TypeAMedRankCoxGroup {
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(TypeASmallRankCoxGroup));}
TypeASmallRankCoxGroup(const Rank& l):TypeAMedRankCoxGroup(l) {};
virtual ~TypeASmallRankCoxGroup() {};
};
class GeneralTypeASRCoxGroup:public TypeASmallRankCoxGroup { // leaf class
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralTypeASRCoxGroup));}
GeneralTypeASRCoxGroup(const Rank& l):TypeASmallRankCoxGroup(l) {};
~GeneralTypeASRCoxGroup() {};
};
class TypeASmallCoxGroup: public TypeASmallRankCoxGroup {
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(TypeASmallCoxGroup));}
TypeASmallCoxGroup(const Rank& l):TypeASmallRankCoxGroup(l) {};
virtual ~TypeASmallCoxGroup() {};
// accessors
int prodD(CoxWord& g, const DenseArray& d_x) const;
// i/o
bool parseDenseArray(ParseInterface& P) const;
virtual bool parseGroupElement(ParseInterface& P) const;
};
class GeneralTypeASCoxGroup:public TypeASmallCoxGroup { // leaf class
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralTypeASCoxGroup));}
GeneralTypeASCoxGroup(const Rank& l):TypeASmallCoxGroup(l) {};
~GeneralTypeASCoxGroup() {};
};
class TypeAInterface:public Interface {
Interface* d_pInterface;
bool d_hasPermutationInput;
bool d_hasPermutationOutput;
public:
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(TypeAInterface));}
TypeAInterface(const Rank& l);
virtual ~TypeAInterface();
// accessors
bool hasPermutationInput() const; /* inlined */
bool hasPermutationOutput() const; /* inlined */
bool parsePermutation(ParseInterface& P) const;
// manipulators
virtual void setIn(const GroupEltInterface& i);
virtual void setOut(const GroupEltInterface& i);
void setPermutationInput(bool b); /* inlined */
void setPermutationOutput(bool b); /* inlined */
// i/o
virtual String& append(String& str, const CoxWord& g) const;
virtual void print(FILE* file, const CoxWord& g) const;
};
//******** inline definitions ************************************************
inline bool TypeAInterface::hasPermutationInput() const
{return d_hasPermutationInput;}
inline bool TypeAInterface::hasPermutationOutput() const
{return d_hasPermutationOutput;}
inline void TypeAInterface::setPermutationInput(bool b)
{d_hasPermutationInput = b;}
inline void TypeAInterface::setPermutationOutput(bool b)
{d_hasPermutationOutput = b;}
inline bool TypeACoxGroup::hasPermutationInput() const
{return d_typeAInterface->hasPermutationInput();}
inline bool TypeACoxGroup::hasPermutationOutput() const
{return d_typeAInterface->hasPermutationOutput();}
inline void TypeACoxGroup::setPermutationInput(bool b)
{typeAInterface().setPermutationInput(b);}
inline void TypeACoxGroup::setPermutationOutput(bool b)
{typeAInterface().setPermutationOutput(b);}
inline const TypeAInterface& TypeACoxGroup::typeAInterface() const
{return *d_typeAInterface;}
inline TypeAInterface& TypeACoxGroup::typeAInterface()
{return *d_typeAInterface;}
}
#endif