vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Public Types | Public Member Functions | Public Attributes | List of all members
vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type > Class Template Reference

class evaluator encodes evaluation of a spline-like object. This is a generalization of b-spline evaluation, which is the default if no other basis functions are specified. Technically, a vspline::evaluator is a vspline::unary_functor, which has the specific capability of evaluating a specific spline-like object. This makes it a candidate to be passed to the functions in transform.h, like remap() and transform(), and it also makes it suitable for vspline's functional constructs like chaining, mapping, etc. More...

#include <eval.h>

Inheritance diagram for vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >:
vspline::bspline_evaluator_tag vspline::unary_functor< _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size > vspline::callable< evaluator< _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size, -1, default_math_type< _coordinate_type, _trg_type >, _trg_type, multi_bf_type< basis_functor< default_math_type< _coordinate_type, _trg_type > >, vigra::ExpandElementResult< _coordinate_type > ::size > >, _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size > vspline::unary_functor_tag< _vsize >

Public Types

enum  { vsize = _vsize }
 
enum  { dimension = base_type::dim_in }
 
enum  { level = dimension - 1 }
 
enum  { channels = base_type::dim_out }
 
enum  { specialize = _specialize }
 
typedef _coordinate_type coordinate_type
 
typedef _cf_type cf_type
 
typedef _math_ele_type math_ele_type
 
typedef _trg_type trg_type
 
typedef _mbf_type mbf_type
 
typedef int ic_ele_type
 
typedef int ofs_ele_type
 
typedef ET< coordinate_typerc_ele_type
 
typedef ET< cf_typecf_ele_type
 
typedef ET< trg_typetrg_ele_type
 
typedef unary_functor< coordinate_type, trg_type, vsizebase_type
 
typedef detail::inner_evaluator< ic_ele_type, rc_ele_type, ofs_ele_type, cf_ele_type, math_ele_type, trg_ele_type, dimension, channels, specialize, mbf_typeinner_type
 
typedef vigra::TinyVector< std::ptrdiff_t, dimensionshape_type
 
typedef vigra::TinyVector< int, dimensionderivative_spec_type
 
- Public Types inherited from vspline::unary_functor< _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size >
enum  
 
enum  
 
enum  
 
typedef _coordinate_type in_type
 
typedef _trg_type out_type
 
typedef vspline::vector_traits< _coordinate_type >::ele_type in_ele_type
 
typedef vspline::vector_traits< _trg_type >::ele_type out_ele_type
 
typedef vigra::TinyVector< in_ele_type, dim_inin_nd_ele_type
 
typedef vigra::TinyVector< out_ele_type, dim_outout_nd_ele_type
 
typedef vector_traits< _coordinate_type, vsize >::ele_v in_ele_v
 a simdized type of the elementary type of result_type, which is used for coefficients and results. this is fixed via the traits class vector_traits (in vector.h). Note how we derive this type using vsize from the template argument, not what vspline::vector_traits deems appropriate for ele_type - though both numbers will be the same in most cases. More...
 
typedef vector_traits< _trg_type, vsize >::ele_v out_ele_v
 
typedef vector_traits< _coordinate_type, vsize >::nd_ele_v in_nd_ele_v
 
typedef vector_traits< _trg_type, vsize >::nd_ele_v out_nd_ele_v
 
typedef vector_traits< _coordinate_type, vsize >::type in_v
 vectorized in_type and out_type. vspline::vector_traits supplies these types so that multidimensional/multichannel data come as vigra::TinyVectors, while 'singular' data won't be made into TinyVectors of one element. More...
 
typedef vector_traits< _trg_type, vsize >::type out_v
 
typedef vector_traits< int, vsize >::ele_v ic_v
 vsize wide vector of ints, used for gather/scatter indexes More...
 
- Public Types inherited from vspline::callable< evaluator< _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size, -1, default_math_type< _coordinate_type, _trg_type >, _trg_type, multi_bf_type< basis_functor< default_math_type< _coordinate_type, _trg_type > >, vigra::ExpandElementResult< _coordinate_type > ::size > >, _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size >
typedef vector_traits< _coordinate_type, vsize >::type cl_in_v
 
typedef vector_traits< _trg_type, vsize >::type cl_out_v
 

Public Member Functions

