C++ Library Extensions 2022.12.09
To help learn modern C++ programming
tpf::split_range Namespace Reference

Typedefs

template<typename T >
using range = std::pair< T, T >
 
typedef range< size_t > range_t
 
template<typename T >
using rngvctr = std::deque< range< T > >
 
typedef rngvctr< size_t > range_vctr_t
 

Functions

template<typename T >
std::string display_range (const range< T > &rg, bool thousands=true)
 
template<typename T >
rngvctr< T > split_range_count (T st, T ed, T count=(T)(-1))
 
template<typename T >
rngvctr< T > split_range_span (T st, T ed, T min_span=(T)(-1))
 
template<typename T >
std::string display_ranges (const rngvctr< T > &rngs, int width=9, bool thousands=true)
 
size_t cpu_thread_count () noexcept
 
template<typename T >
rngvctr< T > split_range_half (T st, T ed)
 
template<typename RangeType , typename BinOperation , typename SumupOperation , typename = std::enable_if_t<tpf::types::is_integer_v<RangeType>>>
auto parallel_reduce (RangeType start, RangeType end, BinOperation &&bin_opr, SumupOperation &&sumup, size_t use_thread_count=tpf::InvalidIndex)
 
template<typename ContainerType , typename BinOperation , typename SumupOperation , typename = tpf::types::enable_if_container_type_t<ContainerType>>
auto parallel_reduce (ContainerType &&container, BinOperation &&bin_opr, SumupOperation &&sumup, size_t use_thread_count=tpf::InvalidIndex)
 

Typedef Documentation

◆ range

template<typename T >
using tpf::split_range::range = typedef std::pair<T, T>

Definition at line 41 of file tpf_split_ranges.hpp.

◆ range_t

Definition at line 43 of file tpf_split_ranges.hpp.

◆ range_vctr_t

Definition at line 48 of file tpf_split_ranges.hpp.

◆ rngvctr

template<typename T >
using tpf::split_range::rngvctr = typedef std::deque<range<T> >

Definition at line 46 of file tpf_split_ranges.hpp.

Function Documentation

◆ cpu_thread_count()

size_t tpf::split_range::cpu_thread_count ( )
inlinenoexcept

Definition at line 228 of file tpf_split_ranges.hpp.

Here is the caller graph for this function:

◆ display_range()

template<typename T >
std::string tpf::split_range::display_range ( const range< T > &  rg,
bool  thousands = true 
)

Definition at line 51 of file tpf_split_ranges.hpp.

◆ display_ranges()

template<typename T >
std::string tpf::split_range::display_ranges ( const rngvctr< T > &  rngs,
int  width = 9,
bool  thousands = true 
)

Definition at line 197 of file tpf_split_ranges.hpp.

◆ parallel_reduce() [1/2]

template<typename ContainerType , typename BinOperation , typename SumupOperation , typename = tpf::types::enable_if_container_type_t<ContainerType>>
auto tpf::split_range::parallel_reduce ( ContainerType &&  container,
BinOperation &&  bin_opr,
SumupOperation &&  sumup,
size_t  use_thread_count = tpf::InvalidIndex 
)

Definition at line 296 of file tpf_split_ranges.hpp.

Here is the call graph for this function:

◆ parallel_reduce() [2/2]

template<typename RangeType , typename BinOperation , typename SumupOperation , typename = std::enable_if_t<tpf::types::is_integer_v<RangeType>>>
auto tpf::split_range::parallel_reduce ( RangeType  start,
RangeType  end,
BinOperation &&  bin_opr,
SumupOperation &&  sumup,
size_t  use_thread_count = tpf::InvalidIndex 
)

Definition at line 235 of file tpf_split_ranges.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ split_range_count()

template<typename T >
rngvctr< T > tpf::split_range::split_range_count ( st,
ed,
count = (T)(-1) 
)

Definition at line 142 of file tpf_split_ranges.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ split_range_half()

template<typename T >
rngvctr< T > tpf::split_range::split_range_half ( st,
ed 
)

Definition at line 191 of file tpf_split_ranges.hpp.

Here is the call graph for this function:

◆ split_range_span()

template<typename T >
rngvctr< T > tpf::split_range::split_range_span ( st,
ed,
min_span = (T)(-1) 
)

Definition at line 84 of file tpf_split_ranges.hpp.

Here is the call graph for this function: