19 #include <../config.h> 20 #ifdef __RNGWRAPPER_BOOST__ // BOOST RANDOM LIBRARY 23 #include <boost/random/mersenne_twister.hpp> 24 #include <boost/random/variate_generator.hpp> 25 #include <boost/random/normal_distribution.hpp> 26 #include <boost/random/uniform_01.hpp> 27 #include <boost/random/uniform_real.hpp> 29 static boost::mt19937 Boost_Rng;
31 static boost::uniform_real<double> Uniform_Distribution;
32 static boost::variate_generator<boost::mt19937&,boost::uniform_real<double> > roll(Boost_Rng,Uniform_Distribution);
34 double BFL::rnorm(
const double& mu,
const double& sigma)
36 boost::normal_distribution<double> TestDist(mu,sigma);
37 boost::variate_generator <boost::mt19937 &,boost::normal_distribution<double> > TestGen(Boost_Rng,TestDist);
46 double BFL::runif(
const double &min,
const double& max)
48 boost::uniform_real<double> Uniform_DistributionMinMax(min,max);
49 boost::variate_generator<boost::mt19937&,boost::uniform_real<double> > roll(Boost_Rng,Uniform_DistributionMinMax);
53 #endif // __RNGWRAPPER_BOOST__ 59 #ifdef __RNGWRAPPER_SCYTHE__ // SCYTHE RANDOM LIBRARY 61 #include <scythestat/rng.h> 62 #include <scythestat/rng/mersenne.h> 63 #include <scythestat/distributions.h> 66 static scythe::mersenne bfl_mersenne;
69 double BFL::rnorm(
const double & mu,
const double & sigma)
71 return (bfl_mersenne.rnorm(mu,sigma));
77 return (bfl_mersenne.runif());
80 double BFL::runif(
const double &min,
const double& max)
82 return (bfl_mersenne.runif()*(max-min)+min);
84 #endif // __RNGWRAPPER_SCYTHE__ 90 #ifdef __RNGWRAPPER_LTI__ // LTILIB 92 #include <ltilib/ltiUniformDist.h> 93 #include <ltilib/ltiGaussDist.h> 96 double BFL::rnorm(
const double & mu,
const double & sigma)
98 lti::gaussianDistribution g(mu,sigma);
104 static lti::uniformDistribution unif;
113 double BFL::runif(
const double &min,
const double& max)
115 lti::uniformDistribution u(min,max);
118 #endif // __RNGWRAPPER_LTI__ double rnorm(const double &mu, const double &sigma)