libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
libsemigroups::froidure_pin Namespace Reference

Functions

template<typename Element>
void add_generators (FroidurePin< Element > &fp, std::initializer_list< Element > coll)
 Add collection of generators from initializer list.
 
template<typename Container>
void add_generators (FroidurePin< typename Container::value_type > &fp, Container const &coll)
 Add collection of generators from container.
 
template<typename Element>
void add_generators_no_checks (FroidurePin< Element > &fp, std::initializer_list< Element > coll)
 Add collection of generators from initializer list.
 
template<typename Container>
void add_generators_no_checks (FroidurePin< typename Container::value_type > &fp, Container const &coll)
 Add collection of generators from container.
 
template<typename Element>
void closure (FroidurePin< Element > &fp, std::initializer_list< Element > coll)
 Add non-redundant generators from a std::initializer_list.
 
template<typename Container>
void closure (FroidurePin< typename Container::value_type > &fp, Container const &coll)
 Add non-redundant generators from a container.
 
template<typename Element>
void closure_no_checks (FroidurePin< Element > &fp, std::initializer_list< Element > coll)
 Add non-redundant generators from a std::initializer_list.
 
template<typename Container>
void closure_no_checks (FroidurePin< typename Container::value_type > &fp, Container const &coll)
 Add non-redundant generators from a container.
 
template<typename Element>
FroidurePin< Element > copy_add_generators (FroidurePin< Element > const &fp, std::initializer_list< Element > coll)
 Copy a FroidurePin instance and add a collection of generators from std::initializer_list.
 
template<typename Container>
FroidurePin< typename Container::value_type > copy_add_generators (FroidurePin< typename Container::value_type > const &fp, Container const &coll)
 Copy a FroidurePin instance and add a collection of generators from a container.
 
template<typename Element>
FroidurePin< Element > copy_add_generators_no_checks (FroidurePin< Element > const &fp, std::initializer_list< Element > coll)
 Copy a FroidurePin instance and add a collection of generators from std::initializer_list.
 
template<typename Container>
FroidurePin< typename Container::value_type > copy_add_generators_no_checks (FroidurePin< typename Container::value_type > const &fp, Container const &coll)
 Copy a FroidurePin instance and add a collection of generators from a container.
 
template<typename Element>
FroidurePin< Element > copy_closure (FroidurePin< Element > &fp, std::initializer_list< Element > coll)
 Copy and add non-redundant generators from a std::initializer_list.
 
template<typename Container>
FroidurePin< typename Container::value_type > copy_closure (FroidurePin< typename Container::value_type > &fp, Container const &coll)
 Copy and add non-redundant generators from a container.
 
template<typename Element>
FroidurePin< Element > copy_closure_no_checks (FroidurePin< Element > &fp, std::initializer_list< Element > coll)
 Copy and add non-redundant generators from a std::initializer_list.
 
template<typename Container>
FroidurePin< typename Container::value_type > copy_closure_no_checks (FroidurePin< typename Container::value_type > &fp, Container const &coll)
 Copy and add non-redundant generators from a container.
 
template<typename Element, typename Traits>
auto current_elements (FroidurePin< Element, Traits > const &fp)
 Returns a range object containing the so-far enumerated elements.
 
template<typename Word>
void current_factorisation_no_checks (FroidurePinBase const &fpb, Word &word, FroidurePinBase::element_index_type pos)
 Modify a word to contain a word representing an element given by index.
 
template<typename Word = word_type>
Word current_minimal_factorisation (FroidurePinBase const &fpb, FroidurePinBase::element_index_type pos)
 Returns the short-lex least word representing an element given by index.
 
template<typename Word>
void current_minimal_factorisation (FroidurePinBase const &fpb, Word &word, FroidurePinBase::element_index_type pos)
 Modify a word to contain the short-lex least word representing an element given by index.
 
template<typename Word = word_type>
Word current_minimal_factorisation_no_checks (FroidurePinBase const &fpb, FroidurePinBase::element_index_type pos)
 Returns the short-lex least word representing an element given by index.
 
template<typename Word>
void current_minimal_factorisation_no_checks (FroidurePinBase const &fpb, Word &word, FroidurePinBase::element_index_type pos)
 Modify a word to contain the short-lex least word representing an element given by index.
 
rx::iterator_range< FroidurePinBase::const_normal_form_iteratorcurrent_normal_forms (FroidurePinBase const &fpb)
 Returns a range object containing normal forms for the so-far enumerated elements.
 
static FroidurePinBase::element_index_type current_position (FroidurePinBase const &fpb, std::initializer_list< int > const &w)
 Returns the position corresponding to a word.
 
template<typename Word>
FroidurePinBase::element_index_type current_position (FroidurePinBase const &fpb, Word const &w)
 Returns the position corresponding to a word.
 
static FroidurePinBase::element_index_type current_position_no_checks (FroidurePinBase const &fpb, std::initializer_list< int > const &w)
 Returns the position corresponding to a word.
 
