Settings¶
This page contains information about the various common settings for the MinimalRepOrc
class and the Sims1
class template.
-
inline Presentation<word_type> const &libsemigroups::MinimalRepOrc::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>
.
-
MinimalRepOrc &libsemigroups::MinimalRepOrc::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 byextra()
.If the template parameter
P
is notPresentation<word_type>
, then the parameterp
is first converted to a value of typePresentation<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 fromPresentationBase
.- Parameters
p – the presentation.
- Throws
LibsemigroupsException – if
make<Presentation<word_type>>(p)
throwsLibsemigroupsException – if
p
is not validLibsemigroupsException – if the alphabet of
p
is non-empty and not equal to that of short_rules or long_rules.
- Returns
A reference to
this
.
-
MinimalRepOrc &libsemigroups::MinimalRepOrc::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 leastval
(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::MinimalRepOrc::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>
.
-
MinimalRepOrc &libsemigroups::MinimalRepOrc::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 notPresentation<word_type>
, then the parameterp
is first converted to a value of typePresentation<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 fromPresentationBase
.- Parameters
p – the presentation.
- Throws
LibsemigroupsException – if
make<Presentation<word_type>>(p)
throwsLibsemigroupsException – if
p
is not validLibsemigroupsException – if the alphabet of
p
is non-empty and not equal to that of short_rules or extra.
- Returns
A reference to
this
.
-
inline size_t libsemigroups::MinimalRepOrc::number_of_threads() const noexcept¶
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
.
-
MinimalRepOrc &libsemigroups::MinimalRepOrc::number_of_threads(size_t val)¶
Set the number of threads.
This function sets the number of threads to be used by
Sims1
.The default value is
1
.Warning
If
val
exceedsstd::thread::hardware_concurrency()
, then this is likely to have a negative impact on the performance of the algorithms implemented bySims1
.- 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::MinimalRepOrc::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 MinimalRepOrc &libsemigroups::MinimalRepOrc::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::MinimalRepOrc::settings() const noexcept¶
Returns the settings object of *this.
The settings object contains all the settings that are common to
Sims1
,RepOrc
, andMinimalRepOrc
, which are currently:The return value of this function can be used to initialise another
Sims1
,RepOrc
, orMinimalRepOrc
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 MinimalRepOrc &libsemigroups::MinimalRepOrc::settings(Sims1Settings const &that)¶
Copy the settings from
that
intothis
.The settings object contains all the settings that are common to
Sims1
,RepOrc
, andMinimalRepOrc
, which are currently:The return value of this function can be used to initialise another
Sims1
,RepOrc
, orMinimalRepOrc
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::MinimalRepOrc::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 generatora
in the presentationp
used to construct aSims1
instance is replaced byp.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>
.
-
MinimalRepOrc &libsemigroups::MinimalRepOrc::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 notPresentation<word_type>
, then the parameterp
is first converted to a value of typePresentation<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 fromPresentationBase
.- Parameters
p – the presentation.
- Throws
LibsemigroupsException – if
make<Presentation<word_type>>(p)
throwsLibsemigroupsException – if
p
is not validLibsemigroupsException – if the alphabet of
p
is non-empty and not equal to that of long_rules or extra.LibsemigroupsException – if
p
has 0-generators and 0-relations.
- Returns
A reference to
this
.
-
void libsemigroups::MinimalRepOrc::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)