sort_generating_pairs(sort_free_function_type)

inline ToddCoxeter &libsemigroups::congruence::ToddCoxeter::sort_generating_pairs(sort_free_function_type func = shortlex_compare)

Sorts all existing generating pairs according to the binary function func.

Additionally, if this was defined over a finitely presented semigroup, then the copy of the defining relations of that semigroup contained in this (if any) are also sorted according to func.

See

random_shuffle_generating_pairs

Warning

If add_pair is called after this function, then it may no longer be the case that the defining relations and generating pairs of this are sorted by func.

Parameters

func – a value of type sort_function_type that defines a linear order on the relations in a ToddCoxeter instance.

Throws

LibsemigroupsException – if started() returns true.

Returns

a reference to the object pointed to by this.