57int main (
int argc ,
char * argv[] )
66 shape_type core_shape = { 35 , 43 , 19 } ;
80 view_type core = bspl.
core ;
84 for (
int d = 0 ; d < bspl.
dimension ; d++ )
86 for (
int c = 0 ; c < core_shape[d] ; c++ )
87 core.bindAt ( d , c ) += c ;
104 typedef typename evaluator_type::derivative_spec_type deriv_t ;
105 deriv_t dsx , dsy ,
dsz ;
113 evaluator_type ev ( bspl ) ;
117 evaluator_type ev_dx ( bspl , dsx ) ;
118 evaluator_type ev_dy ( bspl , dsy ) ;
119 evaluator_type ev_dz ( bspl ,
dsz ) ;
123 std::random_device rd;
124 std::mt19937 gen(rd());
137 for (
int times = 0 ; times < 100 ; times++ )
139 for (
int d = 0 ; d < bspl.
dimension ; d++ )
140 c[d] = ( core_shape[d] - 1 ) * std::generate_canonical<double, 20>(gen) ;
142 ev.eval ( c , result ) ;
143 double delta = result - sum ( c ) ;
145 std::cout <<
"eval(" << c <<
") = " << result
146 <<
" -> delta = " << delta << std::endl ;
148 ev_dx.eval ( c , result ) ;
149 std::cout <<
"dx: " << result ;
151 ev_dy.eval ( c , result ) ;
152 std::cout <<
" dy: " << result ;
154 ev_dz.eval ( c , result ) ;
155 std::cout <<
" dz: " << result << std::endl ;
vigra::TinyVector< float, 2 > coordinate_type
vspline::bspline< pixel_type, 2 > spline_type
class evaluator encodes evaluation of a spline-like object. This is a generalization of b-spline eval...
int main(int argc, char *argv[])
vigra::TinyVector< vspline::bc_code, dimension > bcv_type
a type for a set of boundary condition codes, one per axis
class bspline now builds on class bspline_base, adding coefficient storage, while bspline_base provid...
vigra::TinyVector< std::ptrdiff_t, dimension > shape_type
type of a multidimensional index type
void prefilter(vspline::xlf_type boost=vspline::xlf_type(1), int njobs=vspline::default_njobs)
prefilter converts the knot point data in the 'core' area into b-spline coefficients....
vigra::TinyVector< bc_code, dimension > bcv_type
nD type for one boundary condition per axis
vigra::MultiArrayView< dimension, value_type > view_type
data are read and written to vigra MultiArrayViews:
includes all headers from vspline (most of them indirectly)