This page contains documentation related to safely constructing a Forest instance.
- See also
- The `make` function for an overview of possible uses of the
make function.
◆ make() [1/2]
template<typename Return>
This function constructs a Forest from initializer lists of parents and labels.
- Template Parameters
-
- Parameters
-
| parent | the initializer list of parents of nodes in the Forest. |
| edge_labels | the initializer list of edge labels in the Forest. |
- Returns
- A newly constructed Forest with parents
parent and edge labels edge_labels.
- Exceptions
-
| LibsemigroupsException | if any of the following hold:
parent and edge_labels have different sizes;
parent and edge_labels do not have the value UNDEFINED in the same positions (these values indicate where the roots of the trees in the forest are located and so must coincide).
- Forest::set_parent_and_label throws for
parent[i] and edge_labels[i] for any value of i.
|
◆ make() [2/2]
template<typename Return>
This function constructs a Forest from vector of parents and labels.
- Template Parameters
-
- Parameters
-
| parent | the vector of parents of nodes in the Forest. |
| edge_labels | the vector of edge labels in the Forest. |
- Returns
- A newly constructed Forest with parents
parent and edge labels edge_labels.
- Exceptions
-
| LibsemigroupsException | if any of the following hold:
parent and edge_labels have different sizes;
parent and edge_labels do not have the value UNDEFINED in the same positions (these values indicate where the roots of the trees in the forest are located and so must coincide).
- Forest::set_parent_and_label throws for
parent[i] and edge_labels[i] for any value of i.
|