.. Copyright (c) 2019-22, J. D. Mitchell

   Distributed under the terms of the GPL license version 3.

   The full license is in the file LICENSE, distributed with this software.

   This file was auto-generated by docs/generate_from_yml.py, do not edit.

Forest
======

.. doxygenclass:: libsemigroups::Forest
   :project: libsemigroups

.. cpp:namespace:: libsemigroups::Forest


Type aliases
------------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`label_type`
     - Alias for the type of edge labels in a forest.


   * - :cpp:member:`node_type`
     - Alias for the type of nodes in a forest.



Constructors
------------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`Forest(Forest const&) = default`
     - Default copy constructor.


   * - :cpp:member:`Forest(Forest&&) = default`
     - Default move constructor.


   * - :cpp:member:`Forest(size_t)`
     - Constructs a forest with ``n`` nodes.


   * - :cpp:member:`operator=(Forest const&) = default`
     - Default copy assignment constructor.


   * - :cpp:member:`operator=(Forest&&) = default`
     - Default move assignment constructor.



Modifiers
---------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`add_nodes(size_t)`
     - Add nodes to the :cpp:any:`Forest` .


   * - :cpp:member:`clear() noexcept`
     - Removes all nodes from the forest.


   * - :cpp:member:`set(node_type, node_type, label_type)`
     - Set the parent and edge label for a node.



Accessors
---------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`empty() const noexcept`
     - Check if there are any nodes in the forest.


   * - :cpp:member:`label(node_type) const`
     - Returns the label of the edge from a node to its parent.


   * - :cpp:member:`number_of_nodes() const noexcept`
     - Returns the number of nodes in the forest.


   * - :cpp:member:`parent(node_type) const`
     - Returns the parent of a node.



Iterators
---------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`cbegin_parent() const noexcept`
     - Returns an iterator pointing to the parent of the first node.


   * - :cpp:member:`cend_parent() const noexcept`
     - Returns an iterator pointing one-past the parent of the last node.



.. toctree::
   :hidden:

   libsemigroups__forest__type_aliases.rst
   libsemigroups__forest__constructors.rst
   libsemigroups__forest__modifiers.rst
   libsemigroups__forest__accessors.rst
   libsemigroups__forest__iterators.rst
