libsemigroups  v3.3.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
template<typename Node>
class libsemigroups::WordGraphView< Node >

Defined in word-graph-view.hpp.

This class provides a wrapper around WordGraph to allow a non-owning view over a specified range of WordGraph nodes.

Template Parameters
Nodethe type of the nodes in the word graph, must be an unsigned integer type.

Public Types

using const_iterator_nodes
 The type of an iterator pointing to the nodes of the word graph view.
 
using const_iterator_targets
 The type of an iterator pointing to the targets of a node.
 
using const_reverse_iterator_nodes
 The type of a reverse iterator pointing to the nodes of a word graph view.
 
using label_type = Node
 The type of edge labels in a word graph.
 
using node_type = Node
 The type of nodes in a word graph.
 
using size_type = std::size_t
 Unsigned integer type.
 

Public Member Functions

 WordGraphView ()
 Default constructor.
 
 WordGraphView (WordGraph< Node > const &graph)
 Construct from a WordGraph.
 
 WordGraphView (WordGraph< Node > const &graph, size_type start, size_type end)
 Construct from a WordGraph and range of nodes.
 
 WordGraphView (WordGraphView< Node > &&)=default
 Default move constructor.
 
 WordGraphView (WordGraphView< Node > const &)=default
 Default copy constructor.
 
const_iterator_nodes cbegin_nodes () const
 Returns a random access iterator pointing at the first node of the word graph.
 
const_iterator_nodes cbegin_nodes_no_checks () const noexcept
 Returns a random access iterator pointing at the first node of the word graph.
 
auto cbegin_targets (node_type source) const
 Returns a random access iterator pointing at the target of the edge with label 0 incident to a given node.
 
auto cbegin_targets_no_checks (node_type source) const noexcept
 Returns a random access iterator pointing at the target of the edge with label 0 incident to a given node.
 
const_iterator_nodes cend_nodes () const
 Returns a random access iterator pointing one past the last node of the range of this word graph view.
 
const_iterator_nodes cend_nodes_no_checks () const noexcept
 Returns a random access iterator pointing one past the last node of the range of this word graph view.
 
auto cend_targets (node_type source) const
 Returns a random access iterator pointing one beyond the target of the edge with label out_degree() - 1 incident to a given node.
 
auto cend_targets_no_checks (node_type source) const noexcept
 Returns a random access iterator pointing one beyond the target of the edge with label out_degree() - 1 incident to a given node.
 
node_type end_node () const noexcept
 The index in the underlying graph of one beyond the final node in the view.
 
WordGraphViewend_node (node_type end)
 Set the index in the underlying graph of one beyond the last node in the view.
 
WordGraphViewend_node_no_checks (node_type end) noexcept
 Set the index in the underlying graph of one beyond the last node in the view.
 
bool equal_to_no_checks (WordGraphView const &that) const
 Compares two word graph views to see if they are equal.
 
WordGraphViewinit ()
 Re-initialize the view as if it had been default constructed.
 
WordGraphViewinit (WordGraph< Node > const &graph)
 Re-initialize the view to be a view over graph.
 
WordGraphViewinit (WordGraph< Node > const &graph, size_type start, size_type end)
 Re-initialize the view to be a view over graph over the range start to end.
 
auto labels () const
 Returns a range object containing all labels of edges in a word graph.
 
auto labels_and_targets (node_type source) const
 Returns a range object containing pairs consisting of edge labels and target nodes.
 
auto labels_and_targets_no_checks (node_type source) const noexcept
 Returns a range object containing pairs consisting of edge labels and target nodes.
 
auto labels_no_checks () const noexcept
 Returns a range object containing all labels of edges in a word graph.
 
std::pair< label_type, node_typenext_label_and_target (node_type s, label_type a) const
 Get the next target of an edge incident to a given node that doesn't equal UNDEFINED.
 
std::pair< label_type, node_typenext_label_and_target_no_checks (node_type s, label_type a) const
 Get the next target of an edge incident to a given node that doesn't equal UNDEFINED.
 
auto nodes () const
 Returns a range object containing all nodes in a word graph.
 
