INGOR
Public Member Functions | List of all members
ytPGraph Struct Reference

Public Member Functions

ytPGraphytPGraph_new (int nodes)
 Generates the new ytPGraph instance.
 
void ytPGraph_delete (ytPGraph *this)
 Deletes the ytPGraph instance. More...
 
void ytPGraph_clear (ytPGraph *this)
 Removes all the edges. More...
 
int ytPGraph_numNodes (const ytPGraph *this)
 Returns the number of nodes in the graph. More...
 
int ytPGraph_checkEdge (const ytPGraph *this, int src, int dst)
 Checks if the specified edge exists in the graph. More...
 
int ytPGraph_numParents (const ytPGraph *this, int j)
 Returns the number of parents of the specified node. More...
 
int ytPGraph_getParent (const ytPGraph *this, int j, int k)
 Returns the parent index of the node. More...
 
void ytPGraph_addEdge (ytPGraph *this, int src, int dst)
 Adds an edge to the graph. More...
 
void ytPGraph_copy (ytPGraph *this, const ytPGraph *src)
 Copies edges to this graph. More...
 
void ytPGraph_copyGraph (ytPGraph *this, const ytGraph *src)
 Copies edges to this graph. More...
 

Member Function Documentation

◆ ytPGraph_addEdge()

void ytPGraph_addEdge ( ytPGraph this,
int  src,
int  dst 
)

Adds an edge to the graph.

This does not check whether the src - dst edge exists already in the graph.

Parameters
this
src
dst

◆ ytPGraph_checkEdge()

int ytPGraph_checkEdge ( const ytPGraph this,
int  src,
int  dst 
)

Checks if the specified edge exists in the graph.

Parameters
thispointer to the ytPGraph instance. NULL acceptable. If so, this always returns 0.
srcindex of starting node of the edge.
dstindex of ending node of the edge.
Returns
1 if the edge exists, or 0 otherwise.

◆ ytPGraph_clear()

void ytPGraph_clear ( ytPGraph this)

Removes all the edges.

Parameters
thispointer to the ytPGraph instance.

◆ ytPGraph_copy()

void ytPGraph_copy ( ytPGraph this,
const ytPGraph src 
)

Copies edges to this graph.

The current edges in this graph are removed, then edges in src are copied into this graph.

Parameters
this
src
See also
ytPGraph_copyGraph()

◆ ytPGraph_copyGraph()

void ytPGraph_copyGraph ( ytPGraph this,
const ytGraph src 
)

Copies edges to this graph.

The current edges in this graph are removed, then edges in src are copied into this graph.

Parameters
this
src
See also
ytPGraph_copy()

◆ ytPGraph_delete()

void ytPGraph_delete ( ytPGraph this)

Deletes the ytPGraph instance.

Parameters
this

◆ ytPGraph_getParent()

int ytPGraph_getParent ( const ytPGraph this,
int  j,
int  k 
)

Returns the parent index of the node.

Parameters
thispointer to the ytPGraph instance.
jnode index.
kparent index.
Returns
index of the k -th parent of the j -th node.

◆ ytPGraph_numNodes()

int ytPGraph_numNodes ( const ytPGraph this)

Returns the number of nodes in the graph.

Parameters
thispointer to the ytPGraph instance.

◆ ytPGraph_numParents()

int ytPGraph_numParents ( const ytPGraph this,
int  j 
)

Returns the number of parents of the specified node.

Parameters
thispointer to the ytPGraph instance.
jnode index.
Returns
the number of parents of the j -th node.

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