297 if ((graph->
arcs[i].
target != (graph)->arcs[i ^ 1].target) || !(i & 0x1))
337 if (((graph)->arcs[i].target != (graph)->arcs[i ^ 1].target) || !(i & 0x1))
Functionality for the row and column elements of a matrix.
int CMR_ELEMENT
Definition: element.h:20
Basic functionality of the software library.
#define CMR_UNUSED(x)
Definition: env.h:24
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:32
int CMR_GRAPH_NODE
Reference to a node of CMR_GRAPH.
Definition: graph.h:30
static CMR_GRAPH_EDGE CMRgraphEdgesEdge(CMR_GRAPH *graph, CMR_GRAPH_ITER i)
Returns the actual edge, iterator i represents.
Definition: graph.h:461
CMR_EXPORT CMR_ERROR CMRgraphCreateEmpty(CMR *cmr, CMR_GRAPH **pgraph, int memNodes, int memEdges)
Creates an empty graph.
Definition: graph.c:93
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.
Definition: graph.h:347
static size_t CMRgraphNumNodes(CMR_GRAPH *graph)
Returns number of nodes.
Definition: graph.h:81
static size_t CMRgraphMemEdges(CMR_GRAPH *graph)
Returns number of edges for which memory is allocated.
Definition: graph.h:95
static size_t CMRgraphMemNodes(CMR_GRAPH *graph)
Returns number of nodes for which memory is allocated.
Definition: graph.h:67
static CMR_GRAPH_NODE CMRgraphIncTarget(CMR_GRAPH *graph, CMR_GRAPH_ITER i)
Returns the end node of the edge corresponding to this iterator i.
Definition: graph.h:377
CMR_EXPORT CMR_ERROR CMRgraphPrint(CMR_GRAPH *graph, FILE *stream)
Prints the graph, writing to stream.
Definition: graph.c:381
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.
Definition: graph.c:400
static bool CMRgraphEdgesValid(CMR_GRAPH *graph, CMR_GRAPH_ITER i)
Returns true if and only if iterator i for all edges is valid.
Definition: graph.h:444
static bool CMRgraphIncValid(CMR_GRAPH *graph, CMR_GRAPH_ITER i)
Returns true if iterator i for all incident edges of some node is valid.
Definition: graph.h:308
static CMR_GRAPH_NODE CMRgraphNodesNext(CMR_GRAPH *graph, CMR_GRAPH_NODE v)
Returns the next node after v.
Definition: graph.h:270
static CMR_GRAPH_ITER CMRgraphEdgesNext(CMR_GRAPH *graph, CMR_GRAPH_ITER i)
Returns iterator of next edge in list of all edges.
Definition: graph.h:390
static CMR_GRAPH_ITER CMRgraphEdgesFirst(CMR_GRAPH *graph)
Returns iterator for all edges of graph.
Definition: graph.h:418
CMR_EXPORT CMR_ERROR CMRgraphAddNode(CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE *pnode)
Adds a node to a graph.
Definition: graph.c:181
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.
Definition: graph.h:325
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.
Definition: graph.c:227
CMR_EXPORT CMR_ERROR CMRgraphDeleteEdge(CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_EDGE e)
Removes edge e from graph.
Definition: graph.c:329
static CMR_GRAPH_NODE CMRgraphEdgeU(CMR_GRAPH *graph, CMR_GRAPH_EDGE e)
Returns node u of edge e.
Definition: graph.h:123
static size_t CMRgraphNumEdges(CMR_GRAPH *graph)
Returns number of edges.
Definition: graph.h:109
CMR_EXPORT CMR_ERROR CMRgraphCopy(CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH **pcopy)
Definition: graph.c:598
CMR_EXPORT CMR_ERROR CMRgraphCreateFromEdgeList(CMR *cmr, CMR_GRAPH **pgraph, CMR_ELEMENT **pedgeElements, char ***pnodeLabels, FILE *stream)
Definition: graph.c:430
static CMR_GRAPH_NODE CMRgraphNodesFirst(CMR_GRAPH *graph)
Returns a node iterator for iterating over all nodes.
Definition: graph.h:239
static CMR_GRAPH_NODE CMRgraphEdgeV(CMR_GRAPH *graph, CMR_GRAPH_EDGE e)
Returns node v of edge e.
Definition: graph.h:138
int CMR_GRAPH_ITER
Reference to an edge iterator of CMR_GRAPH.
Definition: graph.h:32
CMR_EXPORT CMR_ERROR CMRgraphClear(CMR *cmr, CMR_GRAPH *graph)
Removes all nodes and columns, keeping the memory.
Definition: graph.c:155
CMR_EXPORT CMR_ERROR CMRgraphDeleteNode(CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE v)
Removes node v and all its incident edges from graph.
Definition: graph.c:292
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.
Definition: graph.h:253
int CMR_GRAPH_EDGE
Reference to an edge of CMR_GRAPH.
Definition: graph.h:31
CMR_EXPORT CMR_ERROR CMRgraphFree(CMR *cmr, CMR_GRAPH **pgraph)
Frees a graph.
Definition: graph.c:130
static CMR_GRAPH_ITER CMRgraphIncFirst(CMR_GRAPH *graph, CMR_GRAPH_NODE v)
Returns an iterator for all edges incident to node v.
Definition: graph.h:285
static CMR_GRAPH_NODE CMRgraphIncSource(CMR_GRAPH *graph, CMR_GRAPH_ITER i)
Returns the node of which iterator i traverses through incident edges.
Definition: graph.h:364
Definition: env_internal.h:45
int prev
Next arc in out-arc list of source node.
Definition: graph.h:44
int next
Previous arc in out-arc list of source node.
Definition: graph.h:45
int target
Target node of this arc.
Definition: graph.h:43
int prev
Next node in node list.
Definition: graph.h:36
int firstOut
First out-arc of this node.
Definition: graph.h:38
int next
Previous node in node list.
Definition: graph.h:37
CMR_GRAPH_ARC_DATA * arcs
Array containing arc data.
Definition: graph.h:58
size_t memNodes
Number of nodes for which memory is allocated.
Definition: graph.h:51
size_t numNodes
Number of nodes.
Definition: graph.h:50
CMR_GRAPH_NODE_DATA * nodes
Array containing node data.
Definition: graph.h:52
size_t numEdges
Number of edges.
Definition: graph.h:56
size_t memEdges
Number of edges for which memory is allocated.
Definition: graph.h:57
int freeEdge
Beginning of free-list of arc.
Definition: graph.h:59
int freeNode
Beginning of free-list of nodes.
Definition: graph.h:54
int firstNode
Index of first node.
Definition: graph.h:53