![]() |
CMR
1.3.0
|
Classes | |
| struct | CMR_GRAPH_NODE_DATA |
| struct | CMR_GRAPH_ARC_DATA |
| struct | CMR_GRAPH |
Typedefs | |
| typedef int | CMR_GRAPH_NODE |
| Reference to a node of CMR_GRAPH. | |
| typedef int | CMR_GRAPH_EDGE |
| Reference to an edge of CMR_GRAPH. | |
| typedef int | CMR_GRAPH_ITER |
| Reference to an edge iterator of CMR_GRAPH. | |
Functions | |
| static size_t | CMRgraphMemNodes (CMR_GRAPH *graph) |
| Returns number of nodes for which memory is allocated. | |
| static size_t | CMRgraphNumNodes (CMR_GRAPH *graph) |
| Returns number of nodes. | |
| static size_t | CMRgraphMemEdges (CMR_GRAPH *graph) |
| Returns number of edges for which memory is allocated. | |
| static size_t | CMRgraphNumEdges (CMR_GRAPH *graph) |
| Returns number of edges. | |
| static CMR_GRAPH_NODE | CMRgraphEdgeU (CMR_GRAPH *graph, CMR_GRAPH_EDGE e) |
Returns node u of edge e. | |
| static CMR_GRAPH_NODE | CMRgraphEdgeV (CMR_GRAPH *graph, CMR_GRAPH_EDGE e) |
Returns node v of edge e. | |
| CMR_EXPORT CMR_ERROR | CMRgraphCreateEmpty (CMR *cmr, CMR_GRAPH **pgraph, int memNodes, int memEdges) |
| Creates an empty graph. | |
| CMR_EXPORT CMR_ERROR | CMRgraphFree (CMR *cmr, CMR_GRAPH **pgraph) |
| Frees a graph. | |
| CMR_EXPORT CMR_ERROR | CMRgraphClear (CMR *cmr, CMR_GRAPH *graph) |
| Removes all nodes and columns, keeping the memory. | |
| CMR_EXPORT CMR_ERROR | CMRgraphAddNode (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE *pnode) |
| Adds a node to a graph. | |
| CMR_EXPORT CMR_ERROR | CMRgraphAddEdge (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE u, CMR_GRAPH_NODE v, CMR_GRAPH_EDGE *pedge) |
| Adds an edge to a graph. | |
| CMR_EXPORT CMR_ERROR | CMRgraphDeleteNode (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE v) |
Removes node v and all its incident edges from graph. | |
| CMR_EXPORT CMR_ERROR | CMRgraphDeleteEdge (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_EDGE e) |
Removes edge e from graph. | |
| static CMR_GRAPH_NODE | CMRgraphNodesFirst (CMR_GRAPH *graph) |
| Returns a node iterator for iterating over all nodes. | |
| static bool | CMRgraphNodesValid (CMR_GRAPH *graph, CMR_GRAPH_NODE v) |
Return true if and only if this v is not the last node in node iteration. | |
| static CMR_GRAPH_NODE | CMRgraphNodesNext (CMR_GRAPH *graph, CMR_GRAPH_NODE v) |
Returns the next node after v. | |
| static CMR_GRAPH_ITER | CMRgraphIncFirst (CMR_GRAPH *graph, CMR_GRAPH_NODE v) |
Returns an iterator for all edges incident to node v. | |
| static bool | CMRgraphIncValid (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
Returns true if iterator i for all incident edges of some node is valid. | |
| static CMR_GRAPH_ITER | CMRgraphIncNext (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
Returns the iterator following iterator i for all edges incident to some node. | |
| static CMR_GRAPH_EDGE | CMRgraphIncEdge (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
| Converts an iterator for edges incident to a node to the actual edge. | |
| static CMR_GRAPH_NODE | CMRgraphIncSource (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
Returns the node of which iterator i traverses through incident edges. | |
| static CMR_GRAPH_NODE | CMRgraphIncTarget (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
Returns the end node of the edge corresponding to this iterator i. | |
| static CMR_GRAPH_ITER | CMRgraphEdgesNext (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
| Returns iterator of next edge in list of all edges. | |
| static CMR_GRAPH_ITER | CMRgraphEdgesFirst (CMR_GRAPH *graph) |
Returns iterator for all edges of graph. | |
| static bool | CMRgraphEdgesValid (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
Returns true if and only if iterator i for all edges is valid. | |
| static CMR_GRAPH_EDGE | CMRgraphEdgesEdge (CMR_GRAPH *graph, CMR_GRAPH_ITER i) |
Returns the actual edge, iterator i represents. | |
| CMR_EXPORT CMR_ERROR | CMRgraphPrint (CMR_GRAPH *graph, FILE *stream) |
Prints the graph, writing to stream. | |
| CMR_EXPORT CMR_ERROR | CMRgraphMergeNodes (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE u, CMR_GRAPH_NODE v) |
Merges two nodes u and v of graph. | |
| CMR_EXPORT CMR_ERROR | CMRgraphCreateFromEdgeList (CMR *cmr, CMR_GRAPH **pgraph, CMR_ELEMENT **pedgeElements, char ***pnodeLabels, FILE *stream) |
| CMR_EXPORT CMR_ERROR | CMRgraphCopy (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH **pcopy) |
Undirected graphs.
| typedef int CMR_GRAPH_EDGE |
Reference to an edge of CMR_GRAPH.
| typedef int CMR_GRAPH_ITER |
Reference to an edge iterator of CMR_GRAPH.
| typedef int CMR_GRAPH_NODE |
Reference to a node of CMR_GRAPH.
| CMR_EXPORT CMR_ERROR CMRgraphAddEdge | ( | CMR * | cmr, |
| CMR_GRAPH * | graph, | ||
| CMR_GRAPH_NODE | u, | ||
| CMR_GRAPH_NODE | v, | ||
| CMR_GRAPH_EDGE * | pedge | ||
| ) |
Adds an edge to a graph.
Adds an edge to a graph.
| cmr | CMR environment. |
| graph | Graph. |
| u | One node of the edge. |
| v | Other node of the edge. |
| pedge | Pointer for storinge the new edge, or NULL. |
| CMR_EXPORT CMR_ERROR CMRgraphAddNode | ( | CMR * | cmr, |
| CMR_GRAPH * | graph, | ||
| CMR_GRAPH_NODE * | pnode | ||
| ) |
Adds a node to a graph.
Adds a node to a graph.
| cmr | CMR environment. |
| graph | Graph. |
| pnode | Pointer for storing the new node, or NULL. |
Removes all nodes and columns, keeping the memory.
| cmr | CMR environment. |
| graph | Graph structure. |
| cmr | CMR environment. |
| graph | Graph structure. |
| pcopy | Pointer for storing the copied graph. |
| CMR_EXPORT CMR_ERROR CMRgraphCreateEmpty | ( | CMR * | cmr, |
| CMR_GRAPH ** | pgraph, | ||
| int | memNodes, | ||
| int | memEdges | ||
| ) |
Creates an empty graph.
| cmr | CMR environment. |
| pgraph | Pointer for storing the graph. |
| memNodes | Allocate memory for this number of nodes. |
| memEdges | Allocate memory for this number of edges. |
| CMR_EXPORT CMR_ERROR CMRgraphCreateFromEdgeList | ( | CMR * | cmr, |
| CMR_GRAPH ** | pgraph, | ||
| CMR_ELEMENT ** | pedgeElements, | ||
| char *** | pnodeLabels, | ||
| FILE * | stream | ||
| ) |
| cmr | CMR environment. |
| pgraph | Pointer for storing the graph. |
| pedgeElements | Pointer for storing element of each edge (may be NULL). |
| pnodeLabels | Pointer for storing string node labels (may be NULL). |
| stream | File stream to read from. |
| CMR_EXPORT CMR_ERROR CMRgraphDeleteEdge | ( | CMR * | cmr, |
| CMR_GRAPH * | graph, | ||
| CMR_GRAPH_EDGE | e | ||
| ) |
Removes edge e from graph.
| cmr | CMR environment. |
| graph | Graph. |
| e | Edge to be deleted. |
| CMR_EXPORT CMR_ERROR CMRgraphDeleteNode | ( | CMR * | cmr, |
| CMR_GRAPH * | graph, | ||
| CMR_GRAPH_NODE | v | ||
| ) |
Removes node v and all its incident edges from graph.
| cmr | CMR environment. |
| graph | Graph. |
| v | Node to be deleted. |
|
inlinestatic |
Returns the actual edge, iterator i represents.
| graph | Graph structure. |
| i | Iterator for edges. |
|
inlinestatic |
Returns iterator for all edges of graph.
| graph | Graph. |
|
inlinestatic |
Returns iterator of next edge in list of all edges.
| graph | Graph. |
| i | Current edge iterator. |
|
inlinestatic |
Returns true if and only if iterator i for all edges is valid.
| graph | Graph structure. |
| i | Iterator for edges incident to a node. |
|
inlinestatic |
Returns node u of edge e.
| graph | Graph. |
| e | Edge of graph. |
|
inlinestatic |
Returns node v of edge e.
| graph | Graph. |
| e | Edge of graph. |
Frees a graph.
| cmr | CMR environment. |
| pgraph | Pointer to graph. |
|
inlinestatic |
Converts an iterator for edges incident to a node to the actual edge.
| graph | Graph. |
| i | Iterator for edges incident to a node. |
|
inlinestatic |
Returns an iterator for all edges incident to node v.
| graph | Graph. |
| v | Node. |
|
inlinestatic |
Returns the iterator following iterator i for all edges incident to some node.
| graph | Graph. |
| i | Iterator for edges incident to a node. |
|
inlinestatic |
Returns the node of which iterator i traverses through incident edges.
| graph | Graph structure. |
| i | Iterator for edges incident to a node. |
|
inlinestatic |
Returns the end node of the edge corresponding to this iterator i.
| graph | Graph structure. |
| i | Iterator for edges incident to a node. |
|
inlinestatic |
Returns true if iterator i for all incident edges of some node is valid.
| graph | Graph structure. |
| i | Iterator for edges incident to a node. |
|
inlinestatic |
Returns number of edges for which memory is allocated.
| graph | Graph. |
|
inlinestatic |
Returns number of nodes for which memory is allocated.
| graph | Graph. |
| CMR_EXPORT CMR_ERROR CMRgraphMergeNodes | ( | CMR * | cmr, |
| CMR_GRAPH * | graph, | ||
| CMR_GRAPH_NODE | u, | ||
| CMR_GRAPH_NODE | v | ||
| ) |
Merges two nodes u and v of graph.
| cmr | CMR environment. |
| graph | Graph. |
| u | First node. |
| v | Second node. |
|
inlinestatic |
Returns a node iterator for iterating over all nodes.
| graph | Graph. |
|
inlinestatic |
Returns the next node after v.
| graph | Graph. |
| v | Node. |
|
inlinestatic |
Return true if and only if this v is not the last node in node iteration.
| graph | Graph. |
| v | Node. |
|
inlinestatic |
Returns number of edges.
| graph | Graph. |
|
inlinestatic |
Returns number of nodes.
| graph | Graph. |