HPCombi
High Performance Combinatorics in C++ using vector instructions v1.0.3
Loading...
Searching...
No Matches
HPCombi::PermGeneric< Size, Expo > Struct Template Reference

Vanilla (ie NOT optimized) implementation of a permutation, used to check for test correctness and as baseline to measure speedup. More...

#include <perm_generic.hpp>

Inheritance diagram for HPCombi::PermGeneric< Size, Expo >:
HPCombi::VectGeneric< Size, uint8_t >

Public Types

using vect = VectGeneric<Size, Expo>
 
- Public Types inherited from HPCombi::VectGeneric< Size, uint8_t >
using array
 
using value_type
 
using iterator
 
using const_iterator
 

Public Member Functions

 PermGeneric ()=default
 
 PermGeneric (const vect v)
 
 PermGeneric (std::initializer_list< Expo > il)
 
PermGeneric operator* (const PermGeneric &p) const
 
PermGeneric inverse () const
 
vect lehmer () const
 
uint64_t length () const
 
uint64_t nb_descents () const
 
uint64_t nb_cycles () const
 
bool left_weak_leq (PermGeneric other) const
 
- Public Member Functions inherited from HPCombi::VectGeneric< Size, uint8_t >
 VectGeneric ()=default
 
 VectGeneric (const array &_v)
 
 VectGeneric (std::initializer_list< uint8_t > il, uint8_t def=0)
 
uint8_t operator[] (uint64_t i) const
 
uint8_t & operator[] (uint64_t i)
 
size_t first_diff (const VectGeneric &u, size_t bound=Size) const
 
size_t last_diff (const VectGeneric &u, size_t bound=Size) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
bool operator== (const VectGeneric &u) const
 
bool operator!= (const VectGeneric &u) const
 
bool operator< (const VectGeneric &u) const
 
int8_t less_partial (const VectGeneric &u, int k) const
 
VectGeneric permuted (const VectGeneric &u) const
 
void sort ()
 
bool is_sorted () const
 
uint64_t first_non_zero (size_t bound=Size) const
 
uint64_t first_zero (size_t bound=Size) const
 
uint64_t last_non_zero (size_t bound=Size) const
 
uint64_t last_zero (size_t bound=Size) const
 
bool is_permutation (const size_t k=Size) const
 
uint64_t horiz_sum () const noexcept
 
VectGeneric partial_sums () const noexcept
 
void partial_sums_inplace ()
 
uint8_t horiz_max () const
 
void partial_max_inplace ()
 
uint8_t horiz_min () const
 
void partial_min_inplace ()
 
VectGeneric eval () const
 

Static Public Member Functions

static constexpr size_t size ()
 
static PermGeneric one ()
 
static PermGeneric elementary_transposition (uint64_t i)
 
static PermGeneric random ()
 
- Static Public Member Functions inherited from HPCombi::VectGeneric< Size, uint8_t >
static constexpr size_t size ()
 
static VectGeneric random ()
 

Additional Inherited Members

- Public Attributes inherited from HPCombi::VectGeneric< Size, uint8_t >
array v
 

Detailed Description

template<size_t Size, typename Expo = uint8_t>
struct HPCombi::PermGeneric< Size, Expo >

Vanilla (ie NOT optimized) implementation of a permutation, used to check for test correctness and as baseline to measure speedup.

Implemented as an std array, so the permutation is not necessarily of size n=16. PermGeneric<16> should implement as much as possibles of Perm16 (currently not everything due to lack of time/need). No optimisation, so prefer to use Perm16.

About Expo, see comment on HPCombi::VectGeneric.

Member Typedef Documentation

◆ vect

template<size_t Size, typename Expo = uint8_t>
using HPCombi::PermGeneric< Size, Expo >::vect = VectGeneric<Size, Expo>

Constructor & Destructor Documentation

◆ PermGeneric() [1/3]

template<size_t Size, typename Expo = uint8_t>
HPCombi::PermGeneric< Size, Expo >::PermGeneric ( )
default

◆ PermGeneric() [2/3]

template<size_t Size, typename Expo = uint8_t>
HPCombi::PermGeneric< Size, Expo >::PermGeneric ( const vect v)
inline

◆ PermGeneric() [3/3]

template<size_t Size, typename Expo>
HPCombi::PermGeneric< Size, Expo >::PermGeneric ( std::initializer_list< Expo > il)

Member Function Documentation

◆ elementary_transposition()

template<size_t Size, typename Expo>
PermGeneric< Size, Expo > HPCombi::PermGeneric< Size, Expo >::elementary_transposition ( uint64_t i)
static

◆ inverse()

template<size_t Size, typename Expo>
PermGeneric< Size, Expo > HPCombi::PermGeneric< Size, Expo >::inverse ( ) const

◆ left_weak_leq()

template<size_t Size, typename Expo>
bool HPCombi::PermGeneric< Size, Expo >::left_weak_leq ( PermGeneric< Size, Expo > other) const

◆ lehmer()

template<size_t Size, typename Expo>
PermGeneric< Size, Expo >::vect HPCombi::PermGeneric< Size, Expo >::lehmer ( ) const

◆ length()

template<size_t Size, typename Expo>
uint64_t HPCombi::PermGeneric< Size, Expo >::length ( ) const

◆ nb_cycles()

template<size_t Size, typename Expo>
uint64_t HPCombi::PermGeneric< Size, Expo >::nb_cycles ( ) const

◆ nb_descents()

template<size_t Size, typename Expo>
uint64_t HPCombi::PermGeneric< Size, Expo >::nb_descents ( ) const

◆ one()

template<size_t Size, typename Expo = uint8_t>
static PermGeneric HPCombi::PermGeneric< Size, Expo >::one ( )
inlinestatic

◆ operator*()

template<size_t Size, typename Expo = uint8_t>
PermGeneric HPCombi::PermGeneric< Size, Expo >::operator* ( const PermGeneric< Size, Expo > & p) const
inline

◆ random()

template<size_t Size, typename Expo>
PermGeneric< Size, Expo > HPCombi::PermGeneric< Size, Expo >::random ( )
static

◆ size()

template<size_t Size, typename Expo = uint8_t>
static constexpr size_t HPCombi::PermGeneric< Size, Expo >::size ( )
inlinestaticconstexpr

The documentation for this struct was generated from the following files: