packed.h
1.37 KB
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
typedef unsigned char byte;
/*
struct _fd_packed_problem {
int nvariables, nconstraints;
#ifdef USE_OFFSET
int *variables; // offset of the variables within data
int *constraints; // offset of the constraints within data
#else
fd_int *variables; // address of the variables (within data)
fd_constraint *constraints; // address of the constraints (within data)
#endif
byte *data;
};
*/
struct _fd_packed_int {
int index;
#ifndef USE_STORE
fd_value domain;
#endif
VAR_C_T *constraints;
int nconstraints;
int nconnections;
#ifndef DISTRIBUTED_SOLVER
int epoch;
bool assigned;
int flags;
#ifdef USE_VALUE
int value;
#endif
#endif /* DISTRIBUTED_SOLVER */
};
/* fields must correspond to an initial segment of fd_constraint */
struct _fd_packed_constraint {
#ifdef CONSTRAINT_TEMPS
int index;
#endif
C_VAR_T *variables;
int nvariables;
int *constants;
int nconstants;
_fd_constraint_kind kind;
// int kind;
};
struct _fd_packed_problem {
int nvariables, nconstraints;
#ifdef USE_OFFSET
int *variables; // offset of the variables within data
int *constraints; // offset of the constraints within data
#else
struct _fd_packed_int **variables; // variables' address (within data)
struct _fd_packed_constraint **constraints; // constraints' address (within data)
#endif
byte *data;
};