vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Public Types | Public Member Functions | List of all members
wielding::vs_adapter< inner_type > Struct Template Reference

vs_adapter wraps a vspline::unary_functor to produce a functor which is compatible with the wielding code. This is necessary, because vspline's unary_functors take 'naked' arguments if the data are 1D, while the wielding code always passes TinyVectors. The operation of this wrapper class should not have a run-time effect; it's simply converting references. the wrapped functor is only used via operator(), so this is what we provide. While it would be nice to simply pass through the unwrapped unary_functor, this would force us to deal with the distinction between data in TinyVectors and 'naked' fundamentals deeper down in the code, and here is a good central place where we can route to uniform access via TinyVectors - possibly with only one element. By inheriting from inner_type, we provide all of inner_type's type system which we don't explicitly override. Rest assured: the reinterpret_cast is safe. If the data are single-channel, the containerized version takes up the same meory as the uncontainerized version of the datum. multi-channel data are containerized anyway. More...

#include <wielding.h>

Inheritance diagram for wielding::vs_adapter< inner_type >:

Public Types

typedef inner_type::in_nd_ele_type in_type
 
typedef inner_type::out_nd_ele_type out_type
 
typedef inner_type::in_nd_ele_v in_v
 
typedef inner_type::out_nd_ele_v out_v
 

Public Member Functions

 vs_adapter (const inner_type &_inner)
 
void operator() (const in_type &in, out_type &out) const
 operator() overload for unvectorized arguments More...
 
template<typename = std::enable_if < ( inner_type::vsize > 1 ) >>
void operator() (const in_v &in, out_v &out) const
 vectorized evaluation function. This is enabled only if vsize > 1 More...
 

Detailed Description

template<class inner_type>
struct wielding::vs_adapter< inner_type >

vs_adapter wraps a vspline::unary_functor to produce a functor which is compatible with the wielding code. This is necessary, because vspline's unary_functors take 'naked' arguments if the data are 1D, while the wielding code always passes TinyVectors. The operation of this wrapper class should not have a run-time effect; it's simply converting references. the wrapped functor is only used via operator(), so this is what we provide. While it would be nice to simply pass through the unwrapped unary_functor, this would force us to deal with the distinction between data in TinyVectors and 'naked' fundamentals deeper down in the code, and here is a good central place where we can route to uniform access via TinyVectors - possibly with only one element. By inheriting from inner_type, we provide all of inner_type's type system which we don't explicitly override. Rest assured: the reinterpret_cast is safe. If the data are single-channel, the containerized version takes up the same meory as the uncontainerized version of the datum. multi-channel data are containerized anyway.

Definition at line 1958 of file wielding.h.

Member Typedef Documentation

◆ in_type

template<class inner_type >
typedef inner_type::in_nd_ele_type wielding::vs_adapter< inner_type >::in_type

Definition at line 1966 of file wielding.h.

◆ in_v

template<class inner_type >
typedef inner_type::in_nd_ele_v wielding::vs_adapter< inner_type >::in_v

Definition at line 1968 of file wielding.h.

◆ out_type

template<class inner_type >
typedef inner_type::out_nd_ele_type wielding::vs_adapter< inner_type >::out_type

Definition at line 1967 of file wielding.h.

◆ out_v

template<class inner_type >
typedef inner_type::out_nd_ele_v wielding::vs_adapter< inner_type >::out_v

Definition at line 1969 of file wielding.h.

Constructor & Destructor Documentation

◆ vs_adapter()

template<class inner_type >
wielding::vs_adapter< inner_type >::vs_adapter ( const inner_type &  _inner)
inline

Definition at line 1971 of file wielding.h.

Member Function Documentation

◆ operator()() [1/2]

template<class inner_type >
void wielding::vs_adapter< inner_type >::operator() ( const in_type in,
out_type out 
) const
inline

operator() overload for unvectorized arguments

Definition at line 1977 of file wielding.h.

◆ operator()() [2/2]

template<class inner_type >
template<typename = std::enable_if < ( inner_type::vsize > 1 ) >>
void wielding::vs_adapter< inner_type >::operator() ( const in_v in,
out_v out 
) const
inline

vectorized evaluation function. This is enabled only if vsize > 1

Definition at line 1988 of file wielding.h.


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