template<typename Word>
FroidurePinBase::element_index_type current_position_no_checks (FroidurePinBase const &fpb, Word const &w)
 Returns the position corresponding to a word.
 
rx::iterator_range< FroidurePinBase::const_rule_iteratorcurrent_rules (FroidurePinBase const &fpb)
 Returns a range object containing the so-far enumerated rules.
 
template<typename Element, typename Traits>
auto elements (FroidurePin< Element, Traits > &fp)
 Returns a range object containing all of the elements.
 
template<typename Element, typename Traits, typename Word>
bool equal_to (FroidurePin< Element, Traits > const &fp, Word const &x, Word const &y)
 Check equality of words in the generators.
 
template<typename Element, typename Traits, typename Word>
bool equal_to_no_checks (FroidurePin< Element, Traits > const &fp, Word const &x, Word const &y)
 Check equality of words in the generators.
 
template<typename Element, typename Traits, typename Word = word_type>
Word factorisation (FroidurePin< Element, Traits > &fp, typename FroidurePin< Element, Traits >::const_reference x)
 Returns a word containing a factorisation (in the generators) of an element.
 
template<typename Element, typename Traits, typename Word>
void factorisation (FroidurePin< Element, Traits > &fp, Word &w, typename FroidurePin< Element, Traits >::const_reference x)
 Modify a word in-place to contain a minimal factorisation (in the generators) of an element.
 
template<typename Word = word_type>
Word factorisation (FroidurePinBase &fpb, FroidurePinBase::element_index_type pos)
 Returns a word representing an element given by index.
 
template<typename Word>
void factorisation (FroidurePinBase &fpb, Word &word, FroidurePinBase::element_index_type pos)
 Modify a word to contain a word representing an element given by index.
 
template<typename Element, typename Traits>
auto idempotents (FroidurePin< Element, Traits > &fp)
 Returns a range object containing all of the idempotents.
 
template<typename Element>
FroidurePin< Element > init (FroidurePin< Element > &fp, std::initializer_list< Element > gens)
 Re-initialize a FroidurePin object from a container of generators.
 
template<typename Container>
FroidurePin< typename Container::value_type > & init (FroidurePin< typename Container::value_type > &fp, Container const &gens)
 Re-initialize a FroidurePin object from a container of generators.
 
template<typename Element, typename Traits, typename Word = word_type>
Word minimal_factorisation (FroidurePin< Element, Traits > &fp, typename FroidurePin< Element, Traits >::const_reference x)
 Returns a word containing a minimal factorisation (in the generators) of an element.
 
template<typename Element, typename Traits, typename Word>
void minimal_factorisation (FroidurePin< Element, Traits > &fp, Word &w, typename FroidurePin< Element, Traits >::const_reference x)
 Modify a word in-place to contain a minimal factorisation (in the generators) of an element.
 
template<typename Word = word_type>
Word minimal_factorisation (FroidurePinBase &fpb, FroidurePinBase::element_index_type pos)
 Returns the short-lex least word representing an element given by index.
 
template<typename Word>
void minimal_factorisation (FroidurePinBase &fpb, Word &word, FroidurePinBase::element_index_type pos)
 Modify a word to contain the short-lex least word representing an element given by index.
 
rx::iterator_range< FroidurePinBase::const_normal_form_iteratornormal_forms (FroidurePinBase &fpb)
 Returns a range object containing normal forms for all the elements.
 
static FroidurePinBase::element_index_type position (FroidurePinBase &fpb, std::initializer_list< int > const &w)
 Returns the position corresponding to a word.
 
template<typename Word>
FroidurePinBase::element_index_type position (FroidurePinBase &fpb, Word const &w)
 Returns the position corresponding to a word.
 
static FroidurePinBase::element_index_type position_no_checks (FroidurePinBase &fpb, std::initializer_list< int > const &w)
 Returns the position corresponding to a word.
 
template<typename Word>
FroidurePinBase::element_index_type position_no_checks (FroidurePinBase &fpb, Word const &w)
 Returns the position corresponding to a word.
 
FroidurePinBase::element_index_type product_by_reduction (FroidurePinBase const &fpb, typename FroidurePinBase::element_index_type i, typename FroidurePinBase::element_index_type j)
 Compute a product using the Cayley graph.
 
FroidurePinBase::element_index_type product_by_reduction_no_checks (FroidurePinBase const &fpb, typename FroidurePinBase::element_index_type i, typename FroidurePinBase::element_index_type j)
 Compute a product using the Cayley graph.
 
rx::iterator_range< FroidurePinBase::const_rule_iteratorrules (FroidurePinBase &fpb)
 Returns a range object containing all of the rules.
 
template<typename Element, typename Traits>
auto sorted_elements (FroidurePin< Element, Traits > &fp)
 Returns a range object containing all of the elements.
 
