fast_product

element_index_type libsemigroups::FroidurePinBase::fast_product(element_index_type, element_index_type) const = 0

Returns the position in this of the product of this->at(i) and this->at(j).

The values i and j must be less than FroidurePin::current_size, or a LibsemigroupsException will be thrown. This member function either:

  • follows the path in the right or left Cayley graph from i to j, whichever is shorter using FroidurePin::product_by_reduction or

  • multiplies the elements in postions i and j together;

whichever is better. The member function used is determined by comparing the output of the call operator of FroidurePin::Complexity and the FroidurePin::length_const of i and j.

For example, if the complexity of the multiplication is linear and this is a semigroup of transformations of degree 20, and the shortest paths in the left and right Cayley graphs from i to j are of length 100 and 1131, then it better to just multiply the transformations together.