Membership¶
This page contains information about the member functions of the FroidurePin
class related to testing membership.
-
const_reference libsemigroups::FroidurePin::at(element_index_type i)¶
Access element specified by index with bound checks.
This function attempts to enumerate until at least
i
+ 1 elements have been found.- Parameters
i – the index of the element to access.
- Throws
LibsemigroupsException – if
i
is greater than or equal to the return value of size().- Returns
The element with index
i
(if any).
-
bool libsemigroups::FroidurePin::contains(const_reference x)¶
Test membership of an element.
Returns
true
ifx
belongs tothis
andfalse
if it does not.Note
This function may trigger a (partial) enumeration.
- Parameters
x – a const reference to a possible element.
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
bool
.
-
element_index_type libsemigroups::FroidurePin::current_position(const_reference x) const¶
Find the position of an element with no enumeration.
Returns the position of the element
x
in the semigroup if it is already known to belong to the semigroup or UNDEFINED. This function finds the position of the elementx
if it is already known to belong tothis
, and UNDEFINED if not. Ifthis
is not yet fully enumerated, then this function may return UNDEFINED whenx
does belong tothis
.See also
position and sorted_position.
- Parameters
x – a const reference to a possible element.
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
element_index_type
.
-
const_reference libsemigroups::FroidurePin::generator(letter_type i) const¶
Returns the generator with specified index.
Note
Note that
generator(i)
is in general not in positioni
.- Parameters
i – the index of a generator.
- Throws
LibsemigroupsException – if
i
is greater than or equal to number_of_generators().- Returns
A value of type const_reference.
-
const_reference libsemigroups::FroidurePin::operator[](element_index_type i) const¶
Access element specified by index.
This function attempts to enumerate until at least
i
+ 1 elements have been found.- Parameters
i – the index of the element to access.
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
The element with index
i
(if any).
-
element_index_type libsemigroups::FroidurePin::position(const_reference x)¶
Find the position of an element with enumeration if necessary.
Returns the position of
x
inthis
, or UNDEFINED ifx
is not an element ofthis
.See also
- Parameters
x – a const reference to a possible element.
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
element_index_type
.
-
const_reference libsemigroups::FroidurePin::sorted_at(element_index_type i)¶
Access element specified by sorted index with bound checks.
This function triggers a full enumeration, and the parameter
i
is the index when the elements are sorted by Less.- Parameters
i – the sorted index of the element to access.
- Throws
LibsemigroupsException – if
i
is greater than or equal to the return value of size().- Returns
The element with index
i
(if any).
-
element_index_type libsemigroups::FroidurePin::sorted_position(const_reference x)¶
Returns the sorted index of an element.
Returns the position of
x
in the elements ofthis
when they are sorted by Less, or UNDEFINED ifx
is not an element ofthis
.See also
current_position and position.
- Parameters
x – a const reference to a possible element.
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
element_index_type
.