auto nodes_no_checks () const noexcept
 Returns a range object containing all nodes in a word graph.
 
bool not_equal_to_no_checks (WordGraphView const &that) const
 Compares two word graph views to see if they are not equal.
 
size_type number_of_edges () const
 The number of edges in the underlying graph.
 
size_type number_of_edges_no_checks () const noexcept
 The number of edges in the underlying graph.
 
size_type number_of_nodes () const
 The number of nodes that this view ranges over.
 
size_type number_of_nodes_no_checks () const noexcept
 The number of nodes that this view ranges over.
 
bool operator!= (WordGraphView const &that) const
 Compares two word graph views to see if they are not equal.
 
WordGraphViewoperator= (WordGraphView< Node > &&)=default
 Default move assignment.
 
WordGraphViewoperator= (WordGraphView< Node > const &)=default
 Default copy assignment.
 
bool operator== (WordGraphView const &that) const
 Compares two word graph views to see if they are equal.
 
size_type out_degree () const
 Returns the out degree.
 
size_type out_degree_no_checks () const noexcept
 Returns the out degree.
 
WordGraphViewreshape (node_type start, node_type end)
 Reshape this view over the same graph.
 
WordGraphViewreshape_no_checks (node_type start, node_type end)
 Reshape this view over the same graph.
 
node_type start_node () const noexcept
 The index in the underlying graph of the first node in the view.
 
WordGraphViewstart_node (node_type start)
 Set the index in the underlying graph of the first node in the view.
 
WordGraphViewstart_node_no_checks (node_type start) noexcept
 Set the index in the underlying graph of the first node in the view.
 
node_type target (node_type source, label_type a) const
 Get the target of the edge with given source node and label.
 
node_type target_no_checks (node_type source, label_type a) const
 Get the target of the edge with given source node and label.
 
auto targets (node_type source) const
 Returns a range object containing all the targets of edges with a given source.
 
auto targets_no_checks (node_type source) const noexcept
 Returns a range object containing all the targets of edges with a given source.
 
void throw_if_any_target_out_of_bounds () const
 Throws if the target of any edge is out of bounds.
 
template<typename Iterator>
void throw_if_any_target_out_of_bounds (Iterator first, Iterator last) const
 Throws if the target of any edge with source in a given range is out of bounds.
 
void throw_if_invalid_range () const
 Throws if the range specified by [start_node(), end_node()] is invalid.
 
void throw_if_invalid_view () const
 Throws if the this is in an invalid state.
 
template<typename Iterator>
void throw_if_label_out_of_bounds (Iterator first, Iterator last) const
 Throws if range contains labels that are out of bounds.
 
void throw_if_label_out_of_bounds (std::vector< word_type > const &rules) const
 Throws if any of the labels in vector of words is out of bounds.
 
void throw_if_label_out_of_bounds (typename WordGraph< Node >::label_type a) const
 Throws if a label is out of bounds.
 
void throw_if_label_out_of_bounds (word_type const &word) const
 Throws if word contains labels that are out of bounds.
 
template<typename Iterator1, typename Iterator2>
void throw_if_node_out_of_bounds (Iterator1 first, Iterator2 last) const
 Throws if any node in a range is out of bounds.
 
template<typename Node2>
void throw_if_node_out_of_bounds (Node2 n) const
 Throws if a node is out of bounds.
 
WordGraph< Node > const * word_graph () const noexcept
 Returns a const pointer to the underlying WordGraph.
 

Member Typedef Documentation

◆ const_iterator_nodes

template<typename Node>
using const_iterator_nodes
Initial value:
typename detail::IntRange<Node>::const_iterator

◆ const_iterator_targets

template<typename Node>
using const_iterator_targets
Initial value:
typename detail::DynamicArray2<Node>::const_iterator

◆ const_reverse_iterator_nodes

template<typename Node>
using const_reverse_iterator_nodes
Initial value:
typename detail::IntRange<Node>::const_reverse_iterator

Constructor & Destructor Documentation

◆ WordGraphView() [1/3]

