-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataTypes.h
executable file
·68 lines (52 loc) · 1.46 KB
/
DataTypes.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
//
// DataTypes.h
//
//
// Created by C.R.Leedham-Green on 06/03/2017.
//
//
#ifndef DataTypes_h
#define DataTypes_h
typedef int triple[3];
typedef int pair[2];
typedef int *Permutation;
typedef uint32_t UNINT; // Defining the UNINT type
const UNINT ONE = 1; /* Used for operations with addPerm, allOnes, etc */
typedef UNINT* PairsSet;
typedef PairsSet* Pairs_DB;
/* Greater is a bit-string that encodes the set of pairs (a,b) for which a>b in the data base.
LocalGreater is an array of bit-strings. The array is of length d(d-1), where d is the degree.
The entries in the array correspond to the pairs (a,b), and the bits set in that entry
correspond to the pairs (c,d) for which a>b -> c>d is stored in the data base. */
typedef struct
{
PairsSet Greater;
Pairs_DB LocalGreater;
} DataBase;
/* Entries with the same hash address in a hash table are stored in a linked list. */
typedef struct node
{
DataBase database;
struct node* next;
} DBHashEntry;
typedef DBHashEntry* DBHashList;
/* size is the number of distinct hash values that are allowed, and is the length of
the array table. So hash values lie in the range 0 to size-1.
count is the number of entries stored in the hash table.*/
typedef struct
{
int size;
DBHashList* table;
int count;
} DBHashTable;
typedef struct
{
int triple;
DataBase db;
} DBInputData;
typedef struct link
{
Permutation entry;
struct link* next;
} SmallPermset;
#endif /* DataTypes_h */