|
INGOR
|
Public Member Functions | |
| int | ytAdjGraph_numChildren (const ytAdjGraph *this, int j) |
| Returns the number of children of the specified node. | |
| const int * | ytAdjGraph_getParents (const ytAdjGraph *this, int j) |
| Returns the pointer to the parents. | |
| const int * | ytDBNGraph_getParents (const ytDBNGraph *this, int j) |
| Returns the pointer to the parents. | |
| ytPCGraph * | ytPCGraph_new (int nodes) |
| Generates the new ytPCGraph instance. | |
| ytObject * | ytPCGraph_obj (ytPCGraph *this) |
| Returns the pointer to the ytObject of this instance. | |
| ytPCGraph * | ytPCGraph_clone (const ytPCGraph *this) |
| Returns a clone (deep copy) of this instance. | |
| void | ytPCGraph_delete (ytPCGraph *this) |
| Deletes the ytPCGraph instance. | |
| ytGraph * | ytPCGraph_Graph (ytPCGraph *this) |
| ytPCGraph * | ytPCGraph_from_Graph (ytGraph *this) |
| Returns the pointer to the ytPCGraph from ytGraph. | |
| void | ytPCGraph_clear (ytPCGraph *this) |
| Removes all the edges. | |
| int | ytPCGraph_numNodes (const ytPCGraph *this) |
| Returns the number of nodes in the graph. | |
| int | ytPCGraph_checkEdge (const ytPCGraph *this, int src, int dst) |
| Checks if the specified edge exists in the graph. | |
| int | ytPCGraph_numParents (const ytPCGraph *this, int j) |
| Returns the number of parents of the specified node. | |
| int | ytPCGraph_numChildren (const ytPCGraph *this, int j) |
| Returns the number of children of the specified node. | |
| int | ytPCGraph_numEdges (const ytPCGraph *this) |
| Returns the number of edges in the graph. | |
| int | ytPCGraph_degree (const ytPCGraph *this, int j) |
| Returns the number of edges connected to the node. | |
| int | ytPCGraph_getParent (const ytPCGraph *this, int j, int k) |
| Returns the parent index of the node. | |
| int | ytPCGraph_getChild (const ytPCGraph *this, int j, int k) |
| Returns the child index of the node. | |
| const int * | ytPCGraph_getParents (const ytPCGraph *this, int j) |
| Returns the pointer to the parents. | |
| const int * | ytPCGraph_getChildren (const ytPCGraph *this, int j) |
| Returns the pointer to the children. | |
| void | ytPCGraph_addEdge (ytPCGraph *this, int src, int dst) |
| Adds an edge to the graph. | |
| void | ytPCGraph_removeEdge (ytPCGraph *this, int src, int dst) |
| Removes the edge. | |
| int | ytPCGraph_removeLastEdge (ytPCGraph *this, int src, int dst) |
| Removes the last edge. | |
| void | ytPCGraph_copy (ytPCGraph *this, const ytPCGraph *src) |
| Copies edges to this graph. | |
| void | ytPCGraph_copyGraph (ytPCGraph *this, const ytGraph *src) |
| Copies edges to this graph. | |
| void | ytPCGraph_addGraph (ytPCGraph *this, const ytGraph *src) |
| Adds edges in the given graph into this graph. | |
| const int * ytAdjGraph_getParents | ( | const ytAdjGraph * | this, |
| int | j | ||
| ) |
Returns the pointer to the parents.
| this | |
| j |
| int ytAdjGraph_numChildren | ( | const ytAdjGraph * | this, |
| int | j | ||
| ) |
Returns the number of children of the specified node.
Note: This requires O(n) time where n is the number of nodes.
| this | pointer to the ytAdjGraph instance. |
| j | node index. |
| const int * ytDBNGraph_getParents | ( | const ytDBNGraph * | this, |
| int | j | ||
| ) |
Returns the pointer to the parents.
The returned pointer may be invalid after calling functions that affects the structure of the graph.
| this | |
| j |
| void ytPCGraph_addEdge | ( | ytPCGraph * | 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.
| this | |
| src | index of the source node. |
| dst | index of the destination node. |
Adds edges in the given graph into this graph.
This checks if the edge in the source graph already exists in this graph.
| this | pointer to the ytPCGraph instance. |
| src | source graph. |
| int ytPCGraph_checkEdge | ( | const ytPCGraph * | this, |
| int | src, | ||
| int | dst | ||
| ) |
Checks if the specified edge exists in the graph.
| this | pointer to the ytPCGraph instance. NULL acceptable. If so, this always returns 0. |
| src | index of starting node of the edge. |
| dst | index of ending node of the edge. |
| void ytPCGraph_clear | ( | ytPCGraph * | this | ) |
Removes all the edges.
| this | pointer to the ytPCGraph instance. |
Copies edges to this graph.
The current edges in this graph are removed, then edges in src are copied into this graph.
| this | |
| src |
Copies edges to this graph.
The current edges in this graph are removed, then edges in src are copied into this graph.
| this | |
| src |
| int ytPCGraph_degree | ( | const ytPCGraph * | this, |
| int | j | ||
| ) |
Returns the number of edges connected to the node.
| this | |
| j |
| void ytPCGraph_delete | ( | ytPCGraph * | this | ) |
Deletes the ytPCGraph instance.
| this | pointer to the ytPCGraph instance to delete. |
| int ytPCGraph_getChild | ( | const ytPCGraph * | this, |
| int | j, | ||
| int | k | ||
| ) |
Returns the child index of the node.
| this | pointer to the ytPCGraph instance. |
| j | node index. |
| k | child index. |
| const int * ytPCGraph_getChildren | ( | const ytPCGraph * | this, |
| int | j | ||
| ) |
Returns the pointer to the children.
| this | |
| j |
| int ytPCGraph_getParent | ( | const ytPCGraph * | this, |
| int | j, | ||
| int | k | ||
| ) |
Returns the parent index of the node.
| this | pointer to the ytPCGraph instance. |
| j | node index. |
| k | parent index. |
| const int * ytPCGraph_getParents | ( | const ytPCGraph * | this, |
| int | j | ||
| ) |
Returns the pointer to the parents.
The returned pointer may be invalid after calling functions that affects the structure of the graph.
| this | |
| j |
| ytPCGraph * ytPCGraph_new | ( | int | nodes | ) |
Generates the new ytPCGraph instance.
Use ytPCGraph_delete() to releases the resources allocated by this function.
| int ytPCGraph_numChildren | ( | const ytPCGraph * | this, |
| int | j | ||
| ) |
Returns the number of children of the specified node.
| this | pointer to the ytPCGraph instance. |
| j | node index. |
| int ytPCGraph_numEdges | ( | const ytPCGraph * | this | ) |
Returns the number of edges in the graph.
| this | pointer to the ytPCGraph instance. |
| int ytPCGraph_numNodes | ( | const ytPCGraph * | this | ) |
Returns the number of nodes in the graph.
| this | pointer to the ytPCGraph instance. |
| int ytPCGraph_numParents | ( | const ytPCGraph * | this, |
| int | j | ||
| ) |
Returns the number of parents of the specified node.
| this | pointer to the ytPCGraph instance. |
| j | node index. |
| void ytPCGraph_removeEdge | ( | ytPCGraph * | this, |
| int | src, | ||
| int | dst | ||
| ) |
Removes the edge.
| this | |
| src | |
| dst |
| int ytPCGraph_removeLastEdge | ( | ytPCGraph * | this, |
| int | src, | ||
| int | dst | ||
| ) |
Removes the last edge.
If the (src, dst) edge is not the last edge added, this fails to remove it and returns 1. Otherwise, that is, on successful, returns 0.
| this | |
| src | |
| dst |