template<typename Node>
WordGraphView ( WordGraph< Node > const & graph,
size_type start,
size_type end )
inline

This function is used to construct a WordGraphView from a WordGraph over the range of nodes from start to end.

Parameters
graphunderlying WordGraph object.
startthe first node in the range.
endone beyond the last node in the range.

◆ WordGraphView() [2/3]

template<typename Node>
WordGraphView ( WordGraph< Node > const & graph)
inlineexplicit

This function is used to construct a WordGraphView from a WordGraph over all of the nodes in graph.

Parameters
graphunderlying WordGraph object.

◆ WordGraphView() [3/3]

template<typename Node>
WordGraphView ( )
inline

Default constructs an uninitialised WordGraphView.

Member Function Documentation

◆ cbegin_nodes()

template<typename Node>
const_iterator_nodes cbegin_nodes ( ) const
inline

This function returns a random access iterator pointing at the first in the range of this word graph view.

Returns
An const_iterator_nodes.
Exceptions
LibsemigroupsExceptionif this is in an invalid state.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ cbegin_nodes_no_checks()

template<typename Node>
const_iterator_nodes cbegin_nodes_no_checks ( ) const
inlinenoexcept

This function returns a random access iterator pointing at the first in the range of this word graph view.

Returns
An const_iterator_nodes.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ cbegin_targets()

template<typename Node>
auto cbegin_targets ( node_type source) const
inlinenodiscard

This function returns a random access iterator pointing at the target of the edge with label 0 incident to the source node source. This target might equal UNDEFINED.

Parameters
sourcethe source node in the word graph.
Returns
A const_iterator_targets.
Exceptions
LibsemigroupsExceptionif source is out of range (i.e. greater than or equal to number_of_nodes), or if if this is in an invalid state.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ cbegin_targets_no_checks()

template<typename Node>
auto cbegin_targets_no_checks ( node_type source) const
inlinenodiscardnoexcept

This function returns a random access iterator pointing at the target of the edge with label 0 incident to the source node source. This target might equal UNDEFINED.

Parameters
sourcea node in the word graph.
Returns
A const_iterator_targets.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.
Warning
No checks whatsoever on the validity of the arguments are performed.
See also
cbegin_targets.

◆ cend_nodes()

template<typename Node>
const_iterator_nodes cend_nodes ( ) const
inlinenodiscard

This function returns a random access iterator pointing one beyond the last node in the word graph.

Returns
An const_iterator_nodes.
Exceptions
LibsemigroupsExceptionif this is in an invalid state.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ cend_nodes_no_checks()

template<typename Node>
const_iterator_nodes cend_nodes_no_checks ( ) const
inlinenodiscardnoexcept

This function returns a random access iterator pointing one beyond the last node in the word graph.

Returns
An const_iterator_nodes.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ cend_targets()

template<typename Node>
auto cend_targets ( node_type source) const
inlinenodiscard

This function returns a random access iterator pointing one beyond the target of the edge with label out_degree() - 1 incident to the source node source. This target might equal UNDEFINED.

Parameters
sourcea node in the word graph.
Returns
A const_iterator_targets.
Exceptions
LibsemigroupsExceptionif source is out of range (i.e. greater than or equal to number_of_nodes), of if this is in an invalid state.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ cend_targets_no_checks()

template<typename Node>
auto cend_targets_no_checks ( node_type source) const
inlinenodiscardnoexcept

This function returns a random access iterator pointing one beyond the target of the edge with label out_degree() - 1 incident to the source node source. This target might equal UNDEFINED.

Parameters
sourcea node in the word graph.
Returns
A const_iterator_targets.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.
Warning
No checks whatsoever on the validity of the arguments are performed.
See also
cend_targets.

◆ end_node() [1/2]

template<typename Node>
node_type end_node ( ) const
inlinenodiscardnoexcept
Returns
The index of the node.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ end_node() [2/2]

template<typename Node>
WordGraphView & end_node ( node_type end)
Parameters
endthe new index of one beyond the last node in the view.
Returns
A reference to *this.
Exceptions
LibsemigroupsExceptionif:
Complexity
Constant.