void eval (const typename base_type::in_type &_coordinate, typename base_type::out_type &_result) const
 unvectorized evaluation function. this is delegated to 'feed' above, which reinterprets the arguments as the 'synthetic' types used by class inner_evaluator. More...
 
template<typename = std::enable_if < ( vsize > 1 ) >>
void eval (const typename base_type::in_v &_coordinate, typename base_type::out_v &_result) const
 vectorized evaluation function. This is enabled only if vsize > 1 to guard against cases where vsize is 1. Without the enable_if, we'd end up with two overloads with the same signature if vsize is 1. Again we delegate to 'feed' to reinterpret the arguments, this time passing vspline::simdized_type for 'vector'. More...
 
 evaluator (const cf_ele_type *const cf_ebase, const shape_type &cf_estride, int spline_degree, derivative_spec_type derivative=derivative_spec_type(0))
 class evaluator's constructors are used to initialize 'inner'. This first constructor overload will rarely be used by calling code; the commonly used overload is the next one down taking a vspline::bspline object. we create the 'multi_bf_type' object here in the c'tor, and pass it on to inner's c'tor. This way we can declare the copy in inner_evaluator const. Earlier versions of this code did pass the derivative specification through to inner_evaluator, but with the generalization to process arbitrary basis functions, this does not make sense anymore, so now the multi_bf_type is built and passed here. More...
 
 evaluator (const cf_ele_type *const cf_ebase, const shape_type &cf_estride, int spline_degree, const mbf_type &mbf)
 This c'tor overload takes a const reference to a multi_bf_type object providing the basis functions. More...
 
 evaluator (const vspline::bspline< cf_type, dimension > &bspl, derivative_spec_type derivative=derivative_spec_type(0), int shift=0)
 constructor taking a vspline::bspline object, and, optionally, a specification for derivatives of the spline and 'shift'. derivative: pass values other than zero here for an axis for which you want the derivative. Note that passing non-zero values for several axes at the same time will likely not give you the result you intend: The evaluation proceeds from the highest dimension to the lowest (z..y..x), obtaining the weights for the given axis by calling the basis_functor assigned to that axis. If any of these basis_functor objects provides weights to calculate a derivative, subsequent processing for another axis with a basis_functor yielding weights for derivatives would calculate the derivative of the derivative, which is not what you would normally want. So for multidimensional data, use a derivative specification only for one axis. If necessary, calculate several derivatives separately (each with their own evaluator), then multiply. See gsm.cc for an example. More...
 
 evaluator (const vspline::bspline< cf_type, dimension > &bspl, const mbf_type &mbf, int shift=0)
 This c'tor overload takes a const reference to a multi_bf_type object providing the basis functions. More...
 
- Public Member Functions inherited from vspline::callable< evaluator< _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size, -1, default_math_type< _coordinate_type, _trg_type >, _trg_type, multi_bf_type< basis_functor< default_math_type< _coordinate_type, _trg_type > >, vigra::ExpandElementResult< _coordinate_type > ::size > >, _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size >
_trg_type operator() (const _coordinate_type &in) const
 
_trg_type operator() (const _coordinate_type &in)
 
cl_out_v operator() (const cl_in_v &in) const
 
cl_out_v operator() (const cl_in_v &in)
 

Public Attributes

const inner_type inner
 

Additional Inherited Members

- Static Public Attributes inherited from vspline::unary_functor< _coordinate_type, _trg_type, vspline::vector_traits< _trg_type > ::size >
static const bool has_capped_eval
 

Detailed Description

template<typename _coordinate_type, typename _trg_type, size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
class vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >

class evaluator encodes evaluation of a spline-like object. This is a generalization of b-spline evaluation, which is the default if no other basis functions are specified. Technically, a vspline::evaluator is a vspline::unary_functor, which has the specific capability of evaluating a specific spline-like object. This makes it a candidate to be passed to the functions in transform.h, like remap() and transform(), and it also makes it suitable for vspline's functional constructs like chaining, mapping, etc.

While creating and using vspline::evaluators is simple enough, especially from vspline::bspline objects, there are also factory functions producing objects capable of evaluating a b-spline. These objects are wrappers around a vspline::evaluator, please see the factory functions make_evaluator() and make_safe_evaluator() at the end of this file.

If you don't want to concern yourself with the details, the easiest way is to have a bspline object handy and use one of the factory functions, assigning the resulting functor to an auto variable:

