INGOR
Public Member Functions | List of all members
ytGraph Class Reference

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. More...
 
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. More...
 
int ytGraph_numChildren (const ytGraph *g, int u)
 Returns the number of children. More...
 
void ytGraph_removeEdge (ytGraph *g, int u, int v)
 Removes the specified edge.
 
void ytGraph_print (const ytGraph *g, FILE *fp)
 
ytGraphEdgeIterytGraph_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 (ytGraph **pg, int root, MPI_Comm comm)
 [MPI] Broadcasts the graph to all the processes.
 
ytGraphytMapGraph_Graph (ytMapGraph *this)
 Casts to the ytGraph instance.
 

Detailed Description

Interface class for handling graph structure.

See also
ytObject, ytPCGraph, ytAdjGraph, ytCompleteGraph, ytCompleteGraphSL, ytNetwork

Member Function Documentation

◆ ytGraph_getChildren()

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.

Parameters
g
u

◆ ytGraph_getParents()

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.

Parameters
gytGraph instance.
uthe index of the node.

◆ ytGraph_numChildren()

int ytGraph_numChildren ( const ytGraph g,
int  u 
)

Returns the number of children.

Parameters
g
u

The documentation for this class was generated from the following files: