20#ifndef HPCOMBI_PERM16_HPP_
21#define HPCOMBI_PERM16_HPP_
25#include <initializer_list>
34#include "simde/x86/sse4.1.h"
35#include "simde/x86/sse4.2.h"
48 static constexpr size_t size() {
return 16; }
57 PTransf16(std::vector<uint8_t> dom, std::vector<uint8_t> rng,
59 PTransf16(std::initializer_list<uint8_t> il);
78#ifdef SIMDE_X86_SSE4_2_NATIVE
99 uint32_t
rank()
const;
143 explicit Transf16(uint64_t compressed);
145 explicit operator uint64_t()
const;
154 PPerm16(std::vector<uint8_t> dom, std::vector<uint8_t> rng,
192#ifdef SIMDE_X86_SSE4_2_NATIVE
444static_assert(
sizeof(
epu8) ==
sizeof(Perm16),
445 "epu8 and Perm16 have a different memory layout !");
446static_assert(std::is_trivial<epu8>(),
"epu8 is not a trivial class !");
447static_assert(std::is_trivial<Perm16>(),
"Perm16 is not a trivial class !");
458 return std::hash<HPCombi::epu8>{}(ar.
v);
472 return std::hash<HPCombi::epu8>{}(ar.
v);
Perm16 Perm16
Definition perm16_impl.hpp:240
epu8 permuted(epu8 a, epu8 b) noexcept
Permuting a HPCombi::epu8.
Definition epu8.hpp:72
epu8 permutation_of(epu8 a, epu8 b) noexcept
Find if a vector is a permutation of one other.
Definition epu8_impl.hpp:303
bool is_permutation(epu8 v, const size_t k=16) noexcept
Definition epu8_impl.hpp:530
bool is_partial_permutation(epu8 v, const size_t k=16) noexcept
Test for partial permutations.
Definition epu8_impl.hpp:499
constexpr TPUBuild< epu8 > Epu8
Factory object acting as a class constructor for type HPCombi::epu8.
Definition epu8.hpp:53
uint8_t __attribute__((vector_size(16))) epu8
SIMD vector of 16 unsigned bytes.
Definition epu8.hpp:45
bool is_transformation(epu8 v, const size_t k=16) noexcept
Test for transformation.
Definition epu8_impl.hpp:493
bool is_partial_transformation(epu8 v, const size_t k=16) noexcept
Test for partial transformation.
Definition epu8_impl.hpp:485
Generic compile time power.
Partial permutation of .
Definition perm16.hpp:149
PPerm16 right_one() const
Definition perm16.hpp:201
PPerm16 inverse_ref() const
The inverse of a partial permutation.
Definition perm16_impl.hpp:146
PPerm16 operator*(const PPerm16 &p) const
The product of two partial perrmutations.
Definition perm16.hpp:168
constexpr PPerm16(const PPerm16 &v)=default
PPerm16 & operator=(const PPerm16 &)=default
constexpr PPerm16(const vect v)
Definition perm16.hpp:152
PPerm16(std::vector< uint8_t > dom, std::vector< uint8_t > rng, size_t=0)
Definition perm16.hpp:154
static constexpr PPerm16 one()
The identity partial permutations.
Definition perm16.hpp:166
PPerm16 left_one() const
Definition perm16.hpp:202
PPerm16(std::initializer_list< uint8_t > il)
Definition perm16.hpp:157
bool validate(size_t k=16) const
Return whether *this is a well constructed object.
Definition perm16.hpp:161
constexpr PPerm16(const epu8 x)
Definition perm16.hpp:153
Partial transformation of .
Definition perm16.hpp:47
uint8_t nb_fix_points() const
Returns the number of fix points of *this.
Definition perm16_impl.hpp:121
constexpr PTransf16(const epu8 x)
Definition perm16.hpp:56
constexpr PTransf16(const vect v)
Definition perm16.hpp:55
uint32_t fix_points_bitset(bool complement=false) const
Returns a bit mask for the fix point of *this.
Definition perm16_impl.hpp:99
static constexpr size_t size()
Definition perm16.hpp:48
PTransf16 operator*(const PTransf16 &p) const
The product of two partial transformations.
Definition perm16.hpp:69
static constexpr PTransf16 one()
The identity partial transformation.
Definition perm16.hpp:67
uint8_t largest_moved_point() const
Returns the largest non fix point of *this.
Definition perm16_impl.hpp:116
uint32_t domain_bitset(bool complement=false) const
Returns a bit mask for the domain of *this.
Definition perm16_impl.hpp:48
PTransf16 left_one() const
Returns the partial left identity for *this.
Definition perm16_impl.hpp:72
typename decltype(Epu8)::array array
Definition perm16.hpp:51
uint32_t rank_ref() const
Returns the size of the image of *this.
Definition perm16_impl.hpp:75
PTransf16 right_one() const
Returns the partial right identity for *this.
Definition perm16_impl.hpp:51
uint32_t image_bitset(bool complement=false) const
Returns a bit mask for the image of *this.
Definition perm16_impl.hpp:69
epu8 fix_points_mask(bool complement=false) const
Returns a mask for the fix point of *this.
Definition perm16_impl.hpp:96
uint8_t smallest_fix_point() const
Returns the smallest fix point of *this.
Definition perm16_impl.hpp:103
uint32_t rank_cmpestrm() const
Returns the size of the image of *this.
Definition perm16_impl.hpp:84
epu8 domain_mask(bool complement=false) const
Returns a mask for the domain of *this.
Definition perm16_impl.hpp:45
uint32_t rank() const
Returns the size of the image of *this.
Definition perm16_impl.hpp:88
epu8 image_mask_ref(bool complement=false) const
Returns a mask for the image of *this.
Definition perm16_impl.hpp:61
bool validate(size_t k=16) const
Return whether *this is a well constructed object.
Definition perm16.hpp:62
uint8_t largest_fix_point() const
Returns the largest fix point of *this.
Definition perm16_impl.hpp:111
epu8 image_mask(bool complement=false) const
Definition perm16.hpp:77
epu8 image_mask_cmpestrm(bool complement=false) const
Returns a mask for the image of *this.
uint8_t smallest_moved_point() const
Returns the smallest non fix point of *this.
Definition perm16_impl.hpp:107
Permutations of .
Definition perm16.hpp:208
Perm16 inverse_cycl() const
The inverse permutation.
Definition perm16_impl.hpp:249
Perm16 inverse() const
The inverse permutation.
Definition perm16.hpp:283
epu8 lehmer() const
The Lehmer code of a permutation.
Definition perm16_impl.hpp:290
uint8_t length_ref() const
The Coxeter length (ie: number of inversion) of a permutation.
Definition perm16_impl.hpp:299
epu8 cycles_partition() const
The set partition of the cycles of a permutation.
Definition perm16_impl.hpp:344
bool left_weak_leq_ref(Perm16 other) const
Compare two permutations for the left weak order.
Definition perm16_impl.hpp:362
uint8_t nb_descents_ref() const
The number of descent of a permutation.
Definition perm16_impl.hpp:320
Perm16(uint64_t compressed)
Construct a permutations from its 64 bits compressed.
Definition perm16.hpp:230
Perm16 inverse_sort() const
The inverse permutation.
Definition perm16_impl.hpp:225
Perm16 operator*(const Perm16 &p) const
The product of two permutations.
Definition perm16.hpp:225
Perm16(std::initializer_list< uint8_t > il)
Definition perm16.hpp:214
constexpr Perm16(const epu8 x)
Definition perm16.hpp:212
Perm16 inverse_find() const
The inverse permutation.
Definition perm16.hpp:266
static constexpr Perm16 one()
The identity partial permutation.
Definition perm16.hpp:223
epu8 lehmer_ref() const
The Lehmer code of a permutation.
Definition perm16_impl.hpp:271
bool left_weak_leq_length(Perm16 other) const
Compare two permutations for the left weak order.
Definition perm16_impl.hpp:385
uint8_t length() const
The Coxeter length (ie: number of inversion) of a permutation.
Definition perm16_impl.hpp:318
constexpr Perm16(const Perm16 &)=default
constexpr Perm16(const vect v)
Definition perm16.hpp:211
Perm16 inverse_ref() const
The inverse permutation.
Definition perm16_impl.hpp:209
uint8_t nb_descents() const
The number of descent of a permutation.
Definition perm16_impl.hpp:327
uint8_t nb_cycles() const
The number of cycles of a permutation.
Definition perm16.hpp:412
uint8_t nb_cycles_ref() const
The number of cycles of a permutation.
Definition perm16_impl.hpp:331
bool validate(size_t k=16) const
Return whether *this is a well constructed object.
Definition perm16.hpp:217
static Perm16 elementary_transposition(uint64_t i)
The elementary transposition exchanging and .
Definition perm16_impl.hpp:201
epu8 lehmer_arr() const
The Lehmer code of a permutation.
Definition perm16_impl.hpp:280
static Perm16 unrankSJT(int n, int r)
The r -th permutation of size n for the Steinhaus–Johnson–Trotter order.
Definition perm16_impl.hpp:173
bool left_weak_leq(Perm16 other) const
Compare two permutations for the left weak order.
Definition perm16_impl.hpp:372
uint8_t nb_cycles_unroll() const
The number of cycles of a permutation.
Definition perm16_impl.hpp:357
Perm16 & operator=(const Perm16 &)=default
Perm16 inverse_pow() const
The inverse permutation.
Definition perm16_impl.hpp:267
uint8_t length_arr() const
The Coxeter length (ie: number of inversion) of a permutation.
Definition perm16_impl.hpp:308
Perm16 inverse_arr() const
The inverse permutation.
Definition perm16_impl.hpp:216
static Perm16 random(uint64_t n=16)
A random permutation of size .
Definition perm16_impl.hpp:161
Full transformation of .
Definition perm16.hpp:122
Transf16 operator*(const Transf16 &p) const
The product of two transformations.
Definition perm16.hpp:138
constexpr Transf16(const vect v)
Definition perm16.hpp:125
Transf16(std::initializer_list< uint8_t > il)
Definition perm16.hpp:127
constexpr Transf16(const epu8 x)
Definition perm16.hpp:126
Transf16 & operator=(const Transf16 &)=default
bool validate(size_t k=16) const
Return whether *this is a well constructed object.
Definition perm16.hpp:131
static constexpr Transf16 one()
The identity transformation.
Definition perm16.hpp:136
constexpr Transf16(const Transf16 &v)=default
epu8 v
Definition vect16.hpp:37
size_t operator()(const HPCombi::PPerm16 &ar) const
A hash operator for HPCombi::PPerm16.
Definition perm16.hpp:471
size_t operator()(const HPCombi::PTransf16 &ar) const
A hash operator for HPCombi::PTransf16.
Definition perm16.hpp:457
size_t operator()(const HPCombi::Perm16 &ar) const
A hash operator for HPCombi::Perm16.
Definition perm16.hpp:478
size_t operator()(const HPCombi::Transf16 &ar) const
A hash operator for HPCombi::Transf16.
Definition perm16.hpp:464