template<typename Element, typename Traits, typename T = size_t>
FroidurePin< Element, Traits >::const_reference to_element (FroidurePin< Element, Traits > const &fp, std::initializer_list< T > const &w)
 Convert a word in the generators to an element.
 
template<typename Element, typename Traits, typename Word>
FroidurePin< Element, Traits >::const_reference to_element (FroidurePin< Element, Traits > const &fp, Word const &w)
 Convert a word in the generators to an element.
 
template<typename Element, typename Traits, typename T = size_t>
FroidurePin< Element, Traits >::const_reference to_element_no_checks (FroidurePin< Element, Traits > const &fp, std::initializer_list< T > const &w)
 Convert a word in the generators to an element.
 
template<typename Element, typename Traits, typename Word>
FroidurePin< Element, Traits >::const_reference to_element_no_checks (FroidurePin< Element, Traits > const &fp, Word const &w)
 Convert a word in the generators to an element.
 

Function Documentation

◆ add_generators() [1/2]

template<typename Element>
void add_generators ( FroidurePin< Element > & fp,
std::initializer_list< Element > coll )

See add_generator for a detailed description.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Exceptions
LibsemigroupsExceptionif the degree of x is incompatible with the existing degree of fp (if any).

◆ add_generators() [2/2]

template<typename Container>
void add_generators ( FroidurePin< typename Container::value_type > & fp,
Container const & coll )

See add_generators for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Exceptions
LibsemigroupsExceptionif the degree of x is incompatible with the existing degree of fp (if any).

◆ add_generators_no_checks() [1/2]

template<typename Element>
void add_generators_no_checks ( FroidurePin< Element > & fp,
std::initializer_list< Element > coll )

See add_generator_no_checks for a detailed description.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in coll all have the same degree.

◆ add_generators_no_checks() [2/2]

template<typename Container>
void add_generators_no_checks ( FroidurePin< typename Container::value_type > & fp,
Container const & coll )

See add_generator_no_checks for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in gens all have the same degree.

◆ closure() [1/2]

template<typename Element>
void closure ( FroidurePin< Element > & fp,
std::initializer_list< Element > coll )

See closure for a detailed description.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
collthe collection of generator to add.
Exceptions
LibsemigroupsExceptionif the degree of x is incompatible with the existing degree of fp (if any).

◆ closure() [2/2]

template<typename Container>
void closure ( FroidurePin< typename Container::value_type > & fp,
Container const & coll )

See closure for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generator to add.
Exceptions
LibsemigroupsExceptionif the degree of x is incompatible with the existing degree of fp (if any).

◆ closure_no_checks() [1/2]

template<typename Element>
void closure_no_checks ( FroidurePin< Element > & fp,
std::initializer_list< Element > coll )

See closure for a detailed description.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
collthe collection of generator to add.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in coll all have the same degree.

◆ closure_no_checks() [2/2]

template<typename Container>
void closure_no_checks ( FroidurePin< typename Container::value_type > & fp,
Container const & coll )

See closure_no_checks for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generator to add.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in coll all have the same degree.

◆ copy_add_generators() [1/2]

template<typename Element>
FroidurePin< Element > copy_add_generators ( FroidurePin< Element > const & fp,
std::initializer_list< Element > coll )
nodiscard

See copy_add_generators for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of fp and coll.
Exceptions
LibsemigroupsExceptionif the degree of any element in coll is incompatible with the existing degree of fp (if any).

◆ copy_add_generators() [2/2]

template<typename Container>
FroidurePin< typename Container::value_type > copy_add_generators ( FroidurePin< typename Container::value_type > const & fp,
Container const & coll )
nodiscard

See copy_add_generators for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of fp and coll.
Exceptions
LibsemigroupsExceptionif the degree of any element in coll is incompatible with the existing degree of fp (if any).

◆ copy_add_generators_no_checks() [1/2]

template<typename Element>
FroidurePin< Element > copy_add_generators_no_checks ( FroidurePin< Element > const & fp,
std::initializer_list< Element > coll )
nodiscard

See copy_add_generators for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of fp and coll.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in gens all have the same degree.

◆ copy_add_generators_no_checks() [2/2]

template<typename Container>
FroidurePin< typename Container::value_type > copy_add_generators_no_checks ( FroidurePin< typename Container::value_type > const & fp,
Container const & coll )
nodiscard

See copy_add_generators_no_checks for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of fp and coll.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in coll all have the same degree.

◆ copy_closure() [1/2]

template<typename Element>
FroidurePin< Element > copy_closure ( FroidurePin< Element > & fp,
std::initializer_list< Element > coll )
nodiscard

See copy_closure for a detailed description.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of this and the non-redundant generators from coll.
Exceptions
LibsemigroupsExceptionif the degree of any element in coll is incompatible with the existing degree of fp (if any).

◆ copy_closure() [2/2]

template<typename Container>
FroidurePin< typename Container::value_type > copy_closure ( FroidurePin< typename Container::value_type > & fp,
Container const & coll )
nodiscard

