Commit d18070fd by Gaspard Ducamp

[PyAgrum/doc] several doc added regarding graph manipulation

parent 51ae5b1c
Pipeline #13235208 passed with stage
in 53 seconds
%feature("docstring") gum::CliqueGraph
"
CliqueGraph represents a Clique Graph.
Available constructors:
``CliqueGraph() -> CliqueGraph``
``CliqueGraph(src) -> CliqueGraph``
Parameters
----------
src : :class: CliqueGraph
the CliqueGraph to copy
"
%feature("docstring") gum::CliqueGraph::addToClique
"
Change the set of nodes included into a given clique and returns the new set
Parameters
----------
clique_id : int
the id of the clique
node_id : int
the id of the node
Warnings
--------
NotFound raised if clique_id does not exist
Warnings
--------
DuplicateElement raised if clique_id set already contains the ndoe
"
%feature("docstring") gum::CliqueGraph::clearEdges
"
Remove all edges and their separators
"
%feature("docstring") gum::CliqueGraph::clique
"
Parameters
----------
idClique : int
the id of the clique
Returns
-------
Set
The set of nodes included in the clique
Warnings
--------
NotFound raised if the clique does not belong to the clique graph
"
%feature("docstring") gum::CliqueGraph::container
"
Parameters
----------
idNode : int
the id of the node
Returns
-------
int
the id of a clique containing the node
Warnings
--------
NotFound raised if no clique contains idNode
"
%feature("docstring") gum::CliqueGraph::containerPath
"
Parameters
----------
node1 : int
the id of one node
node2 : int
the id of the other node
Returns
-------
List
a path from a clique containing node1 to a clique containing node2
Warnings
--------
NotFound raised if such path cannot be found
"
%feature("docstring") gum::CliqueGraph::eraseFromClique
"
Remove a node from a clique
Parameters
----------
clique_id : int
the id of the clique
node_id : int
the id of the node
Warnings
--------
NotFound raised if clique_id does not exist
"
%feature("docstring") gum::CliqueGraph::hasRunningIntersection
"
Returns
-------
bool
True if the running intersection property holds
"
%feature("docstring") gum::CliqueGraph::isJoinTree
"
Returns
-------
bool
True if the graph is a join tree
"
%feature("docstring") gum::CliqueGraph::separator
"
Parameters
----------
edge : Edge
the edge to be checked
clique1 : int
one extremity of the edge
clique : int
the other extremity of the edge
Returns
-------
Set
the separator included in a given edge
Warnings
--------
NotFound raised if the edge does not belong to the clique graph
"
%feature("docstring") gum::CliqueGraph::setClique
"
changes the set of nodes included into a given clique
Parameters
----------
idClique : int
the id of the clique
new_clique : Set
the new set of nodes to be included in the clique
Warnings
--------
NotFound exception if idClique is not a clique of the graph
"
\ No newline at end of file
......@@ -46,7 +46,7 @@ Warnings
Returns
-------
str
a description of the graph
a friendly display of the graph in DOT format
Examples
--------
......
......@@ -32,6 +32,14 @@ InvalidNode raised if head or tail does not belong to the graph nodes.
%feature("docstring") gum::DiGraph::addNode
"
Returns
-------
int
the new NodeId
"
%feature("docstring") gum::DiGraph::addNodeWithId
"
Add a node by choosing a new NodeId.
Returns
......@@ -201,7 +209,7 @@ int
Returns
-------
str
a description of the graph
a friendly display of the graph in DOT format
Examples
--------
......
%feature("docstring") gum::UndiGraph
"
UndiGraph represents a Directed Graph.
UndiGraph represents an Undirected Graph.
Available constructors:
``UndiGraph() -> UndiGraph``
......@@ -28,4 +28,187 @@ n2 : int
Warnings
--------
InvalidNode raised if n1 or n2 does not belong to the graph nodes.
"
%feature("docstring") gum::UndiGraph::addNode
"
Returns
-------
int
the new NodeId
"
%feature("docstring") gum::UndiGraph::addNodeWithId
"
Add a node by choosing a new NodeId.
Returns
-------
int
the new NodeId
"
%feature("docstring") gum::UndiGraph::clear
"
Remove all the nodes and edges from the graph.
"
%feature("docstring") gum::UndiGraph::edges
"
Returns
-------
List
the list of the edges
"
%feature("docstring") gum::UndiGraph::empty
"
Check if the graph is empty.
Returns
-------
bool
True if the graph is empty
"
%feature("docstring") gum::UndiGraph::emptyEdges
"
Check if the graph doesn't contains edges.
Returns
-------
bool
True if the graph doesn't contains edges
"
%feature("docstring") gum::UndiGraph::eraseEdge
"
Erase the edge between n1 and n2.
Parameters
----------
n1 : int
the id of the tail node
n2 : int
the id of the head node
"
%feature("docstring") gum::UndiGraph::eraseNeighbours
"
Erase all the edges adjacent to a given node.
Parameters
----------
n : int
the id of the node
"
%feature("docstring") gum::UndiGraph::eraseNode
"
Erase the node and all the adjacent edges.
Parameters
----------
id : int
the id of the node
"
%feature("docstring") gum::UndiGraph::existsEdge
"
Check if an edge exists bewteen n1 and n2.
Parameters
----------
n1 : int
the id of one extremity of the edge
n2 : int
the id of the other extremity if tge edge
Returns
-------
bool
True if the arc exists
"
%feature("docstring") gum::UndiGraph::existsNode
"
Check if a node with a certain id exists in the graph.
Parameters
----------
id : int
the checked id
Returns
-------
bool
True if the node exists
"
%feature("docstring") gum::UndiGraph::hasUndirectedCycle
"
Checks whether the graph contains cycles.
Returns
-------
bool
True if the graph contains a cycle
"
%feature("docstring") gum::UndiGraph::ids
"
Returns
-------
List
the list of ids
"
%feature("docstring") gum::UndiGraph::neighbours
"
Parameters
----------
id : int
the id of the checked node
Returns
-------
Set
The set of edges adjacent to the given node
"
%feature("docstring") gum::UndiGraph::partialUndiGraph
"
Parameters
----------
nodesSet : Set
The set of nodes composing the partial graph
Returns
-------
UndiGraph
The partial graph formed by the nodes given in parameter
"
%feature("docstring") gum::UndiGraph::size
"
Returns
-------
int
the number of nodes in the graph
"
%feature("docstring") gum::UndiGraph::sizeEdges
"
Returns
-------
int
the number of edges in the graph
"
%feature("docstring") gum::UndiGraph::toDot
"
Returns
-------
str
a friendly display of the graph in DOT format
"
\ No newline at end of file
......@@ -467,6 +467,7 @@ gumReplaceList = [
('gum::Idx', 'int'),
('gum::Size', 'int'),
('gum::NodeId', 'int'),
('gum::NodeSet', 'Set'),
('std::string', 'str'),
('gum::', 'pyAgrum.'),
('_double ', ' '),
......
......@@ -3,6 +3,8 @@
%include "doc_DiGraph.i"
%include "doc_DAG.i"
%include "doc_UndiGraph.i"
%include "doc_CliqueGraph.i"
%include "doc_MixedGraph.i"
%include "doc_LabelizedVariable.i"
%include "doc_DiscretizedVariable.i"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment