-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfiles.h
435 lines (414 loc) · 13.8 KB
/
files.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
/*
This is files.h
Coxeter version 3.0 Copyright (C) 2002 Fokko du Cloux
See file main.cpp for full copyright notice
*/
#ifndef FILES_H /* guard against multiple inclusions */
#define FILES_H
#include "globals.h"
#include "hecke.h"
#include "invkl.h"
#include "kl.h"
#include "uneqkl.h"
#include "wgraph.h"
namespace files {
using namespace coxeter;
using namespace hecke;
using namespace wgraph;
// do _not_ use namespace kl! creates conflicts in coxgroup
/******** type declarations *************************************************/
enum Header { bettiH, basisH, closureH, dufloH, extremalsH, ihBettiH,
lCOrderH, lCellsH, lCellWGraphsH, lWGraphH, lrCOrderH,
lrCellsH, lrCellWGraphsH, lrWGraphH, rCOrderH, rCellsH,
rCellWGraphsH, rWGraphH, slocusH, sstratificationH,
numHeaders};
struct AddHeckeTraits;
struct HeckeTraits;
struct OutputTraits;
struct PolynomialTraits;
struct PosetTraits;
struct PartitionTraits;
struct WgraphTraits;
/******** function definitions **********************************************/
template <class C>
void appendCoefficient(String& str, const C& c,
PolynomialTraits& traits);
template <class E>
void appendExponent(String& str, const E& e, PolynomialTraits& traits);
template <class M>
void appendHeckeMonomial(String& str, const M& m, const SchubertContext& p,
const Interface& I, HeckeTraits& hTraits,
PolynomialTraits& pTraits, const Length& l);
void appendHomology(String& str, const Homology& h, OutputTraits& traits);
template <class C>
void appendMonomial(String& str, const C& c, const Ulong& e,
PolynomialTraits& traits,
const Ulong& d = 1, const long& m = 0);
void appendModifier(String& str, const Ulong& d, const long& m,
PolynomialTraits& traits);
template <class M>
void appendMuMark(String& str, const M& m, const SchubertContext& p,
const Length& l, HeckeTraits& traits);
template <class P>
void appendPolynomial(String& str, const P& p,
PolynomialTraits& traits,
const Ulong& d = 1, const long& m = 0);
void appendSeparator(String& str, const Ulong& n, HeckeTraits& traits);
template <class KL>
void makeWGraph(WGraph& X, const List<CoxNbr>& c, const LFlags& f, KL& kl);
void minReps(List<CoxNbr>& min, const Partition& pi, schubert::NFCompare& c);
void pad(String& str, const Ulong& n, HeckeTraits& traits);
template<class H>
void printAsBasisElt(FILE* file, const H& h, const SchubertContext& p,
Interface& I, OutputTraits& traits);
void printBetti(FILE* file, const CoxNbr& y, const SchubertContext& p,
OutputTraits& traits);
void printCellOrder(FILE* file, const OrientedGraph& X,
const SchubertContext& p, const Interface& I,
PosetTraits& traits);
void printCoatoms(FILE* file, const CoxNbr& y, const SchubertContext& p,
const Interface& I, OutputTraits& traits);
template <class KL>
void printClosure(FILE* file, const CoxNbr& y, KL& kl, const Interface& I,
OutputTraits& traits);
template <class C>
void printCoefficient(FILE* file, const C& c,
PolynomialTraits& traits);
void printDescents(FILE* file, const LFlags& df, const LFlags& f,
const Interface& I, WgraphTraits& traits);
template <class KL>
void printDuflo(FILE* file, const List<CoxNbr>& d, const Partition& pi,
KL& kl, const Interface& I, OutputTraits& traits);
void printEltData(FILE* file, const CoxNbr& y, const SchubertContext& p,
const Interface& I, OutputTraits& traits);
template <class E>
void printExponent(FILE* file, const E& e, PolynomialTraits& traits);
template <class KL>
void printExtremals(FILE* file, const CoxNbr& y, const KL& kl,
const Interface& I, OutputTraits& traits);
void printHeader(FILE* file, const Header& header, OutputTraits& traits);
template <class H>
void printHeckeElt(FILE* file, const H& h, const SchubertContext& p,
const Interface& I, OutputTraits& traits,
const Length& l = undef_length);
template <class H>
void printHeckeElt(FILE* file, const H& h, const Permutation& a,
const SchubertContext& p, const Interface& I,
HeckeTraits& hTraits,
PolynomialTraits& pTraits,
const Length& l = undef_length);
void printHomology(FILE* file, const Homology& h, OutputTraits& traits);
template <class KL>
void printIHBetti(FILE* file, const CoxNbr& y, KL& kl, OutputTraits& traits);
template <class KL>
void printLCOrder(FILE* file, KL& kl, const Interface& I,
OutputTraits& traits);
template <class KL>
void printLCells(FILE* file, const Partition& lp, KL& kl, const Interface& I,
OutputTraits& traits);
template <class KL>
void printLCellWGraphs(FILE* file, const Partition& lp, KL& kl,
const Interface& I, OutputTraits& traits);
template <class KL>
void printLRCOrder(FILE* file, KL& kl, const Interface& I,
OutputTraits& traits);
template <class KL>
void printLRCells(FILE* file, const Partition& lp, KL& kl,
const Interface& I, OutputTraits& traits);
template <class KL>
void printLRCellWGraphs(FILE* file, const Partition& lp, KL& kl,
const Interface& I, OutputTraits& traits);
template <class KL>
void printLRWGraph(FILE* file, KL& kl, const Interface& I,
OutputTraits& traits);
template <class KL>
void printLWGraph(FILE* file, KL& kl, const Interface& I,
OutputTraits& traits);
template <class C>
void printMonomial(FILE* file, const C& c, const Ulong& e,
PolynomialTraits& traits,
const Ulong& d = 1, const long& m = 0);
void printModifier(FILE* file, const Ulong& d, const long& m,
PolynomialTraits& traits);
template <class M>
void printMuMark(FILE* file, const M& m, const SchubertContext& p,
const Length& l, HeckeTraits& traits);
void printPartition(FILE* file, const Partition& pi, const SchubertContext& p,
const Interface& I, PartitionTraits& traits);
template <class P>
void printPolynomial(FILE* file, const P& p, PolynomialTraits& traits,
const Ulong& d = 1, const long& m = 0);
template <class KL>
void printRCOrder(FILE* file, KL& kl, const Interface& I,
OutputTraits& traits);
template <class KL>
void printRCells(FILE* file, const Partition& lp, KL& kl, const Interface& I,
OutputTraits& traits);
template <class KL>
void printRCellWGraphs(FILE* file, const Partition& lp, KL& kl,
const Interface& I, OutputTraits& traits);
template <class KL>
void printRWGraph(FILE* file, KL& kl, const Interface& I,
OutputTraits& traits);
void printSeparator(FILE* file, const Ulong& n, HeckeTraits& traits);
template <class KL>
void printSingularLocus(FILE* file, const CoxNbr& y, KL& kl,
const Interface& I, OutputTraits& traits);
template <class KL>
void printSingularStratification(FILE* file, const CoxNbr& y, KL& kl,
const Interface& I, OutputTraits& traits);
void printWGraph(FILE* file, const WGraph& X, const LFlags& f,
const Interface& I, WgraphTraits& traits);
template <class KL>
void printWGraphList(FILE* file, const Partition& pi, const LFlags& f,
const Interface& I, KL& kl, OutputTraits& traits);
template <class H>
bool setTwoSided(const H& h, const Permutation& a, const SchubertContext& p,
const Interface& I, HeckeTraits& hTraits,
PolynomialTraits& pTraits, const Length& l = undef_length);
void sortLists(List<List<CoxNbr> >& lc, schubert::NFCompare& nfc,
Permutation& a);
void writeClasses(List<List<CoxNbr> >& lc, const Partition& pi);
/******** type definitions **************************************************/
struct PolynomialTraits {
String prefix;
String postfix;
String indeterminate;
String sqrtIndeterminate;
String posSeparator;
String negSeparator;
String product;
String exponent;
String expPrefix;
String expPostfix;
String zeroPol;
String one;
String negOne;
String modifierPrefix;
String modifierPostfix;
String modifierSeparator;
bool printExponent;
bool printModifier;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(PolynomialTraits));}
PolynomialTraits(Pretty);
PolynomialTraits(Terse);
PolynomialTraits(GAP);
~PolynomialTraits();
};
struct HeckeTraits {
String prefix;
String postfix;
String evenSeparator;
String oddSeparator;
String monomialPrefix;
String monomialPostfix;
String monomialSeparator;
String muMark;
String hyphens;
Ulong lineSize;
Ulong indent;
Ulong evenWidth;
Ulong oddWidth;
char padChar;
bool doShift;
bool reversePrint;
bool twoSided;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(HeckeTraits));}
HeckeTraits(const Interface& I, Pretty);
HeckeTraits(const Interface& I, Terse);
HeckeTraits(const Interface& I, GAP);
virtual ~HeckeTraits();
};
struct AddHeckeTraits:public HeckeTraits { // Hecke traits for additive output
GroupEltInterface* eltTraits;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(AddHeckeTraits));}
AddHeckeTraits(const Interface& I, Pretty);
AddHeckeTraits(const Interface& I, Terse);
AddHeckeTraits(const Interface& I, GAP);
~AddHeckeTraits();
};
struct PartitionTraits {
String prefix;
String postfix;
String separator;
String classPrefix;
String classPostfix;
String classSeparator;
String classNumberPrefix;
String classNumberPostfix;
bool printClassNumber;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(PartitionTraits));}
PartitionTraits(Pretty);
PartitionTraits(Terse);
PartitionTraits(GAP);
~PartitionTraits();
};
struct PosetTraits {
String prefix;
String postfix;
String separator;
String edgePrefix;
String edgePostfix;
String edgeSeparator;
String nodePrefix;
String nodePostfix;
Ulong nodeShift;
bool printNode;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(PosetTraits));}
PosetTraits(Pretty);
PosetTraits(Terse);
PosetTraits(GAP);
~PosetTraits();
};
struct WgraphTraits {
String prefix;
String postfix;
String separator;
String edgeListPrefix;
String edgeListPostfix;
String edgeListSeparator;
String edgePrefix;
String edgePostfix;
String edgeSeparator;
String nodePrefix;
String nodePostfix;
String nodeSeparator;
String nodeNumberPrefix;
String nodeNumberPostfix;
Ulong nodeShift;
int padSize;
bool hasPadding;
bool printNodeNumber;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(WgraphTraits));}
WgraphTraits(Pretty);
WgraphTraits(Terse);
WgraphTraits(GAP);
~WgraphTraits();
};
struct OutputTraits {
// strings
String versionString;
String typeString;
// header file names
String header[numHeaders];
String prefix[numHeaders];
String postfix[numHeaders];
bool hasHeader[numHeaders];
// prettyfying strings for printouts
String closureSeparator1;
String closureSeparator2;
String closureSeparator3;
String closureSeparator4;
String closureSeparator5;
String closureSeparator6;
String eltList;
String singularLocus;
String singularStratification;
String emptySingularLocus;
String emptySingularStratification;
// list formatting
String bettiPrefix;
String bettiPostfix;
String bettiSeparator;
String bettiRankPrefix;
String bettiRankPostfix;
String cellNumberPrefix;
String cellNumberPostfix;
String closureSizePrefix;
String closureSizePostfix;
String coatomPrefix;
String coatomPostfix;
String coatomSeparator;
String compCountPrefix;
String compCountPostfix;
String dufloPrefix;
String dufloPostfix;
String dufloSeparator;
String dufloListPrefix;
String dufloListPostfix;
String dufloListSeparator;
String dufloNumberPrefix;
String dufloNumberPostfix;
String eltNumberPrefix;
String eltNumberPostfix;
String eltListPrefix;
String eltListPostfix;
String eltListSeparator;
String eltPrefix;
String eltPostfix;
String eltDataPrefix;
String eltDataPostfix;
String graphListPrefix;
String graphListPostfix;
String graphListSeparator;
String lDescentPrefix;
String lDescentPostfix;
String rDescentPrefix;
String rDescentPostfix;
String lengthPrefix;
String lengthPostfix;
String closeString;
String bettiHyphens;
Ulong lineSize;
// traits for the output of a polynomial
PolynomialTraits polTraits;
// traits for the output of a Hecke element
HeckeTraits heckeTraits;
AddHeckeTraits addHeckeTraits;
// traits for the output of a partition
PartitionTraits partitionTraits;
// traits for the output of a W-graph
WgraphTraits wgraphTraits;
// traits for the output of a poset
PosetTraits posetTraits;
// flags
bool printBettiRank;
bool printCellNumber;
bool printClosureSize;
bool printCoatoms;
bool printCompCount;
bool printDufloNumber;
bool printEltDescents;
bool printElt;
bool printEltData;
bool printEltNumber;
bool printLength;
bool printType;
bool printVersion;
bool hasBettiPadding;
// constructors and destructors
void* operator new(size_t size) {return arena().alloc(size);}
void* operator new(size_t size, void* ptr) {return ptr;}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(OutputTraits));}
void operator delete(void* p1, void* p2) {};
OutputTraits(const CoxGraph& G, const Interface& I, Pretty);
OutputTraits(const CoxGraph& G, const Interface& I, Terse);
OutputTraits(const CoxGraph& G, const Interface& I, GAP);
~OutputTraits();
// manipulators
void setBasisTraits(HeckeTraits& hTraits);
void setDefaultTraits(HeckeTraits& hTraits);
};
}
/******** inline definitions *************************************************/
#include "files.hpp"
#endif