Forest

This page contains the documentation for the class Forest.

Forest(*args, **kwargs)

Overloaded function.

Forest.add_nodes(self, n)

Add nodes to the Forest.

Forest.clear(self)

Removes all nodes from the forest.

Forest.label(self, i)

Returns the label of the edge from a node to its parent.

Forest.number_of_nodes(self)

Returns the number of nodes in the forest.

Forest.parent(self, i)

Returns the parent of a node.

Forest.parent_iterator(self)

Returns an iterator pointing to the parent of the first node.

Forest.set(self, node, parent, gen)

Set the parent and edge label for a node.

class Forest(*args, **kwargs)

Overloaded function.

  1. __init__(self: _libsemigroups_pybind11.Forest, arg0: int) -> None

    Constructs a forest with 0 nodes.

    The Forest is initialised so that the parent() and label() of every node is UNDEFINED.

    Parameters

    None.

  2. __init__(self: _libsemigroups_pybind11.Forest, that: _libsemigroups_pybind11.Forest) -> None

    Copy constructor.

    Parameters
add_nodes(self: _libsemigroups_pybind11.Forest, n: int) None

Add nodes to the Forest.

Parameters

n (in) -- the number of nodes to add.

Returns

(None)

clear(self: _libsemigroups_pybind11.Forest) None

Removes all nodes from the forest.

Returns

(None)

label(self: _libsemigroups_pybind11.Forest, i: int) int

Returns the label of the edge from a node to its parent.

Parameters

i (int) -- the node whose label is sought.

Returns

A int.

number_of_nodes(self: _libsemigroups_pybind11.Forest) int

Returns the number of nodes in the forest.

Returns

An int.

parent(self: _libsemigroups_pybind11.Forest, i: int) int

Returns the parent of a node.

Parameters

i (int) -- the node whose parent is sought.

Returns

An int.

parent_iterator(self: _libsemigroups_pybind11.Forest) Iterator

Returns an iterator pointing to the parent of the first node.

Parameters

None.

Returns

An iterator.

set(self: _libsemigroups_pybind11.Forest, node: int, parent: int, gen: int) None

Set the parent and edge label for a node.

Parameters
  • node (int) -- the node whose parent and label to set.

  • parent (int) -- the parent node

  • gen (int) -- the label of the edge from parent to node.

Returns

(None)