CongruenceInterface

class CongruenceInterface : public libsemigroups::Runner

Defined in cong-intf.hpp.

Every class for representing congruences in libsemigroups is derived from CongruenceInterface, which holds the member functions that are common to all its derived classes. CongruenceInterface is an abstract class.

Subclassed by libsemigroups::CongruenceByPairsHelper< FroidurePin< T > >, libsemigroups::CongruenceByPairsHelper< T >, libsemigroups::CongruenceByPairsHelper< FroidurePin< detail::KBE, FroidurePinTraits< detail::KBE, fpsemigroup::KnuthBendix > > >, libsemigroups::Congruence, libsemigroups::CongruenceByPairsHelper< TFroidurePinType >, libsemigroups::congruence::KnuthBendix, libsemigroups::congruence::ToddCoxeter

Member types

class_index_type

Type for indices of congruence class indices.

const_iterator

Type for a const_iterator to the generating pairs.

non_trivial_class_iterator

Type for a const_iterator to non-trivial classes.

non_trivial_classes_type

Type for non-trivial classes.

Constructors

CongruenceInterface(CongruenceInterface const&) = default

Default copy constructor.

CongruenceInterface(congruence_type)

Constructs a congruence of the specified type.

Initialization

add_pair(std::initializer_list<size_t>, std::initializer_list<size_t>)

Add a generating pair to the congruence.

add_pair(word_type const&, word_type const&)

Add a generating pair to the congruence.

nr_generating_pairs() const noexcept

The number of generating pairs.

nr_generators() const noexcept

The number of generators.

set_nr_generators(size_t)

Set the number of generators of the congruence.

Handedness

kind() const noexcept

The handedness of the congruence (left, right, or 2-sided).

Iterators

cbegin_generating_pairs() const noexcept

Returns a const iterator pointing to the first generating pair.

cbegin_ntc()

Returns a const iterator pointing to the first non-singleton class.

cend_generating_pairs() const noexcept

Returns a const iterator pointing one-after-the-end of the last generating pair.

cend_ntc()

Returns a const iterator pointing one-past-the-end of the last non-singleton class.

Words and class indices

class_index_to_word(class_index_type)

Get a canonical representative of the i-th class.

word_to_class_index(word_type const&)

Convert a word into the index of the class containing it.

Numbers of classes, and comparisons

const_contains(word_type const&, word_type const&) const

Check if a pair of words is known to belong to the congruence.

contains(word_type const&, word_type const&)

Check if a pair of words belongs to the congruence.

less(word_type const&, word_type const&)

Compare the indices of the classes containing two words.

non_trivial_classes()

Returns a shared pointer to the non-trivial classes.

nr_classes()

Compute the number of classes in the congruence.

nr_non_trivial_classes()

The number of non-singleton classes.

Member functions inherited from Runner

dead() const noexcept

Check if the runner is dead.

finished() const

Check if run has been run to completion or not.

kill() noexcept

Stop run from running (thread-safe).

report() const

Check if it is time to report.

report_every(TIntType)

Set the minimum elapsed time between reports.

report_every(std::chrono::nanoseconds)

Set the minimum elapsed time between reports.

report_why_we_stopped() const

Report why run stopped.

run()

Run until finished .

run_for(TIntType)

Run for a specified amount of time.

run_for(std::chrono::nanoseconds)

Run for a specified amount of time.

run_until(T&&)

Run until a nullary predicate returns true or finished .

run_until(bool(*)())

Run until a nullary predicate returns true or finished .

running() const noexcept

Check if currently running.

started() const

Check if run has been called at least once before.

stopped() const

Check if the runner is stopped.

stopped_by_predicate() const

Check if the runner was, or should, stop because of the argument for run_until .

timed_out() const

Check if the amount of time passed to run_for has elapsed.