◆ end_node_no_checks()

template<typename Node>
WordGraphView & end_node_no_checks ( node_type end)
noexcept
Parameters
endthe new index of one beyond the last node in the view.
Returns
A reference to *this.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.
Warning
This function performs no checks whatsoever and assumes that start_node() <= end <= number_of_nodes().

◆ equal_to_no_checks()

template<typename Node>
bool equal_to_no_checks ( WordGraphView< Node > const & that) const
nodiscard

This function compares two views over two (not necessarily the same) word graph objects to see if the views are equal.

Parameters
thatthe WordGraphView to compare with.
Returns
True if this and that have the same number of nodes, out degree, and range over nodes with identical values and targets.

◆ init() [1/3]

template<typename Node>
WordGraphView & init ( )
inline

This function puts a view into the state that it would have been in if it had just been newly default constructed.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

◆ init() [2/3]

template<typename Node>
WordGraphView & init ( WordGraph< Node > const & graph)
inline

This function puts a view into the state that it would have been in if it had just been newly constructed with the same parameters graph.

Parameters
graphunderlying WordGraph object.
Exceptions
This function guarantees not to throw a LibsemigroupsException.

◆ init() [3/3]

template<typename Node>
WordGraphView & init ( WordGraph< Node > const & graph,
size_type start,
size_type end )

This function puts a view into the state that it would have been in if it had just been newly constructed with the same parameters graph, start and end.

Parameters
graphunderlying WordGraph object.
startthe first node in the range.
endone beyond the last node in the range.
Returns
A reference to *this.
Exceptions
This function guarantees not to throw a LibsemigroupsException.

◆ labels()

template<typename Node>
auto labels ( ) const
inlinenodiscard

This function returns a range object containing all the labels of edges in a word graph.

Returns
A range object.
Exceptions
LibsemigroupsExceptionif the underlying WordGraph is not defined.

◆ labels_and_targets()

template<typename Node>
auto labels_and_targets ( node_type source) const
inlinenodiscard

This function returns a range object containing all the edge labels and targets of edges with source source.

Parameters
sourcethe source node.
Returns
A range object.
Exceptions
LibsemigroupsExceptionif source is out of bounds, or if this is in an invalid state.
See also
throw_if_invalid_view.

◆ labels_and_targets_no_checks()

template<typename Node>
auto labels_and_targets_no_checks ( node_type source) const
inlinenodiscardnoexcept

This function returns a range object containing all the edge labels and targets of edges with source source.

Parameters
sourcethe source node.
Returns
A range object.
Exceptions
This function is noexcept and is guaranteed never to throw.
Warning
This function performs no checks whatsoever and assumes that source is a valid node of the word graph (i.e. it is not greater than or equal to number_of_nodes).

◆ labels_no_checks()

template<typename Node>
auto labels_no_checks ( ) const
inlinenodiscardnoexcept

This function returns a range object containing all the labels of edges in a word graph.

Returns
A range object.
Exceptions
Thisfunction is noexcept and is guaranteed never to throw.

◆ next_label_and_target()

template<typename Node>
std::pair< label_type, node_type > next_label_and_target ( node_type s,
label_type a ) const
nodiscard

This function returns the next target of an edge with label greater than or equal to a that is incident to the node s.

If target(s, b) equals UNDEFINED for every value b in the range \([a, n)\), where \(n\) is the return value of out_degree() then x.first and x.second equal UNDEFINED.

Parameters
sthe node.
athe label.
Returns
Returns a std::pair x where:
  1. x.first is adjacent to s via an edge labelled x.second; and
  2. x.second is the minimum value in the range \([a, n)\) such that target(s, x.second) is not equal to UNDEFINED where \(n\) is the return value of out_degree(); If no such value exists, then {UNDEFINED, UNDEFINED} is returned.
Exceptions
LibsemigroupsExceptionif:
  • this is in an invalid state;
  • s does not represent a node in this;
  • a is not a valid edge label;
  • at least one of the targets of an edge in this does not represent a node in this; or
  • the underlying WordGraph is not defined.
