# Settings¶

This page contains information about the various settings for the Sims1 class template.

inline Presentation<word_type> const &libsemigroups::Sims1::extra() const noexcept

Returns a const reference to the additional defining pairs.

The congruences computed by a Sims1 instance always contain the relations of this presentation. In other words, the congruences computed by this instance are only taken among those that contains the pairs of elements of the underlying semigroup (defined by the presentation returned by short_rules and long_rules) represented by the relations of the presentation returned by extra().

Parameters

(None) – this function has no parameters.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A const reference to Presentation<word_type>.

Sims1<T> &libsemigroups::Sims1::extra(P const &p)

Set the extra rules.

The congruences computed by a Sims1 instance always contain the relations of this presentation. In other words, the congruences computed by this instance are only taken among those that contains the pairs of elements of the underlying semigroup (defined by the presentation returned by short_rules and long_rules) represented by the relations of the presentation returned by extra().

If the template parameter P is not Presentation<word_type>, then the parameter p is first converted to a value of type Presentation<word_type> and it is this converted value that is used.

Template Parameters

P – A specific value of the class template Presentation, must be derived from PresentationBase.

Parameters

p – the presentation.

Throws
Returns

A reference to this.

Sims1<T> &libsemigroups::Sims1::long_rule_length(size_t val)

Define the long rule length.

This function modifies short_rules and long_rules so that short_rules only contains those rules whose length (sum of the lengths of the two sides of the rules) is less than val (if any) and long_rules only contains those rules of length at least val (if any). The rules contained in the union of short_rules and long_rules is invariant under this function, but the distribution of the rules between short_rules and long_rules is not.

The relative orders of the rules within short_rules and long_rules may not be preserved.

Parameters

val – the value of the long rule length.

Throws

(None) – This function guarantees not to throw a LibsemigroupsException.

Returns

A const reference to this.

inline Presentation<word_type> const &libsemigroups::Sims1::long_rules() const noexcept

Returns the current long rules.

Parameters

(None) – this function has no parameters.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A const reference to Presentation<word_type>.

Sims1<T> &libsemigroups::Sims1::long_rules(P const &p)

Set the long rules.

These are the rules used after a complete deterministic word graph compatible with short_rules has been found by Sims1. If such a word graph is compatible with the long rules specified by this function, then this word graph is accepted, and if not it is not accepted.

If the template parameter P is not Presentation<word_type>, then the parameter p is first converted to a value of type Presentation<word_type> and it is this converted value that is used.

Template Parameters

P – A specific value of the class template Presentation, must be derived from PresentationBase.

Parameters

p – the presentation.

Throws
Returns

A reference to this.

Returns the current number of threads.

Parameters

(None) – this function has no parameters.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A size_t.

This function sets the number of threads to be used by Sims1.

The default value is 1.

Warning

If val exceeds std::thread::hardware_concurrency(), then this is likely to have a negative impact on the performance of the algorithms implemented by Sims1.

Parameters

val – the maximum number of threads to use.

Throws

LibsemigroupsException – if the argument val is 0.

Returns

A reference to this.

inline size_t libsemigroups::Sims1::report_interval() const noexcept

Returns the current report interval.

Parameters

(None) – this function has no parameters.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A size_t.

inline Sims1<T> &libsemigroups::Sims1::report_interval(size_t val) noexcept

Set the report interval.

Only report after val new congruences have been found.

The default value is 1999.

Parameters

val – the new value for the report interval.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A reference to this.

inline Sims1Settings const &libsemigroups::Sims1::settings() const noexcept

Returns the settings object of *this.

The settings object contains all the settings that are common to Sims1, RepOrc, and MinimalRepOrc, which are currently:

The return value of this function can be used to initialise another Sims1, RepOrc, or MinimalRepOrc with these settings.

Parameters

(None) – this function has no parameters.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A const reference to Sims1Settings.

inline Sims1<T> &libsemigroups::Sims1::settings(Sims1Settings const &that)

Copy the settings from that into this.

The settings object contains all the settings that are common to Sims1, RepOrc, and MinimalRepOrc, which are currently:

The return value of this function can be used to initialise another Sims1, RepOrc, or MinimalRepOrc with these settings.

Parameters

that – the object to copy the settings from.

Throws

(None) – This function guarantees not to throw a LibsemigroupsException.

Returns

A const reference to this.

inline Presentation<word_type> const &libsemigroups::Sims1::short_rules() const noexcept

Returns a const reference to the current short rules.

This function returns the defining presentation of a Sims1 instance. The congruences computed by cbegin and cend are defined over the semigroup or monoid defined by this presentation.

Note that it might not be the case that the value returned by this function and the presentation used to construct the object are the same. A Sims1 object requires the generators of the defining presentation $$\mathcal{P}$$ to be $$\{0, \ldots, n - 1\}$$ where $$n$$ is the size of the alphabet of $$\mathcal{P}$$. Every occurrence of every generator a in the presentation p used to construct a Sims1 instance is replaced by p.index(a).

Warning

If split_at or long_rule_length have been called, then some of the defining relations may have been moved from short_rules to long_rules.

Parameters

(None) – this function has no parameters.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A const reference to Presentation<word_type>.

Sims1<T> &libsemigroups::Sims1::short_rules(P const &p)

Set the short rules.

These are the rules used at every node in the depth first search conducted by Sims1.

If the template parameter P is not Presentation<word_type>, then the parameter p is first converted to a value of type Presentation<word_type> and it is this converted value that is used.

Template Parameters

P – A specific value of the class template Presentation, must be derived from PresentationBase.

Parameters

p – the presentation.

Throws
Returns

A reference to this.

void libsemigroups::Sims1::split_at(size_t val)

Split the rules in short_rules and long_rules.

This function splits the relations in short_rules and long_rules so that short_rules contains the first 2 * val rules and long_rules contains any remaining rules.

The order of the relations is the same as the current order.

Parameters

val – the relation to split at.

Throws

LibsemigroupsException – if val is out of bounds, i.e. if it exceeds (short_rules().rules.size() + long_rules().rules.size()) / 2.

Returns

(None)