// given a vspline::bspline object 'bspl' // create an object (a functor) which can evaluate the spline auto ev = vspline::make_safe_evaluator ( bspl ) ; // which can be used like this: auto value = ev ( real_coordinate ) ;

The evaluation relies on 'braced' coefficients, as they are provided by a vspline::bspline object. While the most general constructor will accept a raw pointer to coefficients (enclosed in the necessary 'brace'), this will rarely be used, and an evaluator will be constructed from a bspline object. To create an evaluator directly, the specific type of evaluator has to be established by providing the relevant template arguments. We need at least two types: the 'coordinate type' and the 'value type':

you can choose the data type which is used internally to do computations. per default, this will be a real type 'appropriate' to the operation, but you're free to pick some other type. Note that picking integer types for the purpose is not allowed. The relevant template argument is 'math_ele_type'.

Note that class evaluator operates with 'native' spline coordinates, which run with the coefficient array's core shape, so typically from 0 to M-1 for a 1D spline over M values. Access with different coordinates is most easily done by 'chaining' class evaluator objects to other vspline::unary_functor objects providing coordinate translation, see unary_functor.h, map.h and domain.h.

The 'native' coordinates can be thought of as an extension of the discrete coordinates used to index the spline's knot points. Let's assume you have a 1D spline over knot points in an array 'a'. While you can index 'a' with discrete coordinates like 0, 1, 2... you can evaluate the spline at real coordinates like 0.0, 1.5, 7.8. If a real coordinate has no fractional part, evaluation of the spline at this coordinate will produce the knot point value at the index which is equal to the real coordinate, so the interpolation criterion is fulfilled. vspline does not (currently) provide code for non-uniform splines. For such splines, the control points are not unit-spaced, and possibly also not equally spaced. To evaluate such splines, it's necessary to perform a binary search in the control point vector to locate the interval containing the coordinate in question, subtract the interval's left hand side, then divide by the interval's length. This value constitutes the 'fractional part' or 'delta' used for evaluation, while the interval's ordinal number yields the integral part. Evaluation can then proceed as for uniform splines. A popular subtype of such non-uniform splines are NURBS (non-uniform rational b-splines), which have the constraints that they map a k-D manifold to a k+1-D space, apply weights to the control points and allow coinciding control points. At the core of a NURBS evaluation there is the same evaluation of a uniform spline, but all the operations going on around that are considerable - especially the binary search to locate the correct knot point interval (with it's many conditionals and memory accesses) is very time-consuming.

While the template arguments specify coordinate and value type for unvectorized operation, the types for vectorized operation are inferred from them, using vspline's vector_traits mechanism. The width of SIMD vectors to be used can be chosen explicitly. This is not mandatory - if omitted, a default value is picked.

With the evaluator's type established, an evaluator of this type can be constructed by passing a vspline::bspline object to it's constructor. Usually, the bspline object will contain data of the same value type, and the spline has to have the same number of dimensions as the coordinate type. Alternatively, coefficients can be passed in as a pointer into a field of suitably braced coefficients. It's okay for the spline to hold coefficients of a different type: they will be cast to math_type during the evaluation.

I have already hinted at the evaluation process used, but here it is again in a nutshell: The coordinate at which the spline is to be evaluated is split into it's integral part and a remaining fraction. The integral part defines the location where a window from the coefficient array is taken, and the fractional part defines the weights to use in calculating a weighted sum over this window. This weighted sum represents the result of the evaluation. Coordinate splitting is done with the method split(), which picks the appropriate variant (different code is used for odd and even splines)

The generation of the weights to be applied to the window of coefficients is performed by employing weight functors from basis.h. What's left to do is to bring all the components together, which happens in class inner_evaluator. The workhorse code in the subclass _eval takes care of performing the necessary operations recursively over the dimensions of the spline.

a vspline::evaluator is technically a vspline::unary_functor. This way, it can be directly used by constructs like vspline::chain and has a consistent interface which allows code using evaluators to query it's specifics. Since evaluation uses no conditionals on the data path, the whole process can be formulated as a set of templated member functions using vectorized types or unvectorized types, so the code itself is vector-agnostic. This makes for a nicely compact body of code inside class inner_evaluator, at the cost of having to provide a bit of collateral code to make data access syntactically uniform, which is done with inner_evaluator's 'load' method.

The evaluation strategy is to have all dependencies of the evaluation except for the actual coordinates taken care of by the constructor - and immutable for the evaluator's lifetime. The resulting object has no state which is modified after construction, making it thread-safe. It also constitutes a 'pure' functor in a functional-programming sense, because it has no mutable state and no side-effects, as can be seen by the fact that the 'eval' methods are all marked const.

By providing the evaluation in this way, it becomes easy for calling code to integrate the evaluation into more complex functors. Consider, for example, code which generates coordinates with a functor, then evaluates a b-spline at these coordinates, and finally subjects the resultant values to some postprocessing. All these processing steps can be bound into a single functor, and the calling code can be reduced to polling this functor until it has provided the desired number of output values. vspline has a large body of code to this effect: the family of 'transform' functions. These functions accept functors and 'wield' them over arrays of data. The functors may be of class evaluator, but it's much nicer to have a generalized function which can use any functor with the right signature, because it widens the scope of the transform faimily to deal with any functor producing an m-dimensional output from an n-dimensional input. vspline's companion program, pv, uses this method to create complex pixel pipelines by 'chaining' functors, and then, finally, uses functions from vspline's transform family to 'roll out' the pixel pipeline code over large arrays of data.

An aside: vspline::unary_functor, from which class evaluator inherits, provides convenience code to use unary_functor objects with 'normal' function syntax. So if you have an evaluator e, you can write code like y = e ( x ), which is equivalent to the notation I tend to use: e ( x , y ) - this two-argument form, where the first argumemt is a const reference to the input and the second one a reference to the output has some technical advantages (easier ATD).

While the 'unspecialized' evaluator will try and do 'the right thing' by using general purpose code fit for all eventualities, for time-critical operation there are specializations which can be used to make the code faster:

Note how the default number of vector elements is fixed by picking the value which vspline::vector_traits considers appropriate. There should rarely be a need to choose a different number of vector elements: evaluation will often be the most computationally intensive part of a processing chain, and therefore this choice is sensible. But it's not mandatory. Just keep in mind that when building processing pipelines with vspline, all their elements must use the same vectorization width. When you leave it to the defaults to set 'vsize', you may get functors which differ in vsize, and when you try to chain them, the code won't compile. So keep this in mind: When building complex functors, pass an explicit value for vsize to all component functors.

So here are the template arguments to class evaluator again, where the first two are mandatory, while the remainder have defaults:

Definition at line 1708 of file eval.h.

Member Typedef Documentation

◆ base_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef unary_functor< coordinate_type , trg_type , vsize > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::base_type

Definition at line 1750 of file eval.h.

◆ cf_ele_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef ET< cf_type > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::cf_ele_type

Definition at line 1739 of file eval.h.

◆ cf_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef _cf_type vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::cf_type

Definition at line 1725 of file eval.h.

◆ coordinate_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef _coordinate_type vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::coordinate_type

Definition at line 1724 of file eval.h.

◆ derivative_spec_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef vigra::TinyVector< int , dimension > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::derivative_spec_type

Definition at line 1845 of file eval.h.

◆ ic_ele_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef int vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::ic_ele_type

Definition at line 1735 of file eval.h.

◆ inner_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef detail::inner_evaluator< ic_ele_type , rc_ele_type , ofs_ele_type , cf_ele_type , math_ele_type , trg_ele_type , dimension , channels , specialize , mbf_type > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::inner_type

Definition at line 1771 of file eval.h.

◆ math_ele_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef _math_ele_type vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::math_ele_type

Definition at line 1726 of file eval.h.

◆ mbf_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef _mbf_type vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::mbf_type

Definition at line 1728 of file eval.h.

◆ ofs_ele_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef int vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::ofs_ele_type

Definition at line 1736 of file eval.h.

◆ rc_ele_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef ET< coordinate_type > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::rc_ele_type

Definition at line 1738 of file eval.h.

◆ shape_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef vigra::TinyVector< std::ptrdiff_t , dimension > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::shape_type

Definition at line 1844 of file eval.h.

◆ trg_ele_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef ET< trg_type > vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::trg_ele_type

Definition at line 1740 of file eval.h.

◆ trg_type

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
typedef _trg_type vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::trg_type

Definition at line 1727 of file eval.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
anonymous enum
Enumerator
level 

Definition at line 1753 of file eval.h.

◆ anonymous enum

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
anonymous enum
Enumerator
channels 

Definition at line 1754 of file eval.h.

◆ anonymous enum

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
anonymous enum
Enumerator
specialize 

Definition at line 1755 of file eval.h.

◆ anonymous enum

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
anonymous enum
Enumerator
vsize 

Definition at line 1742 of file eval.h.

◆ anonymous enum

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
anonymous enum
Enumerator
dimension 

Definition at line 1752 of file eval.h.

Constructor & Destructor Documentation

◆ evaluator() [1/4]

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::evaluator ( const cf_ele_type *const  cf_ebase,
const shape_type cf_estride,
int  spline_degree,
derivative_spec_type  derivative = derivative_spec_type ( 0 ) 
)
inline

class evaluator's constructors are used to initialize 'inner'. This first constructor overload will rarely be used by calling code; the commonly used overload is the next one down taking a vspline::bspline object. we create the 'multi_bf_type' object here in the c'tor, and pass it on to inner's c'tor. This way we can declare the copy in inner_evaluator const. Earlier versions of this code did pass the derivative specification through to inner_evaluator, but with the generalization to process arbitrary basis functions, this does not make sense anymore, so now the multi_bf_type is built and passed here.

Definition at line 1859 of file eval.h.

◆ evaluator() [2/4]

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::evaluator ( const cf_ele_type *const  cf_ebase,
const shape_type cf_estride,
int  spline_degree,
const mbf_type mbf 
)
inline

This c'tor overload takes a const reference to a multi_bf_type object providing the basis functions.

Definition at line 1875 of file eval.h.

◆ evaluator() [3/4]

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::evaluator ( const vspline::bspline< cf_type, dimension > &  bspl,
derivative_spec_type  derivative = derivative_spec_type ( 0 ),
int  shift = 0 
)
inline

constructor taking a vspline::bspline object, and, optionally, a specification for derivatives of the spline and 'shift'. derivative: pass values other than zero here for an axis for which you want the derivative. Note that passing non-zero values for several axes at the same time will likely not give you the result you intend: The evaluation proceeds from the highest dimension to the lowest (z..y..x), obtaining the weights for the given axis by calling the basis_functor assigned to that axis. If any of these basis_functor objects provides weights to calculate a derivative, subsequent processing for another axis with a basis_functor yielding weights for derivatives would calculate the derivative of the derivative, which is not what you would normally want. So for multidimensional data, use a derivative specification only for one axis. If necessary, calculate several derivatives separately (each with their own evaluator), then multiply. See gsm.cc for an example.

Definition at line 1901 of file eval.h.

◆ evaluator() [4/4]

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::evaluator ( const vspline::bspline< cf_type, dimension > &  bspl,
const mbf_type mbf,
int  shift = 0 
)
inline

This c'tor overload takes a const reference to a multi_bf_type object providing the basis functions.

Definition at line 1924 of file eval.h.

Member Function Documentation

◆ eval() [1/2]

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
void vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::eval ( const typename base_type::in_type _coordinate,
typename base_type::out_type _result 
) const
inline

unvectorized evaluation function. this is delegated to 'feed' above, which reinterprets the arguments as the 'synthetic' types used by class inner_evaluator.

Definition at line 1822 of file eval.h.

◆ eval() [2/2]

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
template<typename = std::enable_if < ( vsize > 1 ) >>
void vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::eval ( const typename base_type::in_v _coordinate,
typename base_type::out_v _result 
) const
inline

vectorized evaluation function. This is enabled only if vsize > 1 to guard against cases where vsize is 1. Without the enable_if, we'd end up with two overloads with the same signature if vsize is 1. Again we delegate to 'feed' to reinterpret the arguments, this time passing vspline::simdized_type for 'vector'.

Definition at line 1837 of file eval.h.

Member Data Documentation

◆ inner

template<typename _coordinate_type , typename _trg_type , size_t _vsize = vspline::vector_traits < _trg_type > :: size, int _specialize = -1, typename _math_ele_type = default_math_type < _coordinate_type , _trg_type >, typename _cf_type = _trg_type, typename _mbf_type = multi_bf_type < basis_functor < _math_ele_type > , vigra::ExpandElementResult < _coordinate_type > :: size >>
const inner_type vspline::evaluator< _coordinate_type, _trg_type, _vsize, _specialize, _math_ele_type, _cf_type, _mbf_type >::inner

Definition at line 1778 of file eval.h.


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