HPCombi
High Performance Combinatorics in C++ using vector instructions v1.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
HPCombi::TPUBuild< TPU > Struct Template Reference

Class for factory object associated to a SIMD packed unsigned integers. More...

#include <builder.hpp>

Public Types

using type_elem = typename std::remove_reference_t< decltype((TPU{})[0])>
 Type of the elements.
 
using array = std::array< type_elem, size >
 Array equivalent type.
 

Public Member Functions

constexpr TPU operator() (std::initializer_list< type_elem > il, type_elem def) const
 Construct a TPU from an std::initializer_list and a default value.
 
template<class Fun >
constexpr TPU operator() (Fun f) const
 Construct a TPU from a function giving the values at \(1,2,\dots\).
 
constexpr TPU operator() (type_elem c) const
 Construct a constant TPU.
 
constexpr TPU operator() (int c) const
 explicit overloading for int constants
 
constexpr TPU operator() (size_t c) const
 explicit overloading for size_t constants
 
constexpr TPU operator() (array a) const
 explicit overloading for array
 
constexpr TPU id () const
 Return the identity element of type TPU.
 
constexpr TPU rev () const
 Return the reversed element of type TPU.
 
constexpr TPU left_cycle () const
 Left cycle TPU permutation.
 
constexpr TPU right_cycle () const
 Right cycle TPU permutation.
 
constexpr TPU left_dup () const
 Left shift TPU, duplicating the rightmost entry.
 
constexpr TPU right_dup () const
 Right shift TPU, duplicating the leftmost entry.
 
constexpr TPU popcount () const
 Popcount TPU: the ith entry contains the number of bits set in i.
 

Static Public Member Functions

template<class Fun , decltype(size)... Is>
static constexpr TPU make_helper (Fun f, std::index_sequence< Is... >)
 

Static Public Attributes

static constexpr size_t size_elem = sizeof(type_elem)
 Size of the elements.
 
static constexpr size_t size = sizeof(TPU) / size_elem
 Number of elements.
 

Detailed Description

template<class TPU>
struct HPCombi::TPUBuild< TPU >

Class for factory object associated to a SIMD packed unsigned integers.

The main purpose of this class is to be able to construct in a constexpr way various instances of the TPU SIMD vector type. The behavior of an instance of TPUBuild<TPU> is designed to mimic the behavior of TPU if it where a class:

Member Typedef Documentation

◆ array

template<class TPU >
using HPCombi::TPUBuild< TPU >::array = std::array<type_elem, size>

Array equivalent type.

◆ type_elem

template<class TPU >
using HPCombi::TPUBuild< TPU >::type_elem = typename std::remove_reference_t<decltype((TPU{})[0])>

Type of the elements.

Member Function Documentation

◆ id()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::id ( ) const
inlineconstexpr

Return the identity element of type TPU.

◆ left_cycle()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::left_cycle ( ) const
inlineconstexpr

Left cycle TPU permutation.

◆ left_dup()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::left_dup ( ) const
inlineconstexpr

Left shift TPU, duplicating the rightmost entry.

◆ make_helper()

template<class TPU >
template<class Fun , decltype(size)... Is>
static constexpr TPU HPCombi::TPUBuild< TPU >::make_helper ( Fun  f,
std::index_sequence< Is... >   
)
inlinestaticconstexpr

◆ operator()() [1/6]

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::operator() ( array  a) const
inlineconstexpr

explicit overloading for array

◆ operator()() [2/6]

template<class TPU >
template<class Fun >
constexpr TPU HPCombi::TPUBuild< TPU >::operator() ( Fun  f) const
inlineconstexpr

Construct a TPU from a function giving the values at \(1,2,\dots\).

◆ operator()() [3/6]

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::operator() ( int  c) const
inlineconstexpr

explicit overloading for int constants

◆ operator()() [4/6]

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::operator() ( size_t  c) const
inlineconstexpr

explicit overloading for size_t constants

◆ operator()() [5/6]

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::operator() ( std::initializer_list< type_elem il,
type_elem  def 
) const
inlineconstexpr

Construct a TPU from an std::initializer_list and a default value.

◆ operator()() [6/6]

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::operator() ( type_elem  c) const
inlineconstexpr

Construct a constant TPU.

◆ popcount()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::popcount ( ) const
inlineconstexpr

Popcount TPU: the ith entry contains the number of bits set in i.

◆ rev()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::rev ( ) const
inlineconstexpr

Return the reversed element of type TPU.

◆ right_cycle()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::right_cycle ( ) const
inlineconstexpr

Right cycle TPU permutation.

◆ right_dup()

template<class TPU >
constexpr TPU HPCombi::TPUBuild< TPU >::right_dup ( ) const
inlineconstexpr

Right shift TPU, duplicating the leftmost entry.

Member Data Documentation

◆ size

template<class TPU >
constexpr size_t HPCombi::TPUBuild< TPU >::size = sizeof(TPU) / size_elem
staticconstexpr

Number of elements.

◆ size_elem

template<class TPU >
constexpr size_t HPCombi::TPUBuild< TPU >::size_elem = sizeof(type_elem)
staticconstexpr

Size of the elements.


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