libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
Perm< N, Scalar >
template<size_t N = 0, typename Scalar = std::conditional_t<N == 0, uint32_t, typename SmallestInteger<N>::type>>
class libsemigroups::Perm< N, Scalar >

Defined in transf.hpp.

A permutation \(f\) is an injective transformation defined on the whole of \(\{0, 1, \ldots, n - 1\}\) for some integer \(n\) called the degree of \(f\). A permutation is stored as a container of the images of \((0, 1, \ldots, n - 1)\), i.e. \(((0)f, (1)f, \ldots, (n - 1)f)\).

If N is 0 (the default), then the degree of a Perm 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.

Template Parameters
Nthe degree (default: 0).
Scalaran unsigned integer type (the type of the image values).

This class inherits from either StaticPTransf or DynamicPTransf, see the documentation of these classes for more details of the available member functions.

Inheritance diagram for Perm< N, Scalar >:
[legend]

Public Types

using container_type = typename PTransf<N, point_type>::container_type
 Type of the underlying container.
 
using point_type = Scalar
 Type of the image values.
 
- Public Types inherited from Transf< N, Scalar >
using container_type = typename base_type::container_type
 Type of the underlying container.
 
using point_type = Scalar
 Type of the image values.
 

Static Public Member Functions

static Perm one (size_t M)
 Returns the identity transformation on the given number of points.
 
- Static Public Member Functions inherited from Transf< N, Scalar >
static Transf one (size_t M)
 Returns the identity transformation on the given number of points.
 

Additional Inherited Members

- Public Member Functions inherited from Transf< N, Scalar >
void product_inplace (Transf const &f, Transf const &g)
 Multiply two transformations and store the product in this.
 

Member Typedef Documentation

◆ container_type

template<size_t N = 0, typename Scalar = std::conditional_t<N == 0, uint32_t, typename SmallestInteger<N>::type>>
using container_type = typename PTransf<N, point_type>::container_type

In this case, this is PTransf<N, Scalar>::container_type.

◆ point_type

template<size_t N = 0, typename Scalar = std::conditional_t<N == 0, uint32_t, typename SmallestInteger<N>::type>>
using point_type = Scalar

Also the template parameter Scalar.

Member Function Documentation

◆ one()

template<size_t N = 0, typename Scalar = std::conditional_t<N == 0, uint32_t, typename SmallestInteger<N>::type>>
static Perm one ( size_t M)
inlinestaticnodiscard

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

Parameters
Mthe degree.
Returns
A value of type Transf.
Exceptions
LibsemigroupsExceptionif IsStatic<Transf> is true, and M is not the same as the template parameter N.

The documentation for this class was generated from the following file: