56template <
class gate_type >
59 std::cout << mode << std::endl ;
61 auto tester = vspline::mapper < typename gate_type::in_type > ( gx ) ;
63 typedef double crd_type ;
65 const crd_type crd { x } ;
68 tester.eval ( crd , res ) ;
70 std::cout <<
"single-value operation:" << std::endl ;
72 std::cout << crd <<
" -> " << res << std::endl ;
81 tester.eval ( inv , resv ) ;
82 std::cout <<
"vectorized operation:" << std::endl
83 << inv <<
" -> " << resv << std::endl ;
87int main (
int argc ,
char * argv[] )
91 std::cout << std::fixed << std::showpos << std::showpoint
92 << std::setprecision(5);
94 while ( std::cin.good() )
96 std::cout <<
"enter coordinate to map to [ 0.0 : 1.0 ]" << std::endl ;
101 std::cout << std::endl ;
112 std::cout <<
"exception out_of_bounds" << std::endl ;
vspline::vector_traits< coordinate_type >::type crd_v
code to handle out-of-bounds coordinates.
vspline::reject_gate< rc_type, _vsize > reject(rc_type lower, rc_type upper)
factory function to create a reject_gate type functor given a lower and upper limit for the allowed r...
vspline::periodic_gate< rc_type, _vsize > periodic(rc_type lower, rc_type upper)
factory function to create a periodic_gate type functor given a lower and upper limit for the allowed...
vspline::clamp_gate< rc_type, _vsize > clamp(rc_type lower, rc_type upper, rc_type lfix, rc_type rfix)
factory function to create a clamp_gate type functor given a lower and upper limit for the allowed ra...
vspline::mirror_gate< rc_type, _vsize > mirror(rc_type lower, rc_type upper)
factory function to create a mirror_gate type functor given a lower and upper limit for the allowed r...
mirror gate 'folds' coordinates into the range. From the infinite number of mirror images resulting f...
out_of_bounds is thrown by mapping mode REJECT for out-of-bounds coordinates this exception is left w...
with the definition of 'simd_traits', we can proceed to implement 'vector_traits': struct vector_trai...
void test(gate_type gx, double x, const char *mode)
int main(int argc, char *argv[])