1 #ifndef _theplu_yat_random_
2 #define _theplu_yat_random_
26 #include "yat/statistics/Histogram.h"
30 #include "yat/utility/boost_exception_ptr.h"
32 #include <boost/concept_check.hpp>
33 #include <boost/thread.hpp>
34 #include <boost/thread/tss.hpp>
36 #include <gsl/gsl_rng.h>
37 #include <gsl/gsl_randist.h>
112 unsigned long max(
void)
const;
118 unsigned long min(
void)
const;
123 std::string
name(
void)
const;
132 const gsl_rng*
rng(
void)
const;
147 void seed(
unsigned long s)
const;
189 RNG& operator=(
const RNG&);
192 void rng_alloc(
void)
const;
194 static RNG* instance_;
197 mutable boost::thread_specific_ptr<gsl_rng> rng_;
198 mutable unsigned long seed_;
200 mutable boost::mutex mutex_;
230 const gsl_rng*
rng(
void)
const;
242 void clone(
const gsl_rng&);
286 void seed(
unsigned long s)
const YAT_DEPRECATE;
382 gsl_ran_discrete_t* gen_;
383 std::vector<double> p_;
400 public std::unary_function<unsigned long, unsigned long>
439 unsigned long operator()(
unsigned long n)
const;
442 unsigned long range_;
468 explicit Poisson(
const double m=1);
481 unsigned long operator()(
const double m)
const;
524 void seed(
unsigned long s)
const YAT_DEPRECATE;
650 explicit Gaussian(
const double s=1,
const double m=0);
671 double operator()(
const double s,
const double m)
const;
687 template<
typename RandomAccessIterator>
690 typedef RandomAccessIterator rai;
691 BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<rai>));
693 std::random_shuffle(first, last, rnd);