41#ifndef VERTEGS_VERTEX_H
42#define VERTEGS_VERTEX_H
57#define VX_ASSERT(cond) assert(cond)
68#define VX_ENSURE_MEM(ptr) \
117 while (len-- && v->
nbor[edge])
136 const size_t next = 0;
142 v->
nbor[next] = entry;
158 const size_t next = 0;
181 const size_t next = 0;
182 const size_t prev = 1;
187 entry->
nbor[next] = entry;
188 entry->
nbor[prev] = entry;
195 v =
vx_walk(cirq, prev, -(pos + 1));
198 entry->
nbor[next] = v;
200 v->
nbor[prev] = entry;
201 entry->
nbor[prev]->
nbor[next] = entry;
202 return pos ? cirq : entry;
217 const size_t next = 0;
218 const size_t prev = 1;
226 ret =
vx_walk(ret, prev, -pos);
229 if (ret == ret->
nbor[next])
231 else if (ret == *cirqp)
232 *cirqp = ret->
nbor[next];
The data type for a graph vertex.
Definition vertex.h:80
struct Vertegs * nbor[1]
The neighbourhood of the vertex - an array of neighbours.
Definition vertex.h:86
#define VX_ENSURE_MEM(ptr)
Raise an exception and return NULL if the pointer is NULL.
Definition vertex.h:68
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 vertex.h:114
static struct Vertegs * vx_inslist(struct Vertegs *list, struct Vertegs *entry, int pos)
Insert, at a given position, an entry into a list.
Definition vertex.h:134
static struct Vertegs * vx_4nbor(struct Vertegs **nbor)
Cast to vertex from its neighbourhood.
Definition vertex.h:98
static struct Vertegs * vx_remlist(struct Vertegs **listp, int pos)
Remove, at a given position, an entry from a list.
Definition vertex.h:156
static struct Vertegs * vx_inscirq(struct Vertegs *cirq, struct Vertegs *entry, int pos)
Insert, at a given position, an entry into a cirq.
Definition vertex.h:179
static struct Vertegs * vx_remcirq(struct Vertegs **cirqp, int pos)
Remove, at a given position, an entry from a cirq.
Definition vertex.h:215