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

This page documents the constructors and initialisers for the Kambites class.

Every constructor (except the move + copy constructors, and the move and copy assignment operators) has a matching init function with the same signature that can be used to re-initialize a Kambites instance as if it had just been constructed; but without necessarily releasing any previous allocated memory.

Functions

 Kambites ()
 Default constructor.
 
 Kambites (congruence_kind knd, Presentation< native_word_type > &&p)
 Construct from congruence_kind and Presentation.
 
 Kambites (congruence_kind knd, Presentation< native_word_type > const &p)
 Construct from congruence_kind and Presentation.
 
 Kambites (Kambites &&)
 Default move constructor.
 
 Kambites (Kambites const &)
 Default copy constructor.
 
Kambitesinit ()
 Re-initialize a Kambites instance.
 
Kambitesinit (congruence_kind knd, Presentation< native_word_type > &&p)
 Re-initialize a Kambites instance.
 
Kambitesinit (congruence_kind knd, Presentation< native_word_type > const &p)
 Re-initialize a Kambites instance.
 
Kambitesoperator= (Kambites &&)
 Default move assignment operator.
 
Kambitesoperator= (Kambites const &)
 Default copy assignment operator.
 
bool success () const override
 Check if the small overlap class has been computed and is at least 4.
 
template<typename Iterator1, typename Iterator2>
void throw_if_letter_not_in_alphabet (Iterator1 first, Iterator2 last) const
 Throws if any letter in a range is out of bounds.
 
void throw_if_not_C4 ()
 Throws if small_overlap_class isn't at least \(4\).
 
void throw_if_not_C4 () const
 Throws if small_overlap_class isn't at least \(4\) if it is known.
 

Function Documentation

◆ Kambites() [1/5]

template<typename Word = detail::MultiStringView>
Kambites ( )

This function default constructs an uninitialised Kambites instance.

◆ Kambites() [2/5]

template<typename Word = detail::MultiStringView>
Kambites ( congruence_kind knd,
Presentation< native_word_type > && p )
inline

This function constructs a Kambites instance representing a congruence of kind knd over the semigroup or monoid defined by the presentation p.

Kambites instances can only be used to compute two-sided congruences, and so the first parameter knd must always be congruence_kind::twosided. The parameter knd is included for uniformity of interface between with KnuthBendix, Kambites, and Congruence.

Parameters
kndthe kind (onesided or twosided) of the congruence.
pthe presentation.
Exceptions
LibsemigroupsExceptionif p is not valid.
LibsemigroupsExceptionif knd is not twosided.

◆ Kambites() [3/5]

template<typename Word = detail::MultiStringView>
Kambites ( congruence_kind knd,
Presentation< native_word_type > const & p )
inline

This function constructs a Kambites instance representing a congruence of kind knd over the semigroup or monoid defined by the presentation p.

Kambites instances can only be used to compute two-sided congruences, and so the first parameter knd must always be congruence_kind::twosided. The parameter knd is included for uniformity of interface between with KnuthBendix, Kambites, and Congruence.

Parameters
kndthe kind (onesided or twosided) of the congruence.
pthe presentation.
Exceptions
LibsemigroupsExceptionif p is not valid.
LibsemigroupsExceptionif knd is not twosided.

◆ Kambites() [4/5]

template<typename Word = detail::MultiStringView>
Kambites ( Kambites< Word > && )

Default move constructor.

◆ Kambites() [5/5]

template<typename Word = detail::MultiStringView>
Kambites ( Kambites< Word > const & )

Default copy constructor.

◆ init() [1/3]

template<typename Word = detail::MultiStringView>
Kambites & init ( )

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

Returns
A reference to *this.
Exceptions
This function guarantees not to throw a LibsemigroupsException.

◆ init() [2/3]

template<typename Word = detail::MultiStringView>
Kambites & init ( congruence_kind knd,
Presentation< native_word_type > && p )

This function puts a Kambites instance back into the state that it would have been in if it had just been newly constructed from knd and p.

Kambites instances can only be used to compute two-sided congruences, and so the first parameter knd must always be congruence_kind::twosided. The parameter knd is included for uniformity of interface between with KnuthBendix, Kambites, and Congruence.

Parameters
kndthe kind (onesided or twosided) of the congruence.
pthe presentation.
Returns
A reference to *this.
Exceptions
LibsemigroupsExceptionif p is not valid.
LibsemigroupsExceptionif knd is not twosided.

◆ init() [3/3]

template<typename Word = detail::MultiStringView>
Kambites & init ( congruence_kind knd,
Presentation< native_word_type > const & p )
inline

This function puts a Kambites instance back into the state that it would have been in if it had just been newly constructed from knd and p.

Kambites instances can only be used to compute two-sided congruences, and so the first parameter knd must always be congruence_kind::twosided. The parameter knd is included for uniformity of interface between with KnuthBendix, Kambites, and Congruence.

Parameters
kndthe kind (onesided or twosided) of the congruence.
pthe presentation.
Returns
A reference to *this.
Exceptions
LibsemigroupsExceptionif p is not valid.
LibsemigroupsExceptionif knd is not twosided.

◆ operator=() [1/2]

template<typename Word = detail::MultiStringView>
Kambites & operator= ( Kambites< Word > && )

Default move assignment operator.

◆ operator=() [2/2]

template<typename Word = detail::MultiStringView>
Kambites & operator= ( Kambites< Word > const & )

Default copy assignment operator.

◆ success()

template<typename Word = detail::MultiStringView>
bool success ( ) const
inlinenodiscardoverride

This function calls finished and checks whether or not the small_overlap_class is at least \(4\). This function can be used to check whether or not the functions reduce and contains can be used.

Returns
Whether or not the small overlap class is known and that it is at least \(4\).

◆ throw_if_letter_not_in_alphabet()

template<typename Word = detail::MultiStringView>
template<typename Iterator1, typename Iterator2>
void throw_if_letter_not_in_alphabet ( Iterator1 first,
Iterator2 last ) const
inline

This function throws a LibsemigroupsException if any value pointed at by an iterator in the range first to last is out of bounds (i.e. does not belong to the alphabet of the presentation used to construct the Kambites instance).

Template Parameters
Iterator1the type of first argument first.
Iterator2the type of second argument last.
Parameters
firstiterator pointing at the first letter of the word.
lastiterator pointing one beyond the last letter of the word.
Exceptions
LibsemigroupsExceptionif any letter in the range from first to last is out of bounds.

◆ throw_if_not_C4() [1/2]

template<typename Word = detail::MultiStringView>
void throw_if_not_C4 ( )

This function throws an exception if the small_overlap_class is not at least \(4\).

Exceptions
LibsemigroupsExceptionif small_overlap_class is not at least \(4\).

◆ throw_if_not_C4() [2/2]

template<typename Word = detail::MultiStringView>
void throw_if_not_C4 ( ) const

This function throws an exception if the small_overlap_class is known and not at least \(4\).

Exceptions
LibsemigroupsExceptionif small_overlap_class is known and not at least \(4\).