See copy_closure for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of this and the non-redundant generators from coll.
Exceptions
LibsemigroupsExceptionif the degree of any element in coll is incompatible with the existing degree of fp (if any).

◆ copy_closure_no_checks() [1/2]

template<typename Element>
FroidurePin< Element > copy_closure_no_checks ( FroidurePin< Element > & fp,
std::initializer_list< Element > coll )
nodiscard

See copy_closure_no_checks for a detailed description.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of this and the non-redundant generators from coll.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in coll all have the same degree.

◆ copy_closure_no_checks() [2/2]

template<typename Container>
FroidurePin< typename Container::value_type > copy_closure_no_checks ( FroidurePin< typename Container::value_type > & fp,
Container const & coll )
nodiscard

See copy_closure_no_checks for a detailed description.

Template Parameters
Containerthe type of the container for generators to add.
Parameters
fpthe FroidurePin instance.
collthe collection of generators to add.
Returns
A new FroidurePin instance generated by the generators of this and the non-redundant generators from coll.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in coll all have the same degree.

◆ current_elements()

template<typename Element, typename Traits>
auto current_elements ( FroidurePin< Element, Traits > const & fp)
nodiscard

This function returns a range object wrapping FroidurePin::cbegin and FroidurePin::cend, i.e. containing the so-far enumerated elements.

See Ranges for more details about range objects.

Template Parameters
Elementthe type of the elements in the represented semigroup.
Traitsa traits class holding various adapters used by the implementation (defaults to FroidurePinTraits).
Parameters
fpthe FroidurePin instance.
Returns
A range object.
Note
This function does not trigger any enumeration.

◆ current_factorisation_no_checks()

template<typename Word>
void current_factorisation_no_checks ( FroidurePinBase const & fpb,
Word & word,
FroidurePinBase::element_index_type pos )

This function changes word in-place to contain a (maybe not minimal) word (in the generators) equal to the element in position pos.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
wordthe word to clear and change in-place.
posthe index of the element whose factorisation is sought.
Complexity
Constant.
Note
This function does not trigger any enumeration.
Warning
This function does not check that pos is valid. In particular, it is assumed that pos is strictly less than current_size.

◆ current_minimal_factorisation() [1/2]

template<typename Word = word_type>
Word current_minimal_factorisation ( FroidurePinBase const & fpb,
FroidurePinBase::element_index_type pos )
nodiscard

This function is similar to the 3-argument version current_minimal_factorisation, but it returns a Word by value instead of modifying its argument in-place.

Template Parameters
Wordthe type of the returned word (defaults to word_type).
Parameters
fpbthe FroidurePinBase instance.
posthe index of the element whose factorisation is sought.
Returns
A word containing the factorisation of the given element.
Exceptions
LibsemigroupsExceptionif pos is greater than or equal to current_size.
Complexity
At worst \(O(mn)\) where \(m\) equals pos and \(n\) is the return value of FroidurePin::number_of_generators.
Note
This function does not trigger any enumeration.

◆ current_minimal_factorisation() [2/2]

template<typename Word>
void current_minimal_factorisation ( FroidurePinBase const & fpb,
Word & word,
FroidurePinBase::element_index_type pos )

This function changes word in-place to contain the short-lex minimal word (in the generators) equal to the element in position pos.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
wordthe word to clear and change in-place.
posthe index of the element whose factorisation is sought.
Exceptions
LibsemigroupsExceptionif pos is greater than or equal to current_size.
Complexity
Constant.
Note
This function does not trigger any enumeration.

◆ current_minimal_factorisation_no_checks() [1/2]

template<typename Word = word_type>
Word current_minimal_factorisation_no_checks ( FroidurePinBase const & fpb,
FroidurePinBase::element_index_type pos )
nodiscard

This function is similar to the 3-argument version current_minimal_factorisation_no_checks, but it returns a Word by value instead of modifying its argument in-place.

Template Parameters
Wordthe type of the returned word (defaults to word_type).
Parameters
fpbthe FroidurePinBase instance.
posthe index of the element whose factorisation is sought.
Returns
A word containing the factorisation of the given element.
Complexity
At worst \(O(mn)\) where \(m\) equals pos and \(n\) is the return value of FroidurePin::number_of_generators.
Note
This function does not trigger any enumeration.
Warning
This function does not check that pos is valid. In particular, it is assumed that pos is strictly less than current_size.

◆ current_minimal_factorisation_no_checks() [2/2]

template<typename Word>
void current_minimal_factorisation_no_checks ( FroidurePinBase const & fpb,
Word & word,
FroidurePinBase::element_index_type pos )

This function changes word in-place to contain the short-lex minimal word (in the generators) equal to the element in position pos.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
wordthe word to clear and change in-place.
posthe index of the element whose factorisation is sought.
Complexity
Constant.
Note
This function does not trigger any enumeration.
Warning
This function does not check that pos is valid. In particular, it is assumed that pos is strictly less than current_size.

◆ current_normal_forms()

