38#ifndef VERTEGS_GRAPH_H
39#define VERTEGS_GRAPH_H
45#define VX_TYPEOF(var) void*
56#define VX_TYPEOF(var) __typeof__(var)
72#define VX_GRAPH(name, deg, type) \
75 struct Vertegs* vx_graph_nbor[deg]; \
88#define vx_graph_2vx(graph) \
89 (0 ? (struct Vertegs*)(graph)->vx_graph_nbor : (struct Vertegs*)(graph))
101#define vx_graph_4vx(v, graph) \
102 (0 ? (VX_TYPEOF(graph))((graph)->vx_graph_nbor[0] = (v)->nbor[0]) \
103 : ((VX_TYPEOF(graph))(v)))
114#define vx_graphp_2vxp(graphp) \
115 (0 ? (*(graphp))->vx_graph_nbor : (struct Vertegs**)(graphp))
126#define vx_graph_datap(graph) (&(graph)->vx_graph_data)
136#define vx_graph_foredge(type, i, graphp, edge) \
137 for (type** i = graphp; *i; i = (type**)&(*i)->vx_graph_nbor[edge])
The data type for a graph vertex.
Definition vertex.h:80
Vtable for message construction.
Definition graph.h:144
struct Vertegs * vx_graph_nbor[1]
The neighbourhood of the vertex - an array of neighbours.
Definition graph.h:150
static const struct VxGraphEmpty * vx_graph_empty(void)
Return an empty graph.
Definition graph.h:163
static const struct VxGraphEmpty * VX_GRAPH_EMPTY
Empty graph - null pointer.
Definition graph.h:154