3.5.3. interface.hpp¶
Full path: permutation/interface.hpp
The following function templates are convenience functions and short-hands for using the operations on permutation_traits
.
They constitute the basic generic interface for Permutation
s.
-
template<typename
Perm
>
typename permutation_traits<Perm>::value_typeget
(const Perm &p, typename permutation_traits<Perm>::value_type i)¶ - Returns
permutation_traits<Perm>::get(p, i)
-
template<typename
Perm
>
Permmake_perm
(std::size_t n)¶ - Returns
permutation_traits<Perm>::make(n)
-
template<typename
Perm
, typenameSrcPerm
>
Permcopy_perm
(std::size_t n, SrcPerm &&p)¶ If
SrcPerm
andPerm
are the same types, except for qualifies and referenceness, then the result is copy-constructed. Otherwise a new permutation is created withmake_perm
and initialized withput
.- Returns
a copy of the given
Permutation
p
.
-
template<typename
Perm
>
Permmake_identity_perm
(std::size_t n)¶ - Returns
permutation_traits<Perm>::make_identity(n)
-
template<typename
Perm
>
voidput
(Perm &p, typename permutation_traits<Perm>::value_type i, typename permutation_traits<Perm>::value_type image)¶ Does
permutation_traits<Perm>::put(p, i, image)
.
-
template<typename
Perm
>
std::size_tdegree
(const Perm &p)¶ - Returns
permutation_traits<Perm>::degree(p)