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

Defined in cong-common-helpers.hpp.

This page contains the documentation of the functions partition(Thing&, Range) and non_trivial_classes for partitioning a range of words by a congruence.

Functions

template<typename Thing, typename Iterator1, typename Iterator2>
std::vector< std::vector< typename Thing::native_word_type > > non_trivial_classes (Thing &thing, Iterator1 first, Iterator2 last)
 Partition a range of words into non-trivial classes (via iterators).
 
template<typename Thing, typename Range, typename = std::enable_if_t<rx::is_input_or_sink_v<Range>>>
std::vector< std::vector< typename Thing::native_word_type > > non_trivial_classes (Thing &thing, Range r)
 Find the non-trivial classes in the partition of a range of words.
 
template<typename Thing, typename Iterator1, typename Iterator2>
std::vector< std::vector< typename Thing::native_word_type > > partition (Thing &thing, Iterator1 first, Iterator2 last)
 Partition a range of words (via iterators).
 
template<typename Thing, typename Range, typename = std::enable_if_t<rx::is_input_or_sink_v<Range>>>
std::vector< std::vector< typename Thing::native_word_type > > partition (Thing &thing, Range r)
 Partition a range of words.
 

Function Documentation

◆ non_trivial_classes() [1/2]

template<typename Thing, typename Iterator1, typename Iterator2>
std::vector< std::vector< typename Thing::native_word_type > > non_trivial_classes ( Thing & thing,
Iterator1 first,
Iterator2 last )

◆ non_trivial_classes() [2/2]

template<typename Thing, typename Range, typename = std::enable_if_t<rx::is_input_or_sink_v<Range>>>
std::vector< std::vector< typename Thing::native_word_type > > non_trivial_classes ( Thing & thing,
Range r )
nodiscard

Defined in cong-common-helpers.hpp.

This function returns the classes with size at least \(2\) in the partition of the words in the range r according to thing. This function triggers a full enumeration of thing.

Template Parameters
Thingthe type of the first parameter must be one of Kambites, KnuthBendix, ToddCoxeter, or Congruence.
Rangethe type of the input range of words, must satisfy std::enable_if_t<rx::is_input_or_sink_v<Range>> and Range::output_type must decay to Thing::native_word_type.
Parameters
thingthe object used to partition r.
rthe input range of words.
Returns
The partition of the input range.
Exceptions
LibsemigroupsExceptionif the input range of words is infinite.

◆ partition() [1/2]

template<typename Thing, typename Iterator1, typename Iterator2>
std::vector< std::vector< typename Thing::native_word_type > > partition ( Thing & thing,
Iterator1 first,
Iterator2 last )

Defined in cong-common-helpers.hpp.

See partition(Thing&, Range) for details.

◆ partition() [2/2]

template<typename Thing, typename Range, typename = std::enable_if_t<rx::is_input_or_sink_v<Range>>>
std::vector< std::vector< typename Thing::native_word_type > > partition ( Thing & thing,
Range r )
nodiscard

Defined in cong-common-helpers.hpp.

This function returns the partition of the words in the range r induced by the object thing. This function triggers a full enumeration of thing.

Template Parameters
Thingthe type of the first parameter must be one of Kambites, KnuthBendix, ToddCoxeter, or Congruence.
Rangethe type of the input range of words, must satisfy std::enable_if_t<rx::is_input_or_sink_v<Range>> and Range::output_type must decay to Thing::native_word_type.
Parameters
thingthe object used to partition r.
rthe input range of words.
Returns
The partition of the input range.
Exceptions
LibsemigroupsExceptionif the input range of words is infinite.