102template <
class ev_type >
109 ev.
eval ( in , out ) ;
112int main (
int argc ,
char * argv[] )
117 TIMES = std::atoi ( argv[1] ) ;
121 std::cout <<
"enter spline degree: " ;
123 std::cin >> spline_degree ;
128 while ( bci < 1 || bci > 4 )
130 std::cout <<
"choose boundary condition" << std::endl ;
131 std::cout <<
"1) MIRROR" << std::endl ;
132 std::cout <<
"2) PERIODIC" << std::endl ;
133 std::cout <<
"3) REFLECT" << std::endl ;
134 std::cout <<
"4) NATURAL" << std::endl ;
157 std::vector<dtype> dv ;
158 std::cout <<
"enter knot point values (end with single '.')" << std::endl ;
159 while ( std::cin >> v )
168 spline_type bsp ( dv.size() , spline_degree , bc ) ;
170 std::cout <<
"created bspline object:" << std::endl << bsp << std::endl ;
174 for (
size_t i = 0 ; i < dv.size() ; i++ )
175 bsp.
core[i] = dv[i] ;
181 std::cout << std::fixed << std::showpoint << std::setprecision(12) ;
182 std::cout <<
"spline coefficients (with frame)" << std::endl ;
184 std::cout <<
" " << coeff << std::endl ;
191 auto iev = iev_t ( bsp ) ;
197 std::cout <<
"enter coordinates to evaluate (end with EOF)"
199 while ( std::cin >> rc )
203 std::cout <<
"warning: " << rc
204 <<
" is outside the spline's defined range."
206 std::cout <<
"using automatic folding to process this value."
212 ev.eval ( rc , res ) ;
214 std::cout << rc <<
" -> " << res << std::endl ;
218 std::chrono::system_clock::time_point start
219 = std::chrono::system_clock::now() ;
231 std::function < void() > payload =
236 std::chrono::system_clock::time_point end
237 = std::chrono::system_clock::now() ;
239 std::cout << TIMES <<
" evaluations took "
240 << std::chrono::duration_cast<std::chrono::milliseconds>
241 ( end - start ) . count()
242 <<
" ms" << std::endl ;
vspline::bspline< pixel_type, 2 > spline_type
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...
int main(int argc, char *argv[])
void speed_test(ev_type &ev, std::size_t nr_ev)
int multithread(std::function< void() > payload, std::size_t nr_workers=default_njobs)
multithread uses a thread pool of worker threads to perform a multithreaded operation....
vspline::grok_type< bspl_coordinate_type< spline_type, rc_type >, result_type, _vsize > make_safe_evaluator(const spline_type &bspl, vigra::TinyVector< int, spline_type::dimension > dspec=vigra::TinyVector< int, spline_type::dimension >(0), int shift=0)
make_safe_evaluator is a factory function, producing a functor which provides safe access to an evalu...
bc_code
This enumeration is used for codes connected to boundary conditions. There are two aspects to boundar...
class bspline now builds on class bspline_base, adding coefficient storage, while bspline_base provid...
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....
static xlf_type lower_limit(const bc_code &bc)
lower_limit returns the lower bound of the spline's defined range. This is usually 0....
static xlf_type upper_limit(const std::size_t &extent, const bc_code &bc)
upper_limit returns the upper bound of the spline's defined range. This is normally M - 1 if the shap...
vector_traits< coordinate_type, vsize >::type in_v
vectorized in_type and out_type. vspline::vector_traits supplies these types so that multidimensional...
vector_traits< float, vsize >::type out_v
with the definition of 'simd_traits', we can proceed to implement 'vector_traits': struct vector_trai...
includes all headers from vspline (most of them indirectly)