53#define VX_EXCEPT(reason, file, line)
64#define VX_ENSURE_MEM(ptr) \
66 if ((ptr) == NULL) { \
67 VX_EXCEPT("Null param.", __FILE__, __LINE__); \
116 while (len-- && (p = v->
nbor[edge]))
135 const size_t next = 0;
141 v->
nbor[next] = entry;
157 const size_t next = 0;
180 const size_t next = 0;
181 const size_t prev = 1;
186 entry->
nbor[next] = entry;
187 entry->
nbor[prev] = entry;
194 v =
vx_walk(cirq, prev, -(pos + 1));
197 entry->
nbor[next] = v;
199 v->
nbor[prev] = entry;
200 entry->
nbor[prev]->
nbor[next] = entry;
201 return pos ? cirq : entry;
216 const size_t next = 0;
217 const size_t prev = 1;
225 ret =
vx_walk(ret, prev, -pos);
228 if (ret == ret->
nbor[next])
230 else if (ret == *cirqp)
231 *cirqp = ret->
nbor[next];
The data type for a graph vertex.
Definition vertegs.h:77
struct Vertegs * nbor[1]
The neighbourhood of the vertex - an array of neighbours.
Definition vertegs.h:83
#define VX_ENSURE_MEM(ptr)
Raise an exception and return NULL if the pointer is NULL.
Definition vertegs.h:64
static struct Vertegs * vx_walk(struct Vertegs *v, size_t edge, int len)
For a chain, in which all edges share the same index, find the other end.
Definition vertegs.h:111
static struct Vertegs * vx_inslist(struct Vertegs *list, struct Vertegs *entry, int pos)
Insert, at a given position, an entry into a list.
Definition vertegs.h:133
static struct Vertegs * vx_4nbor(struct Vertegs **nbor)
Cast to vertex from its neighbourhood.
Definition vertegs.h:95
static struct Vertegs * vx_remlist(struct Vertegs **listp, int pos)
Remove, at a given position, an entry from a list.
Definition vertegs.h:155
static struct Vertegs * vx_inscirq(struct Vertegs *cirq, struct Vertegs *entry, int pos)
Insert, at a given position, an entry into a cirq.
Definition vertegs.h:178
static struct Vertegs * vx_remcirq(struct Vertegs **cirqp, int pos)
Remove, at a given position, an entry from a cirq.
Definition vertegs.h:214