Validating permutations

template<size_t N, typename Scalar>
auto libsemigroups::validate(Perm<N, Scalar> const &x)

Validate a permutation.

Complexity

Linear in the size of the container x.degree().

Template Parameters:

T – the type of the permutation to validate.

Parameters:

x – the permutation.

Throws:

LibsemigroupsException – if:

  • the image of any point in x exceeds x.degree()

  • x is not injective