25#include<gsl/gsl_rng.h>
36 typedef gsl_rng_type
const*
type;
51 static type const cmrg(){
return gsl_rng_cmrg; }
101 static type const mrg(){
return gsl_rng_mrg; }
326 static type const uni(){
return gsl_rng_uni; }
336 static type const vax(){
return gsl_rng_vax; }
346 static type const zuf(){
return gsl_rng_zuf; }
365 explicit rng( gsl_rng_type
const* T ){
368 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
380 explicit rng( gsl_rng* v ){
418#ifdef __GXX_EXPERIMENTAL_CXX0X__
424 std::swap(
count, v.count );
425 v.ccgsl_pointer =
nullptr;
433 rng( std::move( v ) ).swap( *
this );
542#ifdef __GXX_EXPERIMENTAL_CXX0X__
567 void set(
unsigned long int seed )
const { gsl_rng_set(
get(), seed ); }
573 unsigned long int max()
const {
return gsl_rng_max(
get() ); }
578 unsigned long int min()
const {
return gsl_rng_min(
get() ); }
583 char const*
name()
const {
return gsl_rng_name(
get() ); }
589 int fread( FILE* stream ){
return gsl_rng_fread( stream,
get() ); }
595 int fwrite( FILE* stream )
const {
return gsl_rng_fwrite( stream,
get() ); }
600 size_t size()
const {
return gsl_rng_size(
get() ); }
605 void*
state()
const {
return gsl_rng_state(
get() ); }
636 return gsl_rng_uniform_int(
get(),
n ); }
static type const fishman18()
Random number static type.
static type const knuthran()
Random number static type.
static type const borosh13()
Random number static type.
static type const vax()
Random number static type.
gsl_rng * get() const
Get the gsl_rng.
static type const random32_libc5()
Random number static type.
static type const rand()
Random number static type.
static type const random32_glibc2()
Random number static type.
static type const random256_libc5()
Random number static type.
static type const mt19937_1998()
Random number static type.
bool operator<=(rng const &v) const
A container needs to define an ordering for sorting.
double uniform_pos() const
C++ version of gsl_rng_uniform_pos().
size_t size() const
C++ version of gsl_rng_size().
static type const random128_libc5()
Random number static type.
static type const slatec()
Random number static type.
size_t use_count() const
Find how many rng objects share this pointer.
static type const random_glibc2()
Random number static type.
void * state() const
C++ version of gsl_rng_state().
static type const randu()
Random number static type.
rng(gsl_rng *v)
Could construct from a gsl_rng.
static type const zuf()
Random number static type.
bool operator!=(rng const &v) const
Two rng are different equal if their elements are not identical.
static type const fishman2x()
Random number static type.
static type const uni()
Random number static type.
rng clone() const
C++ version of gsl_rng_clone().
static type const ranmar()
Random number static type.
static type const random_bsd()
Random number static type.
rng(gsl_rng_type const *T)
C++ version of gsl_rng_alloc().
static type const taus113()
Random number static type.
static type const lecuyer21()
Random number static type.
void swap(rng &v)
Swap two rng.
int fread(FILE *stream)
C++ version of gsl_rng_fread().
static type const random256_bsd()
Random number static type.
static type const random128_bsd()
Random number static type.
char const * name() const
C++ version of gsl_rng_name().
gsl_rng * ccgsl_pointer
The shared pointer.
unsigned long int min() const
C++ version of gsl_rng_min().
static type const random32_bsd()
Random number static type.
static type const ran0()
Random number static type.
rng & operator=(rng &&v)
Move operator.
unsigned long int get_value() const
C++ version of gsl_rng_get().
static type const cmrg()
Random number static type.
static type const ranlxs2()
Random number static type.
unsigned long int uniform_int(unsigned long int n) const
C++ version of gsl_rng_uniform_int().
bool operator<(rng const &v) const
A container needs to define an ordering for sorting.
static type const mrg()
Random number static type.
static type env_setup()
C++ version of gsl_rng_env_setup().
bool operator==(rng const &v) const
Two rng are identically equal if their elements are identical.
static type const ran1()
Random number static type.
static type const uni32()
Random number static type.
static type const random128_glibc2()
Random number static type.
static type const ranlxs1()
Random number static type.
static type const waterman14()
Random number static type.
static type const mt19937()
Random number static type.
static type const ran2()
Random number static type.
bool unique() const
Find if this is the only object sharing the gsl_rng.
static type const taus()
Random number static type.
static type const knuthran2()
Random number static type.
unsigned long int max() const
C++ version of gsl_rng_max().
static type const Default()
Random number static type.
static type const rand48()
Random number static type.
static type const ranlxd2()
Random number static type.
double uniform() const
C++ version of gsl_rng_uniform().
static type const r250()
Random number static type.
static type const random64_libc5()
Random number static type.
bool empty() const
Find if the rng is empty.
static type const transputer()
Random number static type.
static type const ranlxs0()
Random number static type.
rng()
The default constructor is only really useful for assigning to.
static type const random8_bsd()
Random number static type.
size_t * count
The shared reference count.
static type const random8_glibc2()
Random number static type.
bool operator>(rng const &v) const
A container needs to define an ordering for sorting.
void print_state() const
C++ version of gsl_rng_print_state().
static type const gfsr4()
Random number static type.
static type const random8_libc5()
Random number static type.
rng(rng &&v)
Move constructor.
static type const ranf()
Random number static type.
static type const random64_bsd()
Random number static type.
static type const fishman20()
Random number static type.
rng(rng const &v)
The copy constructor.
static type const knuthran2002()
Random number static type.
static type const ranlux389()
Random number static type.
static type const random256_glibc2()
Random number static type.
static type * types_setup()
C++ version of gsl_rng_types_setup().
static type const tt800()
Random number static type.
~rng()
The destructor only deletes the pointers if count reaches zero.
static type const coveyou()
Random number static type.
static type const ran3()
Random number static type.
void set(unsigned long int seed) const
C++ version of gsl_rng_set().
static type const random_libc5()
Random number static type.
static type const ranlxd1()
Random number static type.
static type const ranlux()
Random number static type.
static type const taus2()
Random number static type.
bool operator>=(rng const &v) const
A container needs to define an ordering for sorting.
static type const minstd()
Random number static type.
static type const mt19937_1999()
Random number static type.
rng & operator=(rng const &v)
The assignment operator.
int memcpy(rng const &src)
C++ version of gsl_rng_memcpy().
static type const random64_glibc2()
Random number static type.
gsl_rng_type const * type
Define gsl::rng::static type.
int fwrite(FILE *stream) const
C++ version of gsl_rng_fwrite().
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
The gsl package creates an interface to the GNU Scientific Library for C++.