libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
make<PPerm>

This page contains documentation related to safely constructing a PPerm instance.

See also
The `make` function for an overview of possible uses of the make function.

Functions

template<typename Return, typename Container>
enable_if_is_same< Return, HPCombi::PPerm16 > make (Container &&cont)
 Construct a HPCombi::PPerm16 from container and check.
 
template<typename Return, typename OtherContainer>
std::enable_if_t< IsPPerm< Return >, Return > make (OtherContainer &&cont)
 Construct a PPerm from universal reference container and check.
 
template<typename Return, typename Int>
enable_if_is_same< Return, HPCombi::PPerm16 > make (std::initializer_list< Int > dom, std::initializer_list< Int > ran, size_t M)
 Construct a HPCombi::PPerm16 from domain, range, and degree, and check.
 
template<typename Return>
std::enable_if_t< IsPPerm< Return >, Return > make (std::initializer_list< typename Return::point_type > cont)
 Construct a PPerm from initializer list and check.
 
template<typename Return>
std::enable_if_t< IsPPerm< Return >, Return > make (std::initializer_list< typename Return::point_type > dom, std::initializer_list< typename Return::point_type > ran, size_t M)
 Construct a PPerm from domain, range, and degree, and check.
 
template<typename Return>
std::enable_if_t< IsPPerm< Return >, Return > make (std::vector< typename Return::point_type > const &dom, std::vector< typename Return::point_type > const &ran, size_t M)
 Construct a PPerm from domain, range, and degree, and check.
 
template<typename Return>
enable_if_is_same< Return, HPCombi::PPerm16 > make (std::vector< uint8_t > const &dom, std::vector< uint8_t > const &ran, size_t deg=16)
 Construct a HPCombi::PPerm16 from domain, range, and degree, and check.
 

Function Documentation

◆ make() [1/7]

template<typename Return, typename Container>
enable_if_is_same< Return, HPCombi::PPerm16 > make ( Container && cont)
nodiscard

Constructs a HPCombi::PPerm16 initialized using the container cont as follows: the image of the point i under the partial perm is the value in position i of the container cont.

Template Parameters
Returnthe return type. Must by HPCombi::PPerm16.
Containertype of the container.
Parameters
contthe container.
Returns
A HPCombi::PPerm16 instance.
Exceptions
LibsemigroupsExceptionif any of the following hold:
  • the size of cont exceeds 16;
  • any value in cont exceeds cont.size();
  • any value in cont is repeated.
Complexity
Linear in the size of the container cont.

◆ make() [2/7]

template<typename Return, typename OtherContainer>
std::enable_if_t< IsPPerm< Return >, Return > make ( OtherContainer && cont)
nodiscard

Constructs a PPerm initialized using the container cont as follows: the image of the point i under the partial permutation is the value in position i of the container cont.

Template Parameters
Returnthe return type. Must satisfy IsPPerm<Return>.
OtherContaineruniversal reference for the type of the container.
Parameters
contthe container.
Returns
A PPerm instance with degree N.
Exceptions
LibsemigroupsExceptionif any of the following hold:
  • the size of cont is incompatible with container_type.
  • any value in cont exceeds cont.size() and is not equal to UNDEFINED.
Complexity
Linear in the size of the container cont.

◆ make() [3/7]

template<typename Return, typename Int>
enable_if_is_same< Return, HPCombi::PPerm16 > make ( std::initializer_list< Int > dom,
std::initializer_list< Int > ran,
size_t M )
nodiscard

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

Template Parameters
Returnthe return type, must be HPCombi::PPerm16.
Parameters
domthe domain.
ranthe range.
Mthe degree.
Exceptions
LibsemigroupsExceptionif 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.
Complexity
Linear in the size of dom.

◆ make() [4/7]

template<typename Return>
std::enable_if_t< IsPPerm< Return >, Return > make ( std::initializer_list< typename Return::point_type > cont)
nodiscard

Constructs a PPerm initialized using the container cont as follows: the image of the point i under the partial permutation is the value in position i of the container cont.

Template Parameters
Returnthe return type. Must satisfy IsPPerm<Return>.
Parameters
contthe container.
Returns
A PPerm instance with degree N.
Exceptions
LibsemigroupsExceptionif any of the following hold:
  • the size of cont is incompatible with container_type.
  • any value in cont exceeds cont.size() and is not equal to UNDEFINED.
Complexity
Linear in the size of the container cont.

◆ make() [5/7]

template<typename Return>
std::enable_if_t< IsPPerm< Return >, Return > make ( std::initializer_list< typename Return::point_type > dom,
std::initializer_list< typename Return::point_type > ran,
size_t M )
nodiscard

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

Template Parameters
Returnthe return type. Must satisfy IsPPerm<Return>.
Parameters
domthe domain.
ranthe range.
Mthe degree.
Exceptions
LibsemigroupsExceptionif 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.
Complexity
Linear in the size of dom.

◆ make() [6/7]

template<typename Return>
std::enable_if_t< IsPPerm< Return >, Return > make ( std::vector< typename Return::point_type > const & dom,
std::vector< typename Return::point_type > const & ran,
size_t M )
nodiscard

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

Template Parameters
Returnthe return type. Must satisfy IsPPerm<Return>.
Parameters
domthe domain.
ranthe range.
Mthe degree.
Exceptions
LibsemigroupsExceptionif 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.
Complexity
Linear in the size of dom.

◆ make() [7/7]

template<typename Return>
enable_if_is_same< Return, HPCombi::PPerm16 > make ( std::vector< uint8_t > const & dom,
std::vector< uint8_t > const & ran,
size_t deg = 16 )
nodiscard

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

Template Parameters
Returnthe return type, must be HPCombi::PPerm16.
Parameters
domthe domain.
ranthe range.
degthe degree.
Exceptions
LibsemigroupsExceptionif 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.
Complexity
Linear in the size of dom.