vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Public Types | Public Member Functions | Public Attributes | List of all members
wielding::indexed_reductor< vsz, ic_type, functor_type, typename > Struct Template Reference

indexed_reductor is used for reductions and has no output. The actual reduction is handled by the functor: each thread has it's own copy of the functor, which does it's own part of the reduction, and 'offloads' it's result to some mutex-protected receptacle when it's destructed, see the 'reduce' functions in transform.h for a more detailed explanation and an example of such a functor. idexed_reductor processes discrete coordinates, whereas yield_reductor (the next class down) processes values. This variant works just like an indexed_aggregator, only that it produces no output - at least not for every coordinate fed to the functor, the functor itself does hold state (the reduction) and is also responsible for offloading per-thread results when the worker threads terminate. This class holds a copy of the functor, and each thread has an instance of this class, ensuring that each worker thread can reduce it's share of the work load independently. More...

#include <wielding.h>

Public Types

enum  { dim_in = functor_type::dim_in }
 
typedef functor_type::in_type in_type
 
typedef functor_type::in_ele_type in_ele_type
 
typedef functor_type::in_v in_v
 
typedef functor_type::in_ele_v in_ele_v
 
typedef functor_type::in_type crd_type
 

Public Member Functions

 indexed_reductor (const functor_type &_functor)
 
void operator() (in_type crd, int axis, ic_type length)
 

Public Attributes

functor_type functor
 

Detailed Description

template<size_t vsz, typename ic_type, class functor_type, typename = std::enable_if < ( vsz > 1 ) >>
struct wielding::indexed_reductor< vsz, ic_type, functor_type, typename >

indexed_reductor is used for reductions and has no output. The actual reduction is handled by the functor: each thread has it's own copy of the functor, which does it's own part of the reduction, and 'offloads' it's result to some mutex-protected receptacle when it's destructed, see the 'reduce' functions in transform.h for a more detailed explanation and an example of such a functor. idexed_reductor processes discrete coordinates, whereas yield_reductor (the next class down) processes values. This variant works just like an indexed_aggregator, only that it produces no output - at least not for every coordinate fed to the functor, the functor itself does hold state (the reduction) and is also responsible for offloading per-thread results when the worker threads terminate. This class holds a copy of the functor, and each thread has an instance of this class, ensuring that each worker thread can reduce it's share of the work load independently.

Definition at line 375 of file wielding.h.

Member Typedef Documentation

◆ crd_type

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
typedef functor_type::in_type wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::crd_type

Definition at line 390 of file wielding.h.

◆ in_ele_type

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
typedef functor_type::in_ele_type wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::in_ele_type

Definition at line 380 of file wielding.h.

◆ in_ele_v

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
typedef functor_type::in_ele_v wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::in_ele_v

Definition at line 382 of file wielding.h.

◆ in_type

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
typedef functor_type::in_type wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::in_type

Definition at line 379 of file wielding.h.

◆ in_v

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
typedef functor_type::in_v wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::in_v

Definition at line 381 of file wielding.h.

Member Enumeration Documentation

◆ anonymous enum

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
anonymous enum
Enumerator
dim_in 

Definition at line 384 of file wielding.h.

Constructor & Destructor Documentation

◆ indexed_reductor()

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::indexed_reductor ( const functor_type &  _functor)
inline

Definition at line 394 of file wielding.h.

Member Function Documentation

◆ operator()()

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
void wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::operator() ( in_type  crd,
int  axis,
ic_type  length 
)
inline

Definition at line 398 of file wielding.h.

Member Data Documentation

◆ functor

template<size_t vsz, typename ic_type , class functor_type , typename = std::enable_if < ( vsz > 1 ) >>
functor_type wielding::indexed_reductor< vsz, ic_type, functor_type, typename >::functor

Definition at line 386 of file wielding.h.


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