![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
This page contains information about the member functions of the ToddCoxeter that control various settings that influence the congruence enumeration process.
There are a fairly large number of settings, they can profoundly alter the run time of a congruence enumeration process, but it is hard to predict what settings will work best for any particular input.
See also Runner for further settings.
Functions | |
size_t | def_max () const noexcept |
Get the current value of the setting for the maximum number of definitions. | |
ToddCoxeter & | def_max (size_t val) noexcept |
Set the maximum number of definitions in the stack. | |
options::def_policy | def_policy () const noexcept |
Get the current value of the definition policy. | |
ToddCoxeter & | def_policy (options::def_policy val) |
Set the definition policy. | |
options::def_version | def_version () const noexcept |
Get the current value of the definition version setting. | |
ToddCoxeter & | def_version (options::def_version val) |
Set the value of the definition version setting. | |
size_t | f_defs () const noexcept |
Get the number of Felsch style definitions in ACE strategies. | |
ToddCoxeter & | f_defs (size_t val) |
Set the number of Felsch style definitions in ACE strategies. | |
size_t | hlt_defs () const noexcept |
Get the number of HLT style definitions in ACE strategies. | |
ToddCoxeter & | hlt_defs (size_t val) |
Set the number of HLT style definitions in ACE strategies. | |
size_t | large_collapse () const noexcept |
Get the current size of a large collapse. | |
ToddCoxeter & | large_collapse (size_t val) noexcept |
Set the size of a large collapse. | |
options::lookahead_extent | lookahead_extent () const noexcept |
Get the current value of the lookahead extent. | |
ToddCoxeter & | lookahead_extent (options::lookahead_extent val) noexcept |
Set the lookahead extent. | |
float | lookahead_growth_factor () const noexcept |
Get the current value of the lookahead growth factor. | |
ToddCoxeter & | lookahead_growth_factor (float val) |
Set the lookahead growth factor. | |
size_t | lookahead_growth_threshold () const noexcept |
Get the current value of the lookahead growth threshold. | |
ToddCoxeter & | lookahead_growth_threshold (size_t val) noexcept |
Set the lookahead growth threshold. | |
size_t | lookahead_min () const noexcept |
Get the current value of the minimum lookahead setting. | |
ToddCoxeter & | lookahead_min (size_t val) noexcept |
Set the minimum value of lookahead_next. | |
size_t | lookahead_next () const noexcept |
Get the current value of the lookahead next setting. | |
ToddCoxeter & | lookahead_next (size_t val) noexcept |
Set the threshold that will trigger a lookahead. | |
std::chrono::nanoseconds | lookahead_stop_early_interval () const noexcept |
Get the current value of the lookahead stop early interval. | |
ToddCoxeter & | lookahead_stop_early_interval (std::chrono::nanoseconds val) noexcept |
Set the lookahead stop early interval. | |
float | lookahead_stop_early_ratio () const noexcept |
Get the current value of the lookahead stop early ratio. | |
ToddCoxeter & | lookahead_stop_early_ratio (float val) |
Set the lookahead stop early ratio. | |
options::lookahead_style | lookahead_style () const noexcept |
Get the current value of the lookahead style. | |
ToddCoxeter & | lookahead_style (options::lookahead_style val) noexcept |
Set the style of lookahead. | |
size_t | lower_bound () const noexcept |
Get the current value of the lower bound. | |
ToddCoxeter & | lower_bound (size_t val) noexcept |
Specify the minimum number of classes that may permit any enumeration early stop. | |
bool | save () const noexcept |
Get the current value of the save setting. | |
ToddCoxeter & | save (bool val) noexcept |
Set whether or not to process definitions during HLT. | |
options::strategy | strategy () const noexcept |
Get the current value of the strategy setting. | |
ToddCoxeter & | strategy (options::strategy val) noexcept |
Specify the congruence enumeration strategy. | |
bool | use_relations_in_extra () const noexcept |
Get the current value of the "use relations in extra" setting. | |
ToddCoxeter & | use_relations_in_extra (bool val) noexcept |
Set whether or not to perform an HLT-style push of the defining relations at the identity. | |
|
nodiscardnoexcept |
size_t
.noexcept
and is guaranteed never to throw.
|
noexcept |
This setting specifies the maximum number of definitions that can be in the stack at any given time. What happens if there are the maximum number of definitions in the stack and a new definition is generated is governed by def_policy.
The default value of this setting is 2'000
.
val | the maximum size of the definition stack. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the definition policy which specifies how to handle definitions. For details see def_policy.
noexcept
and is guaranteed never to throw. ToddCoxeter & def_policy | ( | options::def_policy | val | ) |
This function can be used to specify how to handle definitions. For details see def_policy.
The default value of this setting is no_stack_if_no_space.
val | the policy to use. |
*this
.
|
nodiscardnoexcept |
This function returns the current version of the definition version setting.
noexcept
and is guaranteed never to throw. ToddCoxeter & def_version | ( | options::def_version | val | ) |
There are two versions of definition processing represented by the values one and two. The first version is simpler, but may involve following the same path that leads nowhere multiple times. The second version is more complex, and attempts to avoid following the same path multiple times if it is found to lead nowhere once.
val | the version to use. |
*this
.
|
nodiscardnoexcept |
This function returns the approx number of Felsch style definitions in each phase of the ACE style strategies:
If the strategy is not one of those listed above, then this setting is ignored.
The default value of this setting is 100'000
.
size_t
.noexcept
and is guaranteed never to throw. ToddCoxeter & f_defs | ( | size_t | val | ) |
This function can be used to set the approximate number of nodes defined in Felsch style in each phase of the ACE style strategies:
If the strategy is not one of those listed above, then this setting is ignored.
The default value of this setting is 100'000
.
val | the value to use. |
*this
.LibsemigroupsException | if val is 0 . |
|
nodiscardnoexcept |
This function returns the approx number of HLT style definitions in each phase of the ACE style strategies:
If the strategy is not one of those listed above, then this setting is ignored.
The default value of this setting is 100'000
.
size_t
.noexcept
and is guaranteed never to throw. ToddCoxeter & hlt_defs | ( | size_t | val | ) |
This function can be used to set the approximate number nodes defined in HLT style in each phase of the ACE style strategies:
If the strategy is not one of those listed above, then this setting is ignored.
The default value of this setting is 200'000
.
val | the value to use. |
*this
.LibsemigroupsException | if val is 0 . |
|
nodiscardnoexcept |
This function can be used to get what is currently considered a "large" collapse. See large_collapse(size_t) for the meaning of this setting.
The default value of this setting is 100'000
.
size_t
.noexcept
and is guaranteed never to throw.
|
noexcept |
This function can be used to set what should be considered a "large" collapse.
By default when processing coincidences nodes are merged in the word graph one pair at a time, and the in-neighbours of the surviving node are updated at the same time. If the number of coincidences is large, then it might be that a pair of nodes are merged at one step, then the surviving node is merged with another node at a future step, and this may happen many many times. This results in the in-neighbours of the surviving nodes being repeatedly traversed, which can result in a significant performance penalty. It can be beneficial to stop updating the in-neighbours as nodes are merged, and to just rebuild the entire in-neighbours data structure by traversing the entire word graph after all coincidences have been processed. This is beneficial if the number of surviving nodes is relatively small in comparison to the number of nodes merged. The purpose of this setting is to specify what should be considered a "large" collapse, or more precisely, what number of coincidences in the stack will trigger a change from updating the in-neighbours one-by-one to traversing the entire graph once after all coincidences have been processed.
The default value of this setting is 100'000
.
val | the value to use. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the lookahead extent setting.
The default value of this setting is partial.
noexcept
and is guaranteed never to throw.
|
noexcept |
This function can be used to specify the extent of any lookaheads that might take place in a congruence enumeration. The possible values are ToddCoxeter::options::lookahead_extent::partial or ToddCoxeter::options::lookahead_extent::full.
The default value of this setting is partial.
val | the extent. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the lookahead growth factor. See lookahead_growth_factor(float) for a full explanation of this setting.
noexcept
and is guaranteed never to throw. ToddCoxeter & lookahead_growth_factor | ( | float | val | ) |
This setting determines by what factor the number of nodes required to trigger a lookahead grows. More specifically, at the end of any lookahead if the number of active nodes already exceeds the value of lookahead_next or the number of nodes killed during the lookahead is less than the number of active nodes divided by lookahead_growth_threshold, then the value of lookahead_next is increased by a multiple of val
.
The default value is of this setting is 2.0
.
val | the value indicating the lookahead growth factor. |
*this
.LibsemigroupsException | if val is less than 1.0 . |
|
nodiscardnoexcept |
This function returns the current value of the lookahead growth threshold. See lookahead_growth_threshold for a full description of this setting.
size_t
.noexcept
and is guaranteed never to throw.
|
noexcept |
This setting determines the threshold for the number of nodes required to trigger a lookahead. More specifically, at the end of any lookahead if the number of active nodes already exceeds the value of lookahead_next or the number of nodes killed during the lookahead is less than the number of active nodes divided by lookahead_growth_threshold, then the value of lookahead_next is increased.
The default value is 4
.
val | the value indicating the lookahead growth threshold. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the minimum lookahead. See lookahead_min(size_t) for a full description of this setting.
The default value is 10'000
.
noexcept
and is guaranteed never to throw.
|
noexcept |
After a lookahead is performed the value of lookahead_next is modified depending on the outcome of the current lookahead. If the return value of lookahead_next is too small or too large, then the value is adjusted according to lookahead_growth_factor and lookahead_growth_threshold. This setting specified the minimum possible value for lookahead_next().
The default value is 10'000
.
val | value indicating the minimum value of lookahead_next. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the lookahead next setting. See lookahead_next(size_t) for a full description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
If the number of active nodes exceeds the value set by this function, then a lookahead of style lookahead_style and extent lookahead_extent will be triggered.
The default value is 5 million.
val | value indicating the initial threshold. |
*this
.noexcept
and is guaranteed never to throw.
|
noexcept |
This function returns the current value of the lookahead stop early interval. See nanoseconds) for a full description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
During any lookaheads that are performed, it is periodically checked what proportion of the active nodes have been killed since the previous such check. This function can be used to set the interval between these checks. The purpose of this setting is to allow lookaheads to be stopped early if the number of nodes being killed is too small (for example, if \(<1%\) of nodes were killed in the previous second, then we might want to stop the lookahead early, since lookaheads take some time but may not result in many nodes being killed).
The default value is 1 second.
val | the new value for the interval. |
*this
.noexcept
and is guaranteed never to throw.
|
noexcept |
This function returns the current value of the lookahead stop early ratio. See lookahead_stop_early_ratio(float) for a full description of this setting.
noexcept
and is guaranteed never to throw. ToddCoxeter & lookahead_stop_early_ratio | ( | float | val | ) |
During any lookaheads that are performed, it is periodically checked what proportion of the active nodes have been killed since the previous such check. This function can be used to set the minimum proportion of the active nodes that must be killed every lookahead_stop_early_interval to avoid the lookahead being stopped early. The purpose of this setting is to allow lookaheads to be stopped early if the number of nodes being killed is too small (for example, if no nodes were killed in the previous second, then we might want to stop the lookahead early, since lookaheads take some time but may not result in many nodes being killed).
val | the proportion of active nodes. |
*this
.LibsemigroupsException | if val is not in the interval \([0, 1)\). |
|
nodiscardnoexcept |
This function returns the current value of the lookahead style. See lookahead_style for a full description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
This function can be used to set the style of any lookaheads that are performed during the congruence enumeration. The possible values are hlt and felsch.
The default value of this setting is hlt.
val | the style of lookahead to use. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the lower bound. See lower_bound(size_t) for a full description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
This function can be used to set a lower bound for the number of classes of the congruence represented by a ToddCoxeter instance. If the number of active nodes becomes at least the value of the argument, and the word graph is complete ( is_complete returns true
), then the enumeration is terminated. When the given bound is equal to the number of classes, this may prevent following the paths labelled by relations at many nodes when there is no possibility of finding coincidences.
The default value is UNDEFINED.
val | value indicating the lower bound. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the save setting. See save(bool) for a full description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
If the argument of this function is true
and the HLT strategy is being used, then definitions are processed during any enumeration.
The default value is false
.
val | value indicating whether or not to process deductions. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the strategy setting. See strategy for a full description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
The strategy used during the enumeration can be specified using this function.
The default value is hlt.
val | value indicating which strategy to use. |
*this
.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the current value of the "use relations in extra" setting. See use_relations_in_extra(bool) for a fuller description of this setting.
noexcept
and is guaranteed never to throw.
|
noexcept |
If a ToddCoxeter instance is defined over a finitely presented semigroup or monoid and the Felsch strategy is being used, it can be useful to follow all the paths from the identity labelled by the underlying relations. The setting specifies whether or not to do this.
The default value of this setting is false
.
val | the boolean value. |
*this
.noexcept
and is guaranteed never to throw.