PPerm

template<size_t N = 0, typename Scalar = std::conditional_t<N == 0, uint32_t, typename SmallestInteger<N>::type>>
class PPerm : public PTransf<0, std::conditional_t<0 == 0, uint32_t, typename SmallestInteger<0>::type>>

Defined in transf.hpp.

A partial permutation \(f\) is just an injective partial transformation, which is stored as a vector of the images of \(\{0, 1, \ldots, n - 1\}\), i.e. i.e. \(\{(0)f, (1)f, \ldots, (n - 1)f\}\) where the value UNDEFINED is used to indicate that \((i)f\) is undefined (i.e. not among the points where \(f\) is defined).

If N is 0 (the default), then the degree of a PPerm instance can be defined at runtime, and if N is not 0, then the degree is fixed at compile time.

If N is 0, then the default value of Scalar is uint32_t. If N is not 0, then the default value of Scalar is the smallest integer type able to hold N. See also SmallestInteger.

Note

PPerm has the same member functions as StaticPTransf and DynamicPTransf, this isn’t current reflected by the contents of this page.

Template Parameters
  • N – the degree (default: 0)

  • Scalar – an unsigned integer type (the type of the image values)

Member types

container_type

Type of the underlying container.

value_type

Type of the image values.

Constructors

PPerm(std::initializer_list<value_type>, std::initializer_list<value_type>, size_t)

Construct from domain, range, and degree.

PPerm(std::vector<value_type> const&, std::vector<value_type> const&, size_t)

Construct from domain, range, and degree.

Static member functions

identity() const

Returns the identity partial perm on degree() points.

identity(size_t)

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

make(T&&)

Construct from image list and validate.

make(std::initializer_list<value_type>&&)

Construct from image list and validate.

make(std::vector<value_type> const&, std::vector<value_type> const&, size_t const)

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

Member functions

inverse() const

Returns the inverse.

inverse(PPerm&) const

Replace contents of a partial perm with the inverse of another.

left_one() const

Returns the left one of this.

product_inplace(PPerm const&, PPerm const&)

Multiply two partial perms and store the product in this.

right_one() const

Returns the right one of this.