12 namespace ACDCGenerator {
27 template <
typename FncPtr>
46 template <
typename Rnd>
52 static inline double rnd(Rnd * r) {
return r->flat(); }
57 static inline double rnd(Rnd * r,
double xl,
double xu) {
58 return xl + (xu - xl)*
rnd(r);
72 template <
typename InputIterator,
typename OutputIterator>
73 static inline void rnd(Rnd * r, InputIterator l, InputIterator lend,
74 InputIterator u, OutputIterator res) {
75 for ( ; l != lend; ++l ) *res++ = *l + (*u++ - *l)*
rnd(r);
82 template <
typename OutputIterator>
83 static inline void rnd(Rnd * r,
int D, OutputIterator res) {
84 for (
int d = 0; d < D; ++d ) *res++ =
rnd(r);
90 static inline bool rndBool(Rnd * r,
double x) {
return rnd(r) < x; }
95 static inline bool rndBool(Rnd * r,
double x,
double y) {
101 static inline long rndInt(Rnd * r,
long x) {
102 return long(
rnd(r, 0.0,
double(x)));