rx::iterator_range< FroidurePinBase::const_normal_form_iterator > current_normal_forms ( FroidurePinBase const & fpb)
nodiscard

This function returns a range object containing normal forms for the elements of fpb that have been enumerated so far.

Parameters
fpbthe FroidurePinBase object.
Returns
The normal forms that have been enumerated so far.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Note
This function does not trigger any enumeration.

◆ current_position() [1/2]

static FroidurePinBase::element_index_type current_position ( FroidurePinBase const & fpb,
std::initializer_list< int > const & w )
inlinestaticnodiscard

This function returns the position of the element corresponding to the word w.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w.
Exceptions
LibsemigroupsExceptionif w does not consist of values strictly less than FroidurePin::number_of_generators.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function does not trigger any enumeration.
See also
FroidurePin::to_element.

◆ current_position() [2/2]

template<typename Word>
FroidurePinBase::element_index_type current_position ( FroidurePinBase const & fpb,
Word const & w )
nodiscard

This function returns the position of the element corresponding to the word w.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w.
Exceptions
LibsemigroupsExceptionif w does not consist of values strictly less than FroidurePin::number_of_generators.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function does not trigger any enumeration.
See also
FroidurePin::to_element.

◆ current_position_no_checks() [1/2]

static FroidurePinBase::element_index_type current_position_no_checks ( FroidurePinBase const & fpb,
std::initializer_list< int > const & w )
inlinestaticnodiscard

This function returns the position of the element corresponding to the word w; UNDEFINED is returned if the position of the element corresponding to w cannot be determined.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w, or UNDEFINED if there is no such element.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function does not trigger any enumeration.
Warning
This function does not check its argument is valid. In particular, it is assumed that every item in w is strictly less than current_size.
See also
FroidurePin::to_element.

◆ current_position_no_checks() [2/2]

template<typename Word>
FroidurePinBase::element_index_type current_position_no_checks ( FroidurePinBase const & fpb,
Word const & w )
nodiscard

This function returns the position of the element corresponding to the word w; UNDEFINED is returned if the position of the element corresponding to w cannot be determined.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w, or UNDEFINED if there is no such element.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function does not trigger any enumeration.
Warning
This function does not check its argument is valid. In particular, it is assumed that every item in w is strictly less than current_size.
See also
FroidurePin::to_element.

◆ current_rules()

rx::iterator_range< FroidurePinBase::const_rule_iterator > current_rules ( FroidurePinBase const & fpb)
nodiscard

This function returns a range object containing the rules of the semigroup that have been enumerated so far. Calling this function does not trigger any enumeration.

Parameters
fpbthe FroidurePinBase object.
Returns
A range object containing the rules that have been enumerated so far.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Note
This function does not trigger any enumeration.

◆ elements()

template<typename Element, typename Traits>
auto elements ( FroidurePin< Element, Traits > & fp)
nodiscard

This function returns a range object wrapping FroidurePin::cbegin and FroidurePin::cend, after fully enumerating fp.

See Ranges for more details about range objects.

Template Parameters
Elementthe type of the elements in the represented semigroup.
Traitsa traits class holding various adapters used by the implementation (defaults to FroidurePinTraits).
Parameters
fpthe FroidurePin instance.
Returns
A range object.
Note
This function triggers a full enumeration.

◆ equal_to()

template<typename Element, typename Traits, typename Word>
bool equal_to ( FroidurePin< Element, Traits > const & fp,
Word const & x,
Word const & y )
nodiscard

This function returns true if the parameters represent the same element and false otherwise.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Wordthe type of the second and third arguments.
Parameters
fpthe FroidurePin instance.
xthe first word.
ythe second word.
Returns
A value of type bool.
Exceptions
LibsemigroupsExceptionif x or y contains a value greater than or equal to FroidurePin::number_of_generators.
Note
This function does not trigger any enumeration.

◆ equal_to_no_checks()

template<typename Element, typename Traits, typename Word>
bool equal_to_no_checks ( FroidurePin< Element, Traits > const & fp,
Word const & x,
Word const & y )
nodiscard

This function returns true if the parameters represent the same element and false otherwise.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Wordthe type of the second and third arguments.
Parameters
fpthe FroidurePin instance.
xthe first word.
ythe second word.
Returns
A value of type bool.
Note
This function does not trigger any enumeration.
Warning
This function does not check its arguments. In particular, it is assumed that every value in x and y is strictly less than FroidurePin::number_of_generators.

◆ factorisation() [1/4]

template<typename Element, typename Traits, typename Word = word_type>
Word factorisation ( FroidurePin< Element, Traits > & fp,
typename FroidurePin< Element, Traits >::const_reference x )
nodiscard

This function returns a word in the generators that equals the given element x. The key difference between this function and froidure_pin::minimal_factorisation, is that the resulting factorisation may not be minimal.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Wordthe type of the second and third arguments.
Parameters
fpthe FroidurePin instance.
xa const reference to a possible element to factorise.
Returns
A word that evaluates to x.
Exceptions
LibsemigroupsExceptionif x does not belong to the FroidurePin instance.
Note
This function triggers an enumeration until it is complete or at least until x is found.