Complexity
At worst \(O(n)\) where \(n\) equals out_degree().
See also
next_label_and_target_no_checks, throw_if_invalid_view.

◆ next_label_and_target_no_checks()

template<typename Node>
std::pair< label_type, node_type > next_label_and_target_no_checks ( node_type s,
label_type a ) const
nodiscard

This function returns the next target of an edge with label greater than or equal to a that is incident to the node s.

If target(s, b) equals UNDEFINED for every value b in the range \([a, n)\), where \(n\) is the return value of out_degree() then x.first and x.second equal UNDEFINED.

Parameters
sthe node.
athe label.
Returns
Returns a std::pair x where:
  1. x.first is adjacent to s via an edge labelled x.second; and
  2. x.second is the minimum value in the range \([a, n)\) such that target(s, x.second) is not equal to UNDEFINED where \(n\) is the return value of out_degree(); If no such value exists, then {UNDEFINED, UNDEFINED} is returned.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
At worst \(O(n)\) where \(n\) equals out_degree().
Warning
This function performs no checks whatsoever and assumes that s is a valid node of the word graph (i.e. it is not greater than or equal to number_of_nodes).

◆ nodes()

template<typename Node>
auto nodes ( ) const
inlinenodiscard

This function returns a range object containing all the nodes in a word graph view

Returns
A range object.
Exceptions
LibsemigroupsExceptionif this is in an invalid state.
See also
throw_if_invalid_view.

◆ nodes_no_checks()

template<typename Node>
auto nodes_no_checks ( ) const
inlinenodiscardnoexcept

This function returns a range object containing all the nodes in a word graph view

Returns
A range object.
Exceptions
This function is noexcept and is guaranteed never to throw.

◆ not_equal_to_no_checks()

template<typename Node>
bool not_equal_to_no_checks ( WordGraphView< Node > const & that) const
inlinenodiscard

This operator compares two views over two (not necessarily the same) word graph objects to see if the views are not equal.

Parameters
thatthe WordGraphView to compare with.
Returns
True if this and that are not equal by ==.

◆ number_of_edges()

template<typename Node>
size_type number_of_edges ( ) const
inlinenodiscard
Returns
The number of edges in in the underlying graph.
Exceptions
LibsemigroupsExceptionif this is in an invalid state.
Complexity
Linear in number_of_nodes() * out_degree()
See also
throw_if_invalid_view.

◆ number_of_edges_no_checks()

template<typename Node>
size_type number_of_edges_no_checks ( ) const
nodiscardnoexcept
Returns
The number of edges in in the underlying graph.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Linear in number_of_nodes() * out_degree()

◆ number_of_nodes()

template<typename Node>
size_type number_of_nodes ( ) const
inlinenodiscard
Returns
The number of nodes in in the view.
Exceptions
LibsemigroupsExceptionif this is in an invalid state.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ number_of_nodes_no_checks()

template<typename Node>
size_type number_of_nodes_no_checks ( ) const
inlinenodiscardnoexcept
Returns
The number of nodes in in the view.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ operator!=()

template<typename Node>
bool operator!= ( WordGraphView< Node > const & that) const
inlinenodiscard

This operator compares two views over two (not necessarily the same) word graph objects to see if the views are not equal.

Parameters
thatthe WordGraphView to compare with.
Returns
True if this and that are not equal by ==.
Exceptions
LibsemigroupsExceptionif either this or that are in invalid states.
See also
throw_if_invalid_view.

◆ operator==()

template<typename Node>
bool operator== ( WordGraphView< Node > const & that) const
nodiscard

This operator compares two views over two (not necessarily the same) word graph objects to see if the views are equal.

Parameters
thatthe WordGraphView to compare with.
Returns
True if this and that have the same number of nodes, out degree, and range over nodes with identical values and targets.
Exceptions
LibsemigroupsExceptionif either this or that are in invalid states.
See also
throw_if_invalid_view.

◆ out_degree()

template<typename Node>
size_type out_degree ( ) const
inlinenodiscard

This function returns the number of edge labels in the word graph.

