-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubset.h
More file actions
36 lines (24 loc) · 708 Bytes
/
Subset.h
File metadata and controls
36 lines (24 loc) · 708 Bytes
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
#include <stdint.h>
#ifndef SUBSET_H
#define SUBSET_H
#define CHUNKS (1 + N/64)
#define STACK_SIZE ((N * (N+1)) / 2)
typedef uint64_t Bitstring[CHUNKS];
void printBitstring(Bitstring bs);
void setBit(Bitstring bs, int bit);
int getBit(Bitstring bs, int bit);
void orBitstrings(Bitstring lhs, Bitstring rhs);
typedef struct Subset {
Bitstring invalid;
int length;
int values[N];
} Subset;
void newSubset(Subset * ss, int value);
void extendSubset(Subset * ss, Subset * base, int value);
int relevantExcluded(Subset * ss);
int formsSquare(int a, int b, int c);
void setupInvalidTable();
int isPrime(int x);
void setupKnownBitstring();
void printSolution(Subset * ss);
#endif