Virtual functions from FroidurePinBase¶
-
bool libsemigroups::FroidurePin::equal_to(word_type const &x, word_type const &y) const override¶
Check equality of words in the generators.
Returns
trueif the parameters represent the same element andfalseotherwise.- Parameters:
x – the first word for comparison
y – the second word for comparison
- Throws:
LibsemigroupsException – if
wcontains an value exceeding number_of_generators.- Returns:
A value of type
bool.
-
element_index_type libsemigroups::FroidurePin::fast_product(element_index_type i, element_index_type j) const override¶
Multiply elements via their indices.
Returns the position of the product of the element with index
iand the element with indexj.This function either:
follows the path in the right or left Cayley graph from
itoj, whichever is shorter using product_by_reduction; ormultiplies the elements in positions
iandjtogether;
whichever is better. The function used is determined by comparing the output of the call operator of Complexity and the current_length of
iandj.For example, if the complexity of the multiplication is linear and
thisis a semigroup of transformations of degree 20, and the shortest paths in the left and right Cayley graphs fromitojare of length 100 and 1131, then it is better to just multiply the transformations together.- Parameters:
i – the index of the first element to multiply
j – the index of the second element to multiply
- Throws:
LibsemigroupsException – if the values
iandjare greater than or equal to current_size.- Returns:
A value of type
element_index_type.
-
inline tril libsemigroups::FroidurePin::is_finite() const override¶
Check finiteness.
Returns tril::TRUE if the semigroup represented by
thisis finite, tril::FALSE if it is infinite, and tril::unknown if it is not known.For some types of elements, such as matrices over the integers, for example, it is undecidable, in general, if the semigroup generated by these elements is finite or infinite. On the other hand, for other types, such as transformation, the semigroup is always finite.
- Parameters
(None)
Note
No enumeration is triggered by calls to this function.
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
A value of type tril.
-
bool libsemigroups::FroidurePin::is_idempotent(element_index_type i) override¶
Check if an element is an idempotent via its index.
Returns
trueif the element in positioniis an idempotent andfalseif it is not.Note
This function triggers a full enumeration.
- Parameters:
i – the index of the element
- Throws:
LibsemigroupsException – if
iis greater than or equal to the size ofthis.- Returns:
A value of type
bool.
-
size_t libsemigroups::FroidurePin::number_of_generators() const noexcept override¶
Returns the number of generators.
- Parameters
(None)
- Throws:
(None) – This function is
noexceptand is guaranteed never to throw.- Returns:
A value of type
size_t.
-
size_t libsemigroups::FroidurePin::number_of_idempotents() override¶
Returns the number of idempotents.
- Parameters
(None)
Note
This function triggers a full enumeration.
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
A value of type
size_t.
-
element_index_type libsemigroups::FroidurePin::position_to_sorted_position(element_index_type i) override¶
Returns the sorted index of an element via its index.
Returns the position of the element with index
iwhen the elements are sorted using Less, or UNDEFINED ifiis greater than size().- Parameters:
i – the index of the element
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
A value of type element_index_type.
-
void libsemigroups::FroidurePin::reserve(size_t val) override¶
Requests the given capacity for elements.
The parameter
valis also used to initialise certain data members. If you know a good upper bound for the size of your semigroup, then it might be a good idea to call this function with that upper bound as an argument; this can significantly improve the performance of the run function, and consequently every other function too.- Parameters:
val – the number of elements to reserve space for.
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
(None)