nr_classes

size_t libsemigroups::CongruenceByPairsHelper::nr_classes()

Computes the total number of classes in the congruence represented by an instance of this type.

Return

The number of congruences classes of this if this number is finite, or libsemigroups::POSITIVE_INFINITY in some cases if this number is not finite.

Complexity

See warning.

Warning

The problem of determining the number of classes of a congruence over a finitely presented semigroup is undecidable in general, and this function may never terminate.

Parameters

(None)

Exceptions
  • std::bad_alloc: if the (possibly infinite) computation uses all the available memory.