-
Notifications
You must be signed in to change notification settings - Fork 0
/
tree.h
46 lines (36 loc) · 1009 Bytes
/
tree.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
#include "common.h"
struct assignment {
int *incoming;
int incoming_size;
int nr_incoming;
int tree_size;
int parent;
int varnr;
};
struct assignment *assignment_array;
int node_stamp, tree_stamp, changed;
void init_tree();
void dispose_tree();
int treebased_lookahead();
void create_tree_rec( int nrval );
int calc_tree_size_rec( const int nrval );
void looklist_rec( int nrval );
int nrgiven;
int minpos;
int lastCTS;
int complement_value;
int impgiven;
#define ADD_INCOMING( __parent, __incoming ) \
{ \
if( __parent->nr_incoming == __parent->incoming_size ) \
{\
__parent->incoming_size *= 2; \
__parent->incoming = (int*)realloc(__parent->incoming, __parent->incoming_size*sizeof(int));\
\
}\
__parent->incoming[__parent->nr_incoming++] = __incoming; \
}
#define initvs() vindex = 0
#define vpush(x) vstack[ ++vindex ] = x
#define vpop() ( vstack[ vindex -- ] )
#define emptys() ( ( vindex >= 1 )?0:1 )