INGOR
|
Interface class for handling graph structure. More...
#include <math/ytGraph.h>
Public Member Functions | |
int | ytGraph_numNodes (const ytGraph *g) |
Returns the number of nodes in the graph. | |
int | ytGraph_numEdges (const ytGraph *g) |
Returns the number of edges in the graph. | |
int | ytGraph_checkEdge (const ytGraph *g, int u, int v) |
Checks if the specified edge exists. | |
const int * | ytGraph_getParents (const ytGraph *g, int u) |
Returns the integer array that contains the indices of parents of the specifiec node. | |
int | ytGraph_numParents (const ytGraph *g, int u) |
Return the number of parents for the specified node. | |
const int * | ytGraph_getChildren (const ytGraph *g, int u) |
Returns the integer array that contains the indices of children. | |
int | ytGraph_numChildren (const ytGraph *g, int u) |
Returns the number of children. | |
void | ytGraph_removeEdge (ytGraph *g, int u, int v) |
Removes the specified edge. | |
void | ytGraph_print (const ytGraph *g, FILE *fp) |
ytGraphEdgeIter * | ytGraph_edgeIter (const ytGrpah *g) |
Returns the ytGraphEdgeIter instance representing the first edge. | |
void | ytGraph_edgeIterNext (const ytGraph *g, ytGraphEdgeIter *i) |
Obtains the next edge. | |
void | ytGraph_MPI_Bcast (ytObject **pg, int root, MPI_Comm comm) |
[MPI] Broadcasts the graph to all the processes. | |
ytGraph * | ytMapGraph_Graph (ytMapGraph *this) |
Casts to the ytGraph instance. | |
Interface class for handling graph structure.
const int * ytGraph_getChildren | ( | const ytGraph * | g, |
int | u | ||
) |
Returns the integer array that contains the indices of children.
This may return the internal buffer to return the indices. This means that the contents of the returned pointer may change if you call this or ytGraph_getParents() for another node. If you need to keep multiple sets of parents or chilren for different nodes, you need to copy them somewhere.
g | |
u |
const int * ytGraph_getParents | ( | const ytGraph * | g, |
int | u | ||
) |
Returns the integer array that contains the indices of parents of the specifiec node.
This may return the internal buffer to return the indices. This means that the contents of the returned pointer may change if you call this or ytGraph_getChildren() for another node. If you need to keep multiple sets of parents or chilren for different nodes, you need to copy them somewhere.
g | ytGraph instance. |
u | the index of the node. |
int ytGraph_numChildren | ( | const ytGraph * | g, |
int | u | ||
) |
Returns the number of children.
g | |
u |