CMR  1.3.0
Macros | Functions
graph.c File Reference
#include <cmr/graph.h>
#include "env_internal.h"
#include "hashtable.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>

Macros

#define isValid(nodeOrArc)    ((nodeOrArc) >= 0)
 

Functions

void CMRgraphEnsureConsistent (CMR *cmr, CMR_GRAPH *graph)
 
CMR_ERROR CMRgraphCreateEmpty (CMR *cmr, CMR_GRAPH **pgraph, int memNodes, int memEdges)
 Creates an empty graph. More...
 
CMR_ERROR CMRgraphFree (CMR *cmr, CMR_GRAPH **pgraph)
 Frees a graph. More...
 
CMR_ERROR CMRgraphClear (CMR *cmr, CMR_GRAPH *graph)
 Removes all nodes and columns, keeping the memory. More...
 
CMR_ERROR CMRgraphAddNode (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE *pnode)
 Adds a node to a graph. More...
 
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. More...
 
CMR_ERROR CMRgraphDeleteNode (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE v)
 Removes node v and all its incident edges from graph. More...
 
CMR_ERROR CMRgraphDeleteEdge (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_EDGE e)
 Removes edge e from graph. More...
 
CMR_ERROR CMRgraphPrint (CMR_GRAPH *graph, FILE *stream)
 Prints the graph, writing to stream. More...
 
CMR_ERROR CMRgraphMergeNodes (CMR *cmr, CMR_GRAPH *graph, CMR_GRAPH_NODE u, CMR_GRAPH_NODE v)
 Merges two nodes u and v of graph. More...
 
CMR_ERROR CMRgraphCreateFromEdgeList (CMR *cmr, CMR_GRAPH **pgraph, CMR_ELEMENT **pedgeElements, char ***pnodeLabels, FILE *stream)
 

Macro Definition Documentation

◆ isValid

#define isValid (   nodeOrArc)     ((nodeOrArc) >= 0)

Function Documentation

◆ CMRgraphEnsureConsistent()

void CMRgraphEnsureConsistent ( CMR cmr,
CMR_GRAPH graph 
)