position

element_index_type libsemigroups::FroidurePin::position(const_reference)

Returns the position of x in this, or libsemigroups::UNDEFINED if x is not an element of this.

This member function can be used to find the FroidurePin::element_index_type position of the element x if it belongs to the semigroup. The semigroup is enumerated in batches until x is found or the semigroup is fully enumerated but x was not found (see FroidurePin::batch_size(size_t)).

Exceptions
  • LibsemigroupsException: This function throws a LibsemigroupsException if the argument is not an element of the semigroup represented by this. Since the semigroup may be enumerated (fully or partially) when this function is called, it only offers the basic exception guarantee (the object is in a valid state after any call to this function but not necessarily the same state as it was before the call).