32 #ifndef SHARK_RNG_UNIFORM_H 33 #define SHARK_RNG_UNIFORM_H 38 #include <boost/random.hpp> 45 template<
typename RngType = DefaultRngType>
49 public boost::variate_generator<RngType*,boost::uniform_real<> >
53 typedef boost::variate_generator<RngType*,boost::uniform_real<> > Base;
64 Uniform( RngType & rng,
double low_ = 0.,
double high_ = 1. )
71 using Base::operator();
80 if(low_ == high_)
return low_;
82 return dist(Base::engine());
90 return Base::distribution().min();
98 return Base::distribution().max();
109 Base::distribution()=dist;
116 double p(
double x)
const {
122 template<
class RngType>
123 double uni(RngType& rng,
double lower,
double upper){
130 #endif // SHARK_RNG_UNIFORM_H