libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
Ukkonen::Node

The type of the nodes in the tree.

Public Member Functions

 Node (index_type l=0, index_type r=0, node_index_type parent=UNDEFINED)
 Construct a node from left most index, right most index, and parent.
 
 Node (Node &&)=default
 Default move constructor.
 
 Node (Node const &)=default
 Default copy constructor.
 
node_index_type & child (letter_type c)
 The index of the child node corresponding to a letter (if any).
 
node_index_type child (letter_type c) const
 The index of the child node corresponding to a letter (if any).
 
bool is_leaf () const noexcept
 Returns true if the node is a leaf and false if not.
 
bool is_root () const noexcept
 Returns true if the node is the root and false if not.
 
size_t length () const noexcept
 The length of the edge leading into the current node.
 
Nodeoperator= (Node &&)=default
 Default move assignment.
 
Nodeoperator= (Node const &)=default
 Default copy assignment.
 

Constructor & Destructor Documentation

◆ Node() [1/3]

Node ( Node const & )
default

Default copy constructor.

◆ Node() [2/3]

Node ( Node && )
default

Default move constructor.

◆ Node() [3/3]

Node ( index_type l = 0,
index_type r = 0,
node_index_type parent = UNDEFINED )
explicit

Construct a node from left most index, right most index, and parent.

Parameters
lthe left most index and value of the data member l (defaults to 0).
rone after the right most index and value of the data member r (defaults to 0).
parentof the node being constructed (defaults to UNDEFINED).
Exceptions
This function guarantees not to throw a LibsemigroupsException.

Member Function Documentation

◆ child() [1/2]

node_index_type & child ( letter_type c)

The index of the child node corresponding to a letter (if any).

Parameters
cthe first letter in the edge of the node.
Returns
A reference to the index of the child node a value of type size_t.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
Logarithmic in the size of children.size().

◆ child() [2/2]

node_index_type child ( letter_type c) const

The index of the child node corresponding to a letter (if any).

Parameters
cthe first letter in the edge of the node.
Returns
The index of the child node, a value of type size_t.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
Logarithmic in the size of children.size().

◆ is_leaf()

bool is_leaf ( ) const
inlinenoexcept

Returns true if the node is a leaf and false if not.

Returns
A value of type bool.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ is_root()

bool is_root ( ) const
inlinenoexcept

Returns true if the node is the root and false if not.

Returns
A value of type bool.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ length()

size_t length ( ) const
inlinenoexcept

The length of the edge leading into the current node.

Returns
A value of type size_t.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ operator=() [1/2]

Node & operator= ( Node && )
default

Default move assignment.

◆ operator=() [2/2]

Node & operator= ( Node const & )
default

Default copy assignment.

Member Data Documentation

◆ children

std::map<letter_type, node_index_type> children
mutable

The children of the current node.

◆ l

The index of the first letter in the edge leading to the node.

◆ parent

node_index_type parent

The index of the parent node.

◆ r

The index of one past the last letter in the edge leading to the node.


The documentation for this struct was generated from the following file: