fast_product¶
-
element_index_type
libsemigroups::FroidurePin
::
fast_product
(element_index_type, element_index_type) const override¶ Returns the position in
this
of the product ofthis->at(i)
andthis->at(j)
.The values
i
andj
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
toj
, whichever is shorter using FroidurePin::product_by_reduction ormultiplies the elements in postions
i
andj
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
andj
.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 fromi
toj
are of length 100 and 1131, then it better to just multiply the transformations together.