32 #ifndef SHARK_RNG_CAUCHY_H 33 #define SHARK_RNG_CAUCHY_H 38 #include <boost/random.hpp> 39 #include <boost/random/cauchy_distribution.hpp> 64 template<
typename RngType = shark::DefaultRngType>
65 class Cauchy:
public boost::variate_generator<RngType*,boost::cauchy_distribution<> >
68 typedef boost::variate_generator<RngType*,boost::cauchy_distribution<> > Base;
83 using Base::operator();
93 boost::cauchy_distribution<> dist(median,sigma);
94 return dist(Base::engine());
100 return Base::distribution().median();
106 return Base::distribution().sigma();
112 Base::distribution()=boost::cauchy_distribution<>(newMedian,
sigma());
118 Base::distribution()=boost::cauchy_distribution<>(
median(),newSigma);
122 double p(
double x)
const {
129 template<
typename RngType>