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.
|
| 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> |
| 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.
|
| |
◆ make() [1/4]
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
-
| Return | the return type. Must satisfy IsPPerm<Return>. |
| OtherContainer | universal reference for the type of the container. |
- Parameters
-
- Returns
- A PPerm instance with degree
N.
- Exceptions
-
- Complexity
- Linear in the size of the container
cont.
◆ make() [2/4]
template<typename Return>
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
-
- Parameters
-
- Returns
- A PPerm instance with degree
N.
- Exceptions
-
- Complexity
- Linear in the size of the container
cont.
◆ make() [3/4]
template<typename Return>
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
-
- Parameters
-
| dom | the domain. |
| ran | the range. |
| M | the degree. |
- Exceptions
-
| 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.
|
- Complexity
- Linear in the size of
dom.
◆ make() [4/4]
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
-
- Parameters
-
| dom | the domain. |
| ran | the range. |
| M | the degree. |
- Exceptions
-
| 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.
|
- Complexity
- Linear in the size of
dom.