Member functions¶
This page contains information about the member functions of the Sims1
class template.
-
inline iterator libsemigroups::Sims1::cbegin(size_type n) const¶
Returns a forward iterator pointing at the first congruence.
Returns a forward iterator pointing to the ActionDigraph representing the first congruence described by Sims1 object with at most
n
classes.If incremented, the iterator will point to the next such congruence. The order which the congruences are returned in is implementation specific. Iterators of the type returned by this function are equal whenever they point to equal objects. The iterator is exhausted if and only if it points to an ActionDigraph with zero nodes.
The meaning of the ActionDigraph pointed at by Sims1 iterators depends on whether the input is a monoid presentation (i.e. Presentation::contains_empty_word() returns
true
) or a semigroup presentation. If the input is a monoid presentation for a monoid \(M\), then the ActionDigraph pointed to by an iterator of this type has preciselyn
nodes, and the right action of \(M\) on the nodes of the digraph is isomorphic to the action of \(M\) on the classes of a right congruence.If the input is a semigroup presentation for a semigroup \(S\), then the ActionDigraph has
n
+ 1 nodes, and the right action of \(S\) on the nodes \(\{1, \ldots, n\}\) of the ActionDigraph is isomorphic to the action of \(S\) on the classes of a right congruence. It’d probably be better in this case if node \(0\) was not included in the output ActionDigraph, but it is required in the implementation of the low-index congruence algorithm, and to avoid unnecessary copies, we’ve left it in for the time being.See also
Warning
Copying iterators of this type is expensive. As a consequence, prefix incrementing
++it
the returned iteratorit
significantly cheaper than postfix incrementingit++
.- Parameters
n – the maximum number of classes in a congruence.
- Throws
LibsemigroupsException – if
n
is0
.LibsemigroupsException – if
short_rules()
has 0-generators and 0-relations (i.e. it has not been initialised).
- Returns
An iterator
it
of typeiterator
pointing to an ActionDigraph with at mostn
nodes.
-
inline iterator libsemigroups::Sims1::cend(size_type n) const¶
Returns a forward iterator pointing one beyond the last congruence.
Returns a forward iterator pointing to the empty ActionDigraph. If incremented, the returned iterator remains valid and continues to point at the empty ActionDigraph.
See also
Warning
Copying iterators of this type is expensive. As a consequence, prefix incrementing
++it
the returned iteratorit
significantly cheaper than postfix incrementingit++
.- Parameters
n – the maximum number of classes in a congruence.
- Throws
LibsemigroupsException – if
n
is0
.LibsemigroupsException – if
short_rules()
has 0-generators and 0-relations (i.e. it has not been initialised).
- Returns
An iterator
it
of typeiterator
pointing to an ActionDigraph with at most0
nodes.
-
digraph_type libsemigroups::Sims1::find_if(size_type n, std::function<bool(digraph_type const&)> pred) const¶
Apply the function
pred
to every one-sided congruence with at mostn
classes, until it returnstrue
.This function is similar to
std::find_if(begin(n), end(n), pred)
and exists to:provide some feedback on the progress of the computation if it runs for more than 1 second.
allow for the computation of
std::find_if(begin(n), end(n), pred)
to be performed using number_of_threads in parallel.
- Parameters
n – the maximum number of congruence classes.
pred – the predicate applied to every congruence found.
- Throws
LibsemigroupsException – if
n
is0
.LibsemigroupsException – if
short_rules()
has 0-generators and 0-relations (i.e. it has not been initialised).
- Returns
The first congruence whose ActionDigraph for which
pred
returnstrue
.
-
void libsemigroups::Sims1::for_each(size_type n, std::function<void(digraph_type const&)> pred) const¶
Apply the function
pred
to every one-sided congruence with at mostn
classes.This function is similar to
std::for_each(begin(n), end(n), pred)
and exists to:provide some feedback on the progress of the computation if it runs for more than 1 second.
allow for the computation of
std::for_each(begin(n), end(n), pred)
to be performed using number_of_threads in parallel.
- Parameters
n – the maximum number of congruence classes.
pred – the predicate applied to every congruence found.
- Throws
LibsemigroupsException – if
n
is0
.LibsemigroupsException – if
short_rules()
has 0-generators and 0-relations (i.e. it has not been initialised).
- Returns
(None)
-
uint64_t libsemigroups::Sims1::number_of_congruences(size_type n) const¶
Returns the number of one-sided congruences with up to a given number of classes.
This function is similar to
std::distance(begin(n), end(n))
and exists to:provide some feedback on the progress of the computation if it runs for more than 1 second.
allow for the computation of
std::distance(begin(n), end(n))
to be performed using number_of_threads in parallel.
- Parameters
n – the maximum number of congruence classes.
- Throws
LibsemigroupsException – if
n
is0
.LibsemigroupsException – if
short_rules()
has 0-generators and 0-relations (i.e. it has not been initialised).
- Returns
A value of type
uint64_t
.