vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
|
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>
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... | |
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.
typedef inner_type::in_nd_ele_type wielding::vs_adapter< inner_type >::in_type |
Definition at line 1966 of file wielding.h.
typedef inner_type::in_nd_ele_v wielding::vs_adapter< inner_type >::in_v |
Definition at line 1968 of file wielding.h.
typedef inner_type::out_nd_ele_type wielding::vs_adapter< inner_type >::out_type |
Definition at line 1967 of file wielding.h.
typedef inner_type::out_nd_ele_v wielding::vs_adapter< inner_type >::out_v |
Definition at line 1969 of file wielding.h.
|
inline |
Definition at line 1971 of file wielding.h.
|
inline |
operator() overload for unvectorized arguments
Definition at line 1977 of file wielding.h.
|
inline |
vectorized evaluation function. This is enabled only if vsize > 1
Definition at line 1988 of file wielding.h.