◆ factorisation() [2/4]

template<typename Element, typename Traits, typename Word>
void factorisation ( FroidurePin< Element, Traits > & fp,
Word & w,
typename FroidurePin< Element, Traits >::const_reference x )

This function returns the short-lex minimum word (if any) in the generators that evaluates to x. The key difference between this function and froidure_pin::minimal_factorisation(word_type&, const_reference), is that the resulting factorisation may not be minimal.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Wordthe type of the second and third arguments.
Parameters
fpthe FroidurePin instance.
wthe Word to contain the factorisation.
xa const reference to a possible element to factorise.
Exceptions
LibsemigroupsExceptionif x does not belong to the FroidurePin instance.
Note
This function triggers an enumeration until it is complete or at least until x is found.

◆ factorisation() [3/4]

template<typename Word = word_type>
Word factorisation ( FroidurePinBase & fpb,
FroidurePinBase::element_index_type pos )
nodiscard

This is similar to the three-argument version for minimal_factorisation, but it returns a Word by value instead of modifying an argument in-place.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
posthe index of the element whose factorisation is sought.
Returns
A word containing the factorisation of the given element.
Exceptions
LibsemigroupsExceptionif pos is greater than or equal to size().
Complexity
At worst \(O(mn)\) where \(m\) equals pos and \(n\) is the return value of FroidurePin::number_of_generators.
Note
This function triggers an enumeration until it is complete or at least pos elements are found.

◆ factorisation() [4/4]

template<typename Word>
void factorisation ( FroidurePinBase & fpb,
Word & word,
FroidurePinBase::element_index_type pos )

This function changes word in-place to contain a word (in the generators) equal to the element in position pos.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
wordthe word to clear and change in-place.
posthe index of the element whose factorisation is sought.
Complexity
Constant.
Note
This function triggers an enumeration until it is complete or at least pos elements are found.
Warning
This function does not check that pos is valid. In particular, it is assumed that pos is strictly less than current_size.

◆ idempotents()

template<typename Element, typename Traits>
auto idempotents ( FroidurePin< Element, Traits > & fp)
nodiscard

This function returns a range object wrapping FroidurePin::cbegin_idempotents and FroidurePin::cend_idempotents, after fully enumerating fp.

See Ranges for more details about range objects.

Template Parameters
Elementthe type of the elements in the represented semigroup.
Traitsa traits class holding various adapters used by the implementation (defaults to FroidurePinTraits).
Parameters
fpthe FroidurePin instance.
Returns
A range object.
Note
This function triggers a full enumeration.

◆ init() [1/2]

template<typename Element>
FroidurePin< Element > init ( FroidurePin< Element > & fp,
std::initializer_list< Element > gens )
nodiscard

This function re-initializes a FroidurePin object from the container of generators gens.

Template Parameters
Containerthe type of the container.
Parameters
fpthe FroidurePin instance.
gensthe generators.
Returns
A const reference to the first parameter.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in gens all have the same degree.

◆ init() [2/2]

template<typename Container>
FroidurePin< typename Container::value_type > & init ( FroidurePin< typename Container::value_type > & fp,
Container const & gens )

This function re-initializes a FroidurePin object from the container of generators gens.

Template Parameters
Containerthe type of the container.
Parameters
fpthe FroidurePin instance.
gensthe generators.
Returns
A const reference to the first parameter.
Warning
This function does not check its arguments. In particular, it is assumed that the generators in gens all have the same degree.

◆ minimal_factorisation() [1/4]

template<typename Element, typename Traits, typename Word = word_type>
Word minimal_factorisation ( FroidurePin< Element, Traits > & fp,
typename FroidurePin< Element, Traits >::const_reference x )
nodiscard

This function returns the short-lex minimum word (if any) in the generators that evaluates to x.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Wordthe type of the second and third arguments.
Parameters
fpthe FroidurePin instance.
xa const reference to a possible element to factorise.
Returns
A word_type which evaluates to x.
Exceptions
LibsemigroupsExceptionif x does not belong to this.
Note
This function triggers an enumeration until it is complete or at least pos elements are found.
See also
FroidurePin::to_element.

◆ minimal_factorisation() [2/4]

template<typename Element, typename Traits, typename Word>
void minimal_factorisation ( FroidurePin< Element, Traits > & fp,
Word & w,
typename FroidurePin< Element, Traits >::const_reference x )

This function returns the short-lex minimum word (if any) in the generators that evaluates to x.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Wordthe type of the second and third arguments.
Parameters
fpthe FroidurePin instance.
wthe Word to contain the factorisation.
xa const reference to a possible element to factorise.
Exceptions
LibsemigroupsExceptionif x does not belong to the FroidurePin instance.
Note
This function triggers an enumeration until it is complete or at least pos elements are found.

