Static member functions

inline PPerm libsemigroups::PPerm::identity() const

Returns the identity partial perm on degree() points.

This function returns a newly constructed partial perm with degree equal to the degree of this that fixes every value from 0 to degree().

Parameters

(None)

Throws

(None) – This function guarantees not to throw a LibsemigroupsException.

Returns

A value of type PPerm.

static inline PPerm libsemigroups::PPerm::identity(size_t M)

Returns the identity partial perm on the given number of points.

This function returns a newly constructed partial perm with degree equal to M that fixes every value from 0 to M.

Complexity

Linear in M.

Parameters

M – the degree.

Throws

(None) – This function guarantees not to throw a LibsemigroupsException.

Returns

A value of type PPerm.

template<typename T>
static inline PPerm libsemigroups::PPerm::make(T &&cont)

Construct from image list and validate.

Constructs a partial perm \(f\) of degree M such that \(f(i) = cont[i]\) for every value in the range \([0, M)\) where \(M\) is cont.size()

Complexity

Linear in the size of cont.

Parameters

cont – list of images or UNDEFINED

Throws

LibsemigroupsException – if any of the following fail to hold:

  • the size of cont is incompatible with container_type.

  • any value in cont exceeds cont.size() and is not equal to UNDEFINED.

  • there are repeated values in cont.

static inline PPerm libsemigroups::PPerm::make(std::initializer_list<value_type> &&cont)

Construct from image list and validate.

Constructs a partial perm \(f\) of degree M such that \(f(i) = cont[i]\) for every value in the range \([0, M)\) where \(M\) is cont.size()

Complexity

Linear in the size of cont.

Parameters

cont – list of images or UNDEFINED

Throws

LibsemigroupsException – if any of the following fail to hold:

  • the size of cont is incompatible with container_type.

  • any value in cont exceeds cont.size() and is not equal to UNDEFINED.

  • there are repeated values in cont.

static inline PPerm libsemigroups::PPerm::make(std::vector<value_type> const &dom, std::vector<value_type> const &ran, size_t const M)

Construct from domain, range, and degree, and validate.

Constructs a partial perm of degree M such that (dom[i])f = ran[i] for all i and which is UNDEFINED on every other value in the range \([0, M)\).

Complexity

Linear in the size of dom.

Parameters
  • dom – the domain

  • ran – the range

  • M – the degree

Throws

LibsemigroupsException – if any of the following fail to hold:

  • the value M is not compatible with the template parameter N

  • dom and ran do not have the same size

  • any value in dom or ran is greater than M

  • there are repeated entries in dom or ran.