32 #ifndef SHARK_RNG_WEIBULL_H 33 #define SHARK_RNG_WEIBULL_H 39 #include <boost/random.hpp> 40 #include <boost/random/uniform_01.hpp> 46 template<
class RealType =
double>
50 typedef RealType input_type;
51 typedef RealType result_type;
54 :alpha_(alpha),beta_(beta)
68 template<
class Engine>
71 double uni = boost::uniform_01<RealType>()(eng);
72 return std::pow(-beta_ * std::log(1. - uni), 1 / alpha_);
75 template<
class CharT,
class Traits>
76 friend std::basic_ostream<CharT,Traits>&
84 template<
class CharT,
class Traits>
85 friend std::basic_istream<CharT,Traits>&
98 template<
typename RngType = shark::DefaultRngType>
99 class Weibull:
public boost::variate_generator<RngType*,Weibull_distribution<> >
102 typedef boost::variate_generator<RngType*,Weibull_distribution<> > Base;
109 using Base::operator();
114 return dist(Base::engine());
119 return Base::distribution().alpha();
123 return Base::distribution().beta();
134 double p(
double x)
const