libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
libsemigroups::forest Namespace Reference

This page contains the documentation of some helper functions for the Forest class.

Functions

word_type path_to_root (Forest const &f, Forest::node_type i)
 Returns a word containing the labels of the edges on the path to a root node from i.
 
void path_to_root (Forest const &f, word_type &w, Forest::node_type i)
 Modifies w to contain the labels of the edges on the path to a root node from i.
 
word_type path_to_root_no_checks (Forest const &f, Forest::node_type i)
 Returns a word containing the labels of the edges on the path to a root node from i.
 
void path_to_root_no_checks (Forest const &f, word_type &w, Forest::node_type i)
 Modifies w to contain the labels of the edges on the path to a root node from i.
 

Function Documentation

◆ path_to_root() [1/2]

word_type path_to_root ( Forest const & f,
Forest::node_type i )
nodiscard

This function returns a word containing the labels of the edges on the path to a root node from node i.

Parameters
fthe forest.
ithe node.
Returns
The word labelling the path from a root node to i.
Exceptions
LibsemigroupsExceptionif i is greater than or equal to number_of_nodes.

◆ path_to_root() [2/2]

void path_to_root ( Forest const & f,
word_type & w,
Forest::node_type i )

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 i.

Parameters
fthe forest.
wvalue to contain the result.
ithe node.
Exceptions
LibsemigroupsExceptionif i is greater than or equal to number_of_nodes.

◆ path_to_root_no_checks() [1/2]

word_type path_to_root_no_checks ( Forest const & f,
Forest::node_type i )
nodiscard

This function returns a word containing the labels of the edges on the path to a root node from node i.

Parameters
fthe forest.
ithe node.
Returns
The word labelling the path from a root node to i.
Warning
No checks are performed on the arguments of this function.

◆ path_to_root_no_checks() [2/2]

void path_to_root_no_checks ( Forest const & f,
word_type & w,
Forest::node_type i )

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 i.

Parameters
fthe forest.
wvalue to contain the result.
ithe node.
Warning
No checks are performed on the arguments of this function.