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_type get(const Perm &p, typename permutation_traits<Perm>::value_type i)
Returns

permutation_traits<Perm>::get(p, i)

template<typename Perm>
Perm make_perm(std::size_t n)
Returns

permutation_traits<Perm>::make(n)

template<typename Perm, typename SrcPerm>
Perm copy_perm(std::size_t n, SrcPerm &&p)

If SrcPerm and Perm are the same types, except for qualifies and referenceness, then the result is copy-constructed. Otherwise a new permutation is created with make_perm and initialized with put.

Returns

a copy of the given Permutation p.

template<typename Perm, typename SrcPerm>
Perm copy_perm(SrcPerm &&p)
Returns

perm_group::copy_perm<Perm>(perm_group::degree(p), std::forward<SrcPerm>(p))

template<typename Perm>
Perm make_identity_perm(std::size_t n)
Returns

permutation_traits<Perm>::make_identity(n)

template<typename Perm>
void put(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_t degree(const Perm &p)
Returns

permutation_traits<Perm>::degree(p)

template<typename Perm>
Perm make_inverse(const Perm &p)
Returns

permutation_traits<Perm>::make_inverse(p, perm_group::degree(p))