Returns
The number of edge labels, type size_type.
Exceptions
LibsemigroupsExceptionif the underlying WordGraph is not defined.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ out_degree_no_checks()

template<typename Node>
size_type out_degree_no_checks ( ) const
inlinenodiscardnoexcept

This function returns the number of edge labels in the word graph.

Returns
The number of edge labels, type size_type.
Exceptions
Thisfunction is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ reshape()

template<typename Node>
WordGraphView & reshape ( node_type start,
node_type end )
inline

This function is used to reshape this to be a view over the range from start to end.

Parameters
startthe first node in the range.
endone beyond the last node in the range.
Returns
A reference to *this.
Exceptions
LibsemigroupsExceptionif:

◆ reshape_no_checks()

template<typename Node>
WordGraphView & reshape_no_checks ( node_type start,
node_type end )

This function is used to reshape this to be a view over the range from start to end.

Parameters
startthe first node in the range.
endone beyond the last node in the range.
Returns
A reference to *this.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Warning
This function performs no checks whatsoever and assumes that start is less than or equal to end, and that both values are in the range [0, number_of_nodes()]

◆ start_node() [1/2]

template<typename Node>
node_type start_node ( ) const
inlinenodiscardnoexcept
Returns
The index of the node.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ start_node() [2/2]

template<typename Node>
WordGraphView & start_node ( node_type start)
Parameters
startthe new index of the first node in the view.
Returns
A reference to *this.
Exceptions
LibsemigroupsExceptionif:
Complexity
Constant.

◆ start_node_no_checks()

template<typename Node>
WordGraphView & start_node_no_checks ( node_type start)
inlinenoexcept
Parameters
startthe new index of the first node in the view.
Returns
A reference to *this.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.
Warning
This function performs no checks whatsoever and assumes that start is less than or equal to end_node().

◆ target()

template<typename Node>
node_type target ( node_type source,
label_type a ) const
nodiscard

This function returns the target of the edge with source node source and label a.

Parameters
sourcethe node.
athe label.
Returns
the node adjacent to source via the edge labelled a, or UNDEFINED; both are values of type node_type.
Exceptions
LibsemigroupsExceptionif source or a is not valid, or if this is in an invalid state.
Complexity
Constant.
See also
throw_if_invalid_view.

◆ target_no_checks()

template<typename Node>
node_type target_no_checks ( node_type source,
label_type a ) const
inlinenodiscard

This function returns the target of the edge with source node source and label a.

Parameters
sourcethe node.
athe label.
Returns
Returns the node adjacent to source via the edge labelled a, or UNDEFINED; both are values of type node_type.
Exceptions
Thisfunction guarantees not to throw a LibsemigroupsException.
Complexity
Constant.

◆ targets()

template<typename Node>
auto targets ( node_type source) const
inlinenodiscard

This function returns a range object containing all the targets of edges with source source.

Parameters
sourcethe source node.
Returns
A range object.
Exceptions
LibsemigroupsExceptionif source is out of range (i.e. it is greater than or equal to number_of_nodes), or if this is in an invalid state.
See also
throw_if_invalid_view.

◆ targets_no_checks()

template<typename Node>
auto targets_no_checks ( node_type source) const
inlinenodiscardnoexcept

This function returns a range object containing all the targets of edges with source source.

Parameters
sourcethe source node.
Returns
A range object.
Exceptions
This function is noexcept and is guaranteed never to throw.
Warning
This function performs no checks whatsoever and assumes that source is a valid node of the word graph (i.e. it is not greater than or equal to number_of_nodes).

◆ throw_if_any_target_out_of_bounds() [1/2]

template<typename Node>
void throw_if_any_target_out_of_bounds ( ) const
inline

This function throws if any target of any edge is out of bounds (i.e. is greater than or equal to number_of_nodes, and not equal to UNDEFINED).

Exceptions
LibsemigroupsExceptionif any target of any edge is greater than or equal to number_of_nodes and not equal to UNDEFINED.

◆ throw_if_any_target_out_of_bounds() [2/2]

