This page contains the documentation of some helper functions for the Forest class.
Functions | |
| size_t | depth (Forest const &f, Forest::node_type n) |
| Returns the depth of a node in the forest, i.e. the distance, in terms of the number of edges, from a root. | |
| size_t | depth_no_checks (Forest const &f, Forest::node_type n) |
| Returns the depth of a node in the forest, n.e. the distance, in terms of the number of edges, from a root. | |
| bool | is_root (Forest const &f, Forest::node_type n) |
| Check if a node is the root of any tree in the Forest. | |
| bool | is_root_no_checks (Forest const &f, Forest::node_type n) |
| Check if a node is the root of any tree in the Forest. | |
| word_type | path_from_root (Forest const &f, Forest::node_type n) |
Returns a word containing the labels of the edges on the path from a root node to n. | |
| void | path_from_root (Forest const &f, word_type &w, Forest::node_type n) |
Modifies w to contain the labels of the edges on the path from a root node to n. | |
| word_type | path_from_root_no_checks (Forest const &f, Forest::node_type n) |
Returns a word containing the labels of the edges on the path from a root node to n. | |
| void | path_from_root_no_checks (Forest const &f, word_type &w, Forest::node_type n) |
Modifies w to contain the labels of the edges on the path from a root node to n. | |
| word_type | path_to_root (Forest const &f, Forest::node_type n) |
Returns a word containing the labels of the edges on the path to a root node from n. | |
| void | path_to_root (Forest const &f, word_type &w, Forest::node_type n) |
Modifies w to contain the labels of the edges on the path to a root node from n. | |
| word_type | path_to_root_no_checks (Forest const &f, Forest::node_type n) |
Returns a word containing the labels of the edges on the path to a root node from n. | |
| void | path_to_root_no_checks (Forest const &f, word_type &w, Forest::node_type n) |
Modifies w to contain the labels of the edges on the path to a root node from n. | |
|
inlinenodiscard |
This function returns the length of the word returned by path_to_root_no_checks and path_from_root_no_checks.
| f | the Forest. |
| n | the node. |
n.| LibsemigroupsException | if n is out of bounds (i.e. it is greater than or equal to number_of_nodes). |
|
nodiscard |
This function returns the length of the word returned by path_to_root_no_checks and path_from_root_no_checks.
| f | the Forest. |
| n | the node. |
n.
|
inlinenodiscard |
This function returns true if the node n in the Forest f is a root node, and false if it is not.
| f | the Forest. |
| n | the node. |
n is a root of f.| LibsemigroupsException | if n is out of bounds (i.e. it is greater than or equal to number_of_nodes). |
|
inlinenodiscard |
This function returns true if the node n in the Forest f is a root node, and false if it is not.
| f | the Forest. |
| n | the node. |
n is a root of f.n is a node of f.
|
nodiscard |
This function returns a word containing the labels of the edges on the path from a root node to the node n.
| f | the forest. |
| n | the node. |
n.| LibsemigroupsException | if n is greater than or equal to number_of_nodes. |
| void path_from_root | ( | Forest const & | f, |
| word_type & | w, | ||
| Forest::node_type | n ) |
This function modifies its first argument w in-place to contain the labels of the edges on the path from a root node to the node n.
| f | the forest. |
| w | value to contain the result. |
| n | the node. |
| LibsemigroupsException | if n is greater than or equal to number_of_nodes. |
|
nodiscard |
This function returns a word containing the labels of the edges on the path from a root node to the node n.
| f | the forest. |
| n | the node. |
n.| void path_from_root_no_checks | ( | Forest const & | f, |
| word_type & | w, | ||
| Forest::node_type | n ) |
This function modifies its first argument w in-place to contain the labels of the edges on the path from a root node to the node n.
| f | the forest. |
| w | value to contain the result. |
| n | the node. |
|
nodiscard |
This function returns a word containing the labels of the edges on the path to a root node from node n.
| f | the forest. |
| n | the node. |
n.| LibsemigroupsException | if n is greater than or equal to number_of_nodes. |
| void path_to_root | ( | Forest const & | f, |
| word_type & | w, | ||
| Forest::node_type | n ) |
This function modifies its first argument w in-place to contain the labels of the edges on the path to a root node from node n.
| f | the forest. |
| w | value to contain the result. |
| n | the node. |
| LibsemigroupsException | if n is greater than or equal to number_of_nodes. |
|
nodiscard |
This function returns a word containing the labels of the edges on the path to a root node from node n.
| f | the forest. |
| n | the node. |
n.| void path_to_root_no_checks | ( | Forest const & | f, |
| word_type & | w, | ||
| Forest::node_type | n ) |
This function modifies its first argument w in-place to contain the labels of the edges on the path to a root node from node n.
| f | the forest. |
| w | value to contain the result. |
| n | the node. |