Files | |
| file | eg_edgraph.ex.c |
| file | eg_edgraph.h |
Data Structures | |
| struct | EGeDgraph_t |
| structure that holds all graph related structures needed to define a directed graph, and to allow modifications over it. More... | |
| struct | EGeDgraphEdge_t |
| structure that hold all edge related structures needed to define a directed graph, and add/delete/modify it's structure More... | |
| struct | EGeDgraphNode_t |
| structure that hold all node related structures needed to define a graph, and add/delete/modify it's structure More... | |
| struct | my_dedge_t |
| example of an edge structure using the embeded substructures. More... | |
| struct | my_dgraph_t |
| example of a graph structure using the embeded substructures. More... | |
| struct | my_dnode_t |
| example of a node structure using the embeded substructures. More... | |
Defines | |
| #define | EGeDgraphAddEdge(G, head_pt, tail_pt, e) |
| Add an edge to a graph. | |
| #define | EGeDgraphAddNode(G, v) |
| Add a node to the graph. | |
| #define | EGeDgraphChangeHead(G, e, head_pt) |
| Change the head of an edge. | |
| #define | EGeDgraphChangeTail(G, e, tail_pt) |
| Change the tail of an edge. | |
| #define | EGeDgraphClear(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 | EGeDgraphDelEdge(G, e) |
| Delete an edge from a graph. | |
| #define | EGeDgraphDelNode(G, v) |
| Remove a node from a graph. | |
| #define | EGeDgraphEdgeClear(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 | EGeDgraphEdgeInit(e) |
| Initialize an edge as an empty edge, non attached to any graph. | |
| #define | EGeDgraphEdgeReset(edge_pt) EGeDgraphEdgeInit(edge_pt) |
| Reset the given edge pointer as an edge not linked to a graph. | |
| #define | EGeDgraphInit(G) |
| Initialize a graph structure as an empty graph with no members. | |
| #define | EGeDgraphNodeClear(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 | EGeDgraphNodeInit(v) |
| Initialize a node as an empty non-attached node. | |
| #define | EGeDgraphNodeReset(node_pt) EGeDgraphNodeInit(node_pt) |
| Reset the given node pointer as a node not linked to a graph. | |
| #define | EGeDgraphReset(graph_pt) EGeDgraphInit(graph_pt) |
| Reset the given graph pointer as an empty graph. | |
Typedefs | |
| typedef EGeDgraph_t | EGeDgraph_t |
| structure that holds all graph related structures needed to define a directed graph, and to allow modifications over it. | |
| typedef EGeDgraphEdge_t | EGeDgraphEdge_t |
| structure that hold all edge related structures needed to define a directed graph, and add/delete/modify it's structure | |
| typedef EGeDgraphNode_t | EGeDgraphNode_t |
| structure that hold all node related structures needed to define a graph, and add/delete/modify it's structure | |
| typedef my_dedge_t | my_dedge_t |
| example of an edge structure using the embeded substructures. | |
| typedef my_dgraph_t | my_dgraph_t |
| example of a graph structure using the embeded substructures. | |
| typedef my_dnode_t | my_dnode_t |
| example of a node structure using the embeded substructures. | |
Functions | |
| static void | display_DG (my_dgraph_t *myG) |
| Display the contents of our graph structure. | |
| int | main (void) |
| A simple example of a directed graph using (EGdEgraph) structures. | |
|
|
Value: ({\
EGeDgraph_t*const __EGeDg_add_e_G = (G);\
EGeDgraphNode_t*const __EGeDg_add_e_head = (head_pt);\
EGeDgraphNode_t*const __EGeDg_add_e_tail = (tail_pt);\
EGeDgraphEdge_t*const __EGeDg_add_e = (e);\
EGeListAddAfter(&(__EGeDg_add_e->head_cn),&(__EGeDg_add_e_head->in_edge));\
EGeListAddAfter(&(__EGeDg_add_e->tail_cn),&(__EGeDg_add_e_tail->out_edge));\
__EGeDg_add_e->head = __EGeDg_add_e_head;\
__EGeDg_add_e->tail = __EGeDg_add_e_tail;\
__EGeDg_add_e_head->in_size++;\
__EGeDg_add_e_tail->out_size++;\
__EGeDg_add_e_G->n_edges++;})
Definition at line 196 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraph_t*const __EGeDg_add_n_G = (G);\
EGeDgraphNode_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 162 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraphNode_t*const __EGeDg_chg_hd_head = (head_pt);\
EGeDgraphEdge_t*const __EGeDg_chg_hd_e = (e);\
__EGeDg_chg_hd_e->head->in_size--;\
EGeListDel(&(__EGeDg_chg_hd_e->head_cn));\
EGeListAddAfter(&(__EGeDg_chg_hd_e->head_cn),&(__EGeDg_chg_hd_head->in_edge));\
__EGeDg_chg_hd_head->in_size++;\
__EGeDg_chg_hd_e->head = __EGeDg_chg_hd_head;})
Definition at line 256 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraphNode_t*const __EGeDg_chg_hd_tail = (tail_pt);\
EGeDgraphEdge_t*const __EGeDg_chg_hd_e = (e);\
__EGeDg_chg_hd_e->tail->out_size--;\
EGeListDel(&(__EGeDg_chg_hd_e->tail_cn));\
EGeListAddAfter(&(__EGeDg_chg_hd_e->tail_cn),&(__EGeDg_chg_hd_tail->out_edge));\
__EGeDg_chg_hd_tail->out_size++;\
__EGeDg_chg_hd_e->tail = __EGeDg_chg_hd_tail;})
Definition at line 238 of file eg_edgraph.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 109 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraph_t*const __EGeDg_del_e_G = (G);\
EGeDgraphEdge_t*const __EGeDg_del_e = (e);\
EGeListDel(&(__EGeDg_del_e->head_cn));\
EGeListDel(&(__EGeDg_del_e->tail_cn));\
__EGeDg_del_e->head->in_size--;\
__EGeDg_del_e->tail->out_size--;\
__EGeDg_del_e_G->n_edges--;\
__EGeDg_del_e;})
Definition at line 219 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraph_t*const __EGeDg_del_n_G = (G);\
EGeDgraphNode_t*const __EGeDg_del_n = (v);\
if(__EGeDg_del_n->in_size) EXIT(1,"trying to remove node "#v" with "\
"incoming edges from graph "#G);\
if(__EGeDg_del_n->out_size) EXIT(1,"trying to remove node "#v" with "\
"outgoing edges from graph "#G);\
EGeListDel(&(__EGeDg_del_n->node_cn));\
__EGeDg_del_n_G->n_nodes--;\
__EGeDg_del_n;})
Definition at line 178 of file eg_edgraph.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 129 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraphEdge_t*const __EGeDg_in_e = (e);\
__EGeDg_in_e->head_cn = (EGeList_t){0,0};\
__EGeDg_in_e->tail_cn = (EGeList_t){0,0};\
__EGeDg_in_e->head = __EGeDg_in_e->tail = 0;})
Definition at line 114 of file eg_edgraph.h. |
|
|
Reset the given edge pointer as an edge not linked to a graph.
Definition at line 123 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraph_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 95 of file eg_edgraph.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 150 of file eg_edgraph.h. |
|
|
Value: ({\
EGeDgraphNode_t*const __EGeDg_in_v = (v);\
EGeListInit(&(__EGeDg_in_v->in_edge));\
EGeListInit(&(__EGeDg_in_v->out_edge));\
__EGeDg_in_v->node_cn = (EGeList_t){0,0};\
__EGeDg_in_v->in_size = __EGeDg_in_v->out_size = 0;})
Definition at line 134 of file eg_edgraph.h. |
|
|
Reset the given node pointer as a node not linked to a graph.
Definition at line 144 of file eg_edgraph.h. |
|
|
Reset the given graph pointer as an empty graph.
Definition at line 103 of file eg_edgraph.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 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_edgraph.ex.c. |
|
|
A simple example of a directed graph using (EGdEgraph) structures.
Definition at line 105 of file eg_edgraph.ex.c. Here is the call graph for this function: ![]() |
1.4.5