Files | |
| file | eg_eugraph.ex.c |
| file | eg_eugraph.h |
Data Structures | |
| struct | EGeUgraph_t |
| structure that holds all graph related structures needed to define a directed graph, and to allow modifications over it. More... | |
| struct | EGeUgraphEdge_t |
| structure that hold all edge related structures needed to define a directed graph, and add/delete/modify it's structure More... | |
| struct | EGeUgraphEP_t |
| Structure for endpoints of edges. More... | |
| struct | EGeUgraphNode_t |
| structure that hold all node related structures needed to define a graph, and add/delete/modify it's structure More... | |
| struct | my_uedge_t |
| example of an edge structure using the embeded substructures. More... | |
| struct | my_ugraph_t |
| example of a graph structure using the embeded substructures. More... | |
| struct | my_unode_t |
| example of a node structure using the embeded substructures. More... | |
Defines | |
| #define | EGeUgraphAddEdge(G, head_pt, tail_pt, e) |
| Add an edge to a graph. | |
| #define | EGeUgraphAddNode(G, v) |
| Add a node to the graph. | |
| #define | EGeUgraphChangeEP(G, e, tail_pt, ep_type) |
| Change an endpoint of an edge. | |
| #define | EGeUgraphChangeHead(G, e, head_pt) EGeUgraphChangeEP(G,e,head_pt,1) |
| Change the head of an edge. | |
| #define | EGeUgraphChangeTail(G, e, tail_pt) EGeUgraphChangeEP(G,e,tail_pt,0) |
| Change the tail of an edge. | |
| #define | EGeUgraphClear(G) ; |
| Clear the structure so that we can free it (without memory leaks). Note that this macro does nothing, because it is always safe to free this structure. | |
| #define | EGeUgraphDelEdge(G, e) |
| Delete an edge from a graph. | |
| #define | EGeUgraphDelNode(G, v) |
| Remove a node from a graph. | |
| #define | EGeUgraphEdgeClear(G) ; |
| Clear the structure so that we can free it (without memory leaks). Note that this macro does nothing, because it is always safe to free this structure. | |
| #define | EGeUgraphEdgeInit(e) *(e) = (EGeUgraphEdge_t){{(EGeUgraphEP_t){(EGeList_t){0,0},0,0},(EGeUgraphEP_t){(EGeList_t){0,0},0,1}}}; |
| Initialize an edge as an empty edge, non attached to any graph. | |
| #define | EGeUgraphGetAdjEdge(edge_cn) |
| Given the adjacency list connector of an edge, return the pointer to the internal edge. | |
| #define | EGeUgraphInit(G) |
| Initialize a graph structure as an empty graph with no members. | |
| #define | EGeUgraphNodeClear(G) ; |
| Clear the structure so that we can free it (without memory leaks). Note that this macro does nothing, because it is always safe to free this structure. | |
| #define | EGeUgraphNodeInit(v) |
| Initialize a node as an empty non-attached node. | |
Typedefs | |
| typedef EGeUgraph_t | EGeUgraph_t |
| structure that holds all graph related structures needed to define a directed graph, and to allow modifications over it. | |
| typedef EGeUgraphEdge_t | EGeUgraphEdge_t |
| structure that hold all edge related structures needed to define a directed graph, and add/delete/modify it's structure | |
| typedef EGeUgraphEP_t | EGeUgraphEP_t |
| Structure for endpoints of edges. | |
| typedef EGeUgraphNode_t | EGeUgraphNode_t |
| structure that hold all node related structures needed to define a graph, and add/delete/modify it's structure | |
| typedef my_uedge_t | my_uedge_t |
| example of an edge structure using the embeded substructures. | |
| typedef my_ugraph_t | my_ugraph_t |
| example of a graph structure using the embeded substructures. | |
| typedef my_unode_t | my_unode_t |
| example of a node structure using the embeded substructures. | |
Functions | |
| static void | display_UG (my_ugraph_t *myG) |
| Display the contents of our graph structure. | |
| int | main (void) |
| A simple example of a directed graph using (EGdEgraph) structures. | |
|
|
Value: ({\
EGeUgraph_t*const __EGeDg_add_e_G = (G);\
EGeUgraphNode_t*const __EGeDg_add_e_head = (head_pt);\
EGeUgraphNode_t*const __EGeDg_add_e_tail = (tail_pt);\
EGeUgraphEdge_t*const __EGeDg_add_e = (e);\
EGeListAddAfter(&(__EGeDg_add_e->ep[1].cn),&(__EGeDg_add_e_head->edges));\
EGeListAddAfter(&(__EGeDg_add_e->ep[0].cn),&(__EGeDg_add_e_tail->edges));\
__EGeDg_add_e->ep[1].node = __EGeDg_add_e_head;\
__EGeDg_add_e->ep[0].node = __EGeDg_add_e_tail;\
__EGeDg_add_e_head->degree++;\
__EGeDg_add_e_tail->degree++;\
__EGeDg_add_e_G->n_edges++;})
Definition at line 195 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraph_t*const __EGeDg_add_n_G = (G);\
EGeUgraphNode_t*const __EGeDg_add_n_v = (v);\
EGeListAddAfter(&(__EGeDg_add_n_v->node_cn),&(__EGeDg_add_n_G->nodes));\
__EGeDg_add_n_G->n_nodes++;})
Definition at line 163 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraphNode_t*const __EGeDg_chg_hd_tail = (tail_pt);\
EGeUgraphEdge_t*const __EGeDg_chg_hd_e = (e);\
EGeUgraphEP_t*const __EGeDg_ep = &(__EGeDg_chg_hd_e->ep[ep_type]);\
__EGeDg_ep->node->degree--;\
EGeListDel(&(__EGeDg_ep->cn));\
EGeListAddAfter(&(__EGeDg_ep->cn),&(__EGeDg_chg_hd_tail->edges));\
__EGeDg_chg_hd_tail->degree++;\
__EGeDg_ep->node = __EGeDg_chg_hd_tail;})
Definition at line 238 of file eg_eugraph.h. |
|
|
Change the head of an edge.
Definition at line 268 of file eg_eugraph.h. |
|
|
Change the tail of an edge.
Definition at line 257 of file eg_eugraph.h. |
|
|
Clear the structure so that we can free it (without memory leaks). Note that this macro does nothing, because it is always safe to free this structure.
Definition at line 114 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraph_t*const __EGeDg_del_e_G = (G);\
EGeUgraphEdge_t*const __EGeDg_del_e = (e);\
EGeListDel(&(__EGeDg_del_e->ep[1].cn));\
EGeListDel(&(__EGeDg_del_e->ep[0].cn));\
__EGeDg_del_e->ep[1].node->degree--;\
__EGeDg_del_e->ep[0].node->degree--;\
__EGeDg_del_e_G->n_edges--;\
__EGeDg_del_e;})
Definition at line 218 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraph_t*const __EGeDg_del_n_G = (G);\
EGeUgraphNode_t*const __EGeDg_del_n = (v);\
if(__EGeDg_del_n->degree) EXIT(1,"trying to remove node "#v" with "\
"incoming edges from graph "#G);\
EGeListDel(&(__EGeDg_del_n->node_cn));\
__EGeDg_del_n_G->n_nodes--;\
__EGeDg_del_n;})
Definition at line 179 of file eg_eugraph.h. |
|
|
Clear the structure so that we can free it (without memory leaks). Note that this macro does nothing, because it is always safe to free this structure.
Definition at line 125 of file eg_eugraph.h. |
|
|
Initialize an edge as an empty edge, non attached to any graph.
Definition at line 119 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraphEP_t*const __EGeUg_ep = EGcontainerOf(edge_cn,EGeUgraphEP_t,cn);\
EGcontainerOf(__EGeUg_ep,EGeUgraphEdge_t,ep[__EGeUg_ep->type]);})
Definition at line 149 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraph_t*const __EGeDg_in_G = (G);\
EGeListInit(&(__EGeDg_in_G->nodes));\
__EGeDg_in_G->n_edges = __EGeDg_in_G->n_nodes = 0;})
Definition at line 105 of file eg_eugraph.h. |
|
|
Clear the structure so that we can free it (without memory leaks). Note that this macro does nothing, because it is always safe to free this structure.
Definition at line 140 of file eg_eugraph.h. |
|
|
Value: ({\
EGeUgraphNode_t*const __EGeDg_in_v = (v);\
EGeListInit(&(__EGeDg_in_v->edges));\
__EGeDg_in_v->node_cn = (EGeList_t){0,0};\
__EGeDg_in_v->degree = 0;})
Definition at line 130 of file eg_eugraph.h. |
|
|
structure that holds all graph related structures needed to define a directed graph, and to allow modifications over it.
|
|
|
structure that hold all edge related structures needed to define a directed graph, and add/delete/modify it's structure
|
|
|
Structure for endpoints of edges.
|
|
|
structure that hold all node related structures needed to define a graph, and add/delete/modify it's structure
|
|
|
example of an edge structure using the embeded substructures.
|
|
|
example of a graph structure using the embeded substructures.
|
|
|
example of a node structure using the embeded substructures.
|
|
|
Display the contents of our graph structure.
Definition at line 56 of file eg_eugraph.ex.c. |
|
|
A simple example of a directed graph using (EGdEgraph) structures.
Definition at line 97 of file eg_eugraph.ex.c. Here is the call graph for this function: ![]() |
1.4.5