◆ minimal_factorisation() [3/4]

template<typename Word = word_type>
Word minimal_factorisation ( FroidurePinBase & fpb,
FroidurePinBase::element_index_type pos )
nodiscard

This is similar to the three-argument version for minimal_factorisation, but it returns a Word by value instead of modifying an argument in-place.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
posthe index of the element whose factorisation is sought.
Returns
A word containing the factorisation of the given element.
Exceptions
LibsemigroupsExceptionif pos is greater than or equal to size().
Complexity
At worst \(O(mn)\) where \(m\) equals pos and \(n\) is the return value of FroidurePin::number_of_generators.
Note
This function triggers an enumeration until it is complete or at least pos elements are found.

◆ minimal_factorisation() [4/4]

template<typename Word>
void minimal_factorisation ( FroidurePinBase & fpb,
Word & word,
FroidurePinBase::element_index_type pos )

This function changes word in-place to contain the short-lex minimal word (in the generators) equal to the element in position pos.

Template Parameters
Wordthe type of the second argument.
Parameters
fpbthe FroidurePinBase instance.
wordthe word to clear and change in-place.
posthe index of the element whose factorisation is sought.
Exceptions
LibsemigroupsExceptionif pos is greater than or equal to current_size.
Complexity
Constant.
Note
This function triggers an enumeration until it is complete or at least pos elements are found.

◆ normal_forms()

rx::iterator_range< FroidurePinBase::const_normal_form_iterator > normal_forms ( FroidurePinBase & fpb)
nodiscard

This function returns a range object containing normal forms for all of the elements of the semigroup. Calling this function triggers a full enumeration.

Parameters
fpbthe FroidurePinBase object.
Returns
A range object containing the normal forms.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
The same as FroidurePinBase::enumerate.
Note
This function triggers a full enumeration.

◆ position() [1/2]

static FroidurePinBase::element_index_type position ( FroidurePinBase & fpb,
std::initializer_list< int > const & w )
inlinestaticnodiscard

This function returns the position of the element corresponding to the word w.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w.
Exceptions
LibsemigroupsExceptionif w does not consist of values strictly less than FroidurePin::number_of_generators.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function triggers a full enumeration.
See also
FroidurePin::to_element.

◆ position() [2/2]

template<typename Word>
FroidurePinBase::element_index_type position ( FroidurePinBase & fpb,
Word const & w )
nodiscard

This function returns the position of the element corresponding to the word w.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w.
Exceptions
LibsemigroupsExceptionif w does not consist of values strictly less than FroidurePin::number_of_generators.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function triggers a full enumeration.
See also
FroidurePin::to_element.

◆ position_no_checks() [1/2]

static FroidurePinBase::element_index_type position_no_checks ( FroidurePinBase & fpb,
std::initializer_list< int > const & w )
inlinestaticnodiscard

This function returns the position of the element corresponding to the word w.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function triggers a full enumeration.
Warning
This function does not check its argument is valid. In particular, it is assumed that every item in w is strictly less than current_size.
See also
FroidurePin::to_element.

◆ position_no_checks() [2/2]

template<typename Word>
FroidurePinBase::element_index_type position_no_checks ( FroidurePinBase & fpb,
Word const & w )
nodiscard

This function returns the position of the element corresponding to the word w.

Template Parameters
Wordthe type of the argument.
Parameters
fpbthe FroidurePinBase instance.
wa word in the generators.
Returns
The index of the element corresponding to the word w.
Complexity
\(O(n)\) where \(n\) is the length of the word w.
Note
This function triggers a full enumeration.
Warning
This function does not check its argument is valid. In particular, it is assumed that every item in w is strictly less than current_size.
See also
FroidurePin::to_element.

◆ product_by_reduction()

This function finds the product of fpb.at(i) and fpb.at(j) by following the path in the right Cayley graph from i labelled by the word fpb.minimal_factorisation(j) or, if fpb.minimal_factorisation(i) is shorter, by following the path in the left Cayley graph from j labelled by fpb.minimal_factorisation(i).

Parameters
fpbthe FroidurePinBase object.
ithe index of an element.
janother index of an element.
Returns
A value of type element_index_type.
Exceptions
LibsemigroupsExceptionif i or j is greater than or equal to FroidurePinBase::current_size.
Complexity
\(O(n)\) where \(n\) is the minimum of the lengths of minimal_factorisation(i) and minimal_factorisation(j).
Note
This function does not trigger any enumeration.

◆ product_by_reduction_no_checks()

FroidurePinBase::element_index_type product_by_reduction_no_checks ( FroidurePinBase const & fpb,
typename FroidurePinBase::element_index_type i,
typename FroidurePinBase::element_index_type j )
nodiscard

This function finds the product of fpb.at(i) and fpb.at(j) by following the path in the right Cayley graph from i labelled by the word fpb.minimal_factorisation(j) or, if fpb.minimal_factorisation(i) is shorter, by following the path in the left Cayley graph from j labelled by fpb.minimal_factorisation(i).

