NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Private Attributes | List of all members
librandom::GSL_BinomialRandomDev Class Reference

Class GSL_BinomialRandomDev. More...

#include <gsl_binomial_randomdev.h>

Inheritance diagram for librandom::GSL_BinomialRandomDev:
librandom::RandomDev

Public Member Functions

 GSL_BinomialRandomDev (RngPtr, double p_s=0.5, unsigned int n_s=1)
 
 GSL_BinomialRandomDev (double p_s=0.5, unsigned int n_s=1)
 
void set_p_n (double, unsigned int)
 set parameters for p and n p - success probability for single trial n - number of trials More...
 
void set_p (double)
 set p More...
 
void set_n (unsigned int)
 set n More...
 
long ldev ()
 draw integer More...
 
long ldev (RngPtr) const
 draw integer, threaded More...
 
bool has_ldev () const
 true if RDG implements ldev function More...
 
double operator() (RngPtr) const
 return as double, threaded More...
 
void set_status (const DictionaryDatum &)
 set distribution parameters from SLI dict More...
 
void get_status (DictionaryDatum &) const
 get distribution parameters from SLI dict More...
 
- Public Member Functions inherited from librandom::RandomDev
 RandomDev (RngPtr rng=RngPtr(0))
 Construct with (single-threaded) or without (multithreaded) RNG. More...
 
virtual ~RandomDev ()
 ensure proper clean-up More...
 
virtual double operator() (void)
 Operator delivering doubles. More...
 
void set_rng (RngPtr rng)
 set RNG More...
 

Private Attributes

double p_
 probability p of binomial distribution More...
 
unsigned int n_
 parameter n in binomial distribution More...
 
gsl_rng * rng_
 

Additional Inherited Members

- Protected Attributes inherited from librandom::RandomDev
RngPtr rng_
 store underlying RNG More...
 

Detailed Description

Class GSL_BinomialRandomDev.

Generates an RNG which returns Binomial(k;p;n) distributed random numbers out of an RNG which returns binomially distributed random numbers:

p(k) = (n! / k!(n-k)!) p^k (1-p)^(n-k) , 0<=k<=n, n<0

Arguments:

See also
http://www.gnu.org/software/gsl/manual/html_node/The-Binomial-Distribution.html

Constructor & Destructor Documentation

librandom::GSL_BinomialRandomDev::GSL_BinomialRandomDev ( RngPtr  r_s,
double  p_s = 0.5,
unsigned int  n_s = 1 
)
librandom::GSL_BinomialRandomDev::GSL_BinomialRandomDev ( double  p_s = 0.5,
unsigned int  n_s = 1 
)

Member Function Documentation

void librandom::GSL_BinomialRandomDev::get_status ( DictionaryDatum d) const
virtual

get distribution parameters from SLI dict

Implements librandom::RandomDev.

References nest::names::d.

bool librandom::GSL_BinomialRandomDev::has_ldev ( ) const
inlinevirtual

true if RDG implements ldev function

Reimplemented from librandom::RandomDev.

long librandom::GSL_BinomialRandomDev::ldev ( void  )
virtual

draw integer

Reimplemented from librandom::RandomDev.

Referenced by operator()().

long librandom::GSL_BinomialRandomDev::ldev ( RngPtr  rng) const
virtual

draw integer, threaded

Reimplemented from librandom::RandomDev.

References librandom::GslRandomGen::rng_.

double librandom::GSL_BinomialRandomDev::operator() ( RngPtr  rthrd) const
inlinevirtual

return as double, threaded

Implements librandom::RandomDev.

References ldev().

void librandom::GSL_BinomialRandomDev::set_n ( unsigned int  n_s)

set n

void librandom::GSL_BinomialRandomDev::set_p ( double  p_s)

set p

References assert().

void librandom::GSL_BinomialRandomDev::set_p_n ( double  p_s,
unsigned  int 
)

set parameters for p and n p - success probability for single trial n - number of trials

void librandom::GSL_BinomialRandomDev::set_status ( const DictionaryDatum d)
virtual

set distribution parameters from SLI dict

Implements librandom::RandomDev.

References nest::names::d, and nest::names::max.

Member Data Documentation

unsigned int librandom::GSL_BinomialRandomDev::n_
private

parameter n in binomial distribution

double librandom::GSL_BinomialRandomDev::p_
private

probability p of binomial distribution

gsl_rng* librandom::GSL_BinomialRandomDev::rng_
private

Referenced by GSL_BinomialRandomDev().


The documentation for this class was generated from the following files: