Go to the documentation of this file.
70 #define N_EDGE_TYPES 3
71 #define EDGE_TYPE_HORIZONTAL 0
72 #define EDGE_TYPE_VERTICAL 1
73 #define EDGE_TYPE_DIAGONAL 2
75 #define N_INCIDENT_EDGES 6
76 #define MAX_OUTDEGREE 3
79 #define VERTEX_ROW(V, NCOLS) ((V) / (NCOLS))
82 #define VERTEX_COL(V, NCOLS) ((V) % (NCOLS))
85 #define VERTEX_ID(R, C, NCOLS) ((R) * (NCOLS) + (C))
88 #define EDGE_ROW(E, NCOLS) ((E) / ((NCOLS) * (N_EDGE_TYPES)))
90 #define EDGE_COL(E, NCOLS) (((E) / (N_EDGE_TYPES)) % (NCOLS))
92 #define EDGE_WHICH(E) ((E) % (N_EDGE_TYPES))
94 #define EDGE_ID(R, C, W, NCOLS) ((((R) * (NCOLS) + (C)) * (N_EDGE_TYPES)) + (W))
96 #define EDGE_FROM(E, NCOLS) VERTEX_ID(EDGE_ROW(E, NCOLS), EDGE_COL(E, NCOLS), NCOLS)
98 #define EDGE_TO(E, NCOLS) \
99 VERTEX_ID(EDGE_ROW(E, NCOLS) + ((EDGE_WHICH(E) == EDGE_TYPE_HORIZONTAL) ? 0 : 1), \
100 EDGE_COL(E, NCOLS) + ((EDGE_WHICH(E) == EDGE_TYPE_VERTICAL) ? 0 : 1), \