Parameters
fpbthe FroidurePinBase object.
ithe index of an element.
janother index of an element.
Returns
A value of type element_index_type.
Complexity
\(O(n)\) where \(n\) is the minimum of the lengths of minimal_factorisation(i) and minimal_factorisation(j).
Note
This function does not trigger any enumeration.
Warning
This function does not check its arguments. In particular, if i or j is greater than or equal to FroidurePinBase::current_size, then bad things will happen.

◆ rules()

rx::iterator_range< FroidurePinBase::const_rule_iterator > rules ( FroidurePinBase & fpb)
nodiscard

This function returns a range object containing all of the rules of the semigroup that have been enumerated so far. Calling this function triggers a full enumeration.

Parameters
fpbthe FroidurePinBase object.
Returns
A range object containing all of the rules.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
The same as FroidurePinBase::enumerate.
Note
This function triggers a full enumeration.

◆ sorted_elements()

template<typename Element, typename Traits>
auto sorted_elements ( FroidurePin< Element, Traits > & fp)
nodiscard

This function returns a range object wrapping FroidurePin::cbegin_sorted and FroidurePin::cend_sorted, after fully enumerating fp.

See Ranges for more details about range objects.

Template Parameters
Elementthe type of the elements in the represented semigroup.
Traitsa traits class holding various adapters used by the implementation (defaults to FroidurePinTraits).
Parameters
fpthe FroidurePin instance.
Returns
A range object.
Note
This function triggers a full enumeration.

◆ to_element() [1/2]

template<typename Element, typename Traits, typename T = size_t>
FroidurePin< Element, Traits >::const_reference to_element ( FroidurePin< Element, Traits > const & fp,
std::initializer_list< T > const & w )
nodiscard

This function returns a reference to the element obtained by evaluating w. The returned reference may only be valid until the next function that triggers an enumeration is called, or another call to this function is made.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
wthe word in the generators to evaluate.
Returns
A copy of the element represented by the word w.
Exceptions
LibsemigroupsExceptionif w is not a valid word in the generators, i.e. if it contains a value greater than or equal to the number of generators.
LibsemigroupsExceptionif w is empty and FroidurePin::currently_contains_one returns true.
Note
This function does not trigger any enumeration.
See also
current_position.

◆ to_element() [2/2]

template<typename Element, typename Traits, typename Word>
FroidurePin< Element, Traits >::const_reference to_element ( FroidurePin< Element, Traits > const & fp,
Word const & w )
nodiscard

This function returns a reference to the element obtained by evaluating w. The returned reference may only be valid until the next function that triggers an enumeration is called, or another call to this function is made.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
wthe word in the generators to evaluate.
Returns
A copy of the element represented by the word w.
Exceptions
LibsemigroupsExceptionif w is not a valid word in the generators, i.e. if it contains a value greater than or equal to the number of generators.
LibsemigroupsExceptionif w is empty and FroidurePin::currently_contains_one returns true.
Note
This function does not trigger any enumeration.
See also
current_position.

◆ to_element_no_checks() [1/2]

template<typename Element, typename Traits, typename T = size_t>
FroidurePin< Element, Traits >::const_reference to_element_no_checks ( FroidurePin< Element, Traits > const & fp,
std::initializer_list< T > const & w )
nodiscard

This function returns a reference to the element obtained by evaluating w. The returned reference may only be valid until the next function that triggers an enumeration is called, or another call to this function is made.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
wthe word in the generators to evaluate.
Returns
A const reference to the element represented by the word w.
Note
This function does not trigger any enumeration.
Warning
This function does not check its arguments, and it is assumed that the values in w are less than FroidurePin::number_of_generators; and if w is empty it is assumed that FroidurePin::currently_contains_one returns true (although nothing bad will happen if this doesn't hold, except that this function will return the identity element even though it might not be an element of the semigroup).
See also
FroidurePin::current_position.

◆ to_element_no_checks() [2/2]

template<typename Element, typename Traits, typename Word>
FroidurePin< Element, Traits >::const_reference to_element_no_checks ( FroidurePin< Element, Traits > const & fp,
Word const & w )
nodiscard

This function returns a reference to the element obtained by evaluating w. The returned reference may only be valid until the next function that triggers an enumeration is called, or another call to this function is made.

Template Parameters
Elementthe type of the elements in the FroidurePin instance.
Traitsthe traits class for the FroidurePin instance.
Parameters
fpthe FroidurePin instance.
wthe word in the generators to evaluate.
Returns
A const reference to the element represented by the word w.
Note
This function does not trigger any enumeration.
Warning
This function does not check its arguments, and it is assumed that the values in w are less than FroidurePin::number_of_generators; and if w is empty it is assumed that FroidurePin::currently_contains_one returns true (although nothing bad will happen if this doesn't hold, except that this function will return the identity element even though it might not be an element of the semigroup).
See also
FroidurePin::current_position.