template<typename Node>
template<typename Iterator>
void throw_if_any_target_out_of_bounds ( Iterator first,
Iterator last ) const

This function throws if any target of any edge whose source is in the range defined by first and last is out of bounds (i.e. is greater than or equal to number_of_nodes, and not equal to UNDEFINED).

Template Parameters
Iteratorthe type of the 2nd and 3rd arguments.
Parameters
firstiterator pointing at the first node to check.
lastiterator pointing one beyond the last node to check.
Exceptions
LibsemigroupsExceptionif any target of any edge with source in the range first to last is greater than or equal to number_of_nodes and not equal to UNDEFINED.
LibsemigroupsExceptionif any node in the range first to last is out of bounds.

◆ throw_if_invalid_range()

template<typename Node>
void throw_if_invalid_range ( ) const
inline

This function throws if:

Exceptions
LibsemigroupsExceptionif any the range is invalid.

◆ throw_if_invalid_view()

template<typename Node>
void throw_if_invalid_view ( ) const
inline

This function throws if:

Exceptions
LibsemigroupsExceptionif any this is invalid.
See also
throw_if_invalid_range.

◆ throw_if_label_out_of_bounds() [1/4]

template<typename Node>
template<typename Iterator>
void throw_if_label_out_of_bounds ( Iterator first,
Iterator last ) const
inline

This function throws if any of the letters in the word defined by first and last is out of bounds, i.e. if they are greater than or equal to out_degree.

Template Parameters
Iteratorthe type of the arguments first and last.
Parameters
firstiterator pointing at the first letter to check.
lastiterator pointing one beyond the last letter to check.
Exceptions
LibsemigroupsExceptionif any value in the word defined by first and last is out of bounds.

◆ throw_if_label_out_of_bounds() [2/4]

template<typename Node>
void throw_if_label_out_of_bounds ( std::vector< word_type > const & rules) const
inline

This function throws if any of the letters in any of the words in rules are out of bounds, i.e. if they are greater than or equal to out_degree.

Parameters
rulesthe vector of words to check.
Exceptions
LibsemigroupsExceptionif any value in any of the words in rules are out of bounds.

◆ throw_if_label_out_of_bounds() [3/4]

template<typename Node>
void throw_if_label_out_of_bounds ( typename WordGraph< Node >::label_type a) const

This function throws if the label a is out of bounds, i.e. it is greater than or equal to out_degree.

Parameters
athe label to check.
Exceptions
LibsemigroupsExceptionif the label a is out of bounds.

◆ throw_if_label_out_of_bounds() [4/4]

template<typename Node>
void throw_if_label_out_of_bounds ( word_type const & word) const
inline

This function throws if any of the letters in word are out of bounds, i.e. if they are greater than or equal to out_degree.

Parameters
wordthe word to check.
Exceptions
LibsemigroupsExceptionif any value in word is out of bounds.

◆ throw_if_node_out_of_bounds() [1/2]

template<typename Node>
template<typename Iterator1, typename Iterator2>
void throw_if_node_out_of_bounds ( Iterator1 first,
Iterator2 last ) const
inline

This function throws if any node in the range from first to last is out of bounds i.e. if they are greater than or equal to number_of_nodes.

Template Parameters
Iteratorthe type of the parameters first and last.
Parameters
firstan iterator pointing at the first node to check.
lastan iterator pointing one beyond the last node to check.
Exceptions
LibsemigroupsExceptionif any node in the range first to last is out of bounds.

◆ throw_if_node_out_of_bounds() [2/2]

template<typename Node>
template<typename Node2>
void throw_if_node_out_of_bounds ( Node2 n) const

This function throws if the node n is out of bounds i.e. if it is greater than or equal to number_of_nodes.

Template Parameters
Node2the type of the node n.
Parameters
nthe node to check.
Exceptions
LibsemigroupsExceptionif n is out of bounds.

◆ word_graph()

template<typename Node>
WordGraph< Node > const * word_graph ( ) const
inlinenodiscardnoexcept

This function returns a const pointer to the underlying WordGraph over which the view is defined

Returns
The underlying WordGraph.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

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