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

Class PoissonRandomDev Create Poisson distributed random numbers. More...

#include <poisson_randomdev.h>

Inheritance diagram for librandom::PoissonRandomDev:
librandom::RandomDev

Public Member Functions

 PoissonRandomDev (RngPtr, double lambda=0.0)
 
 PoissonRandomDev (double lambda=0.0)
 
void set_lambda (double)
 
void set_status (const DictionaryDatum &)
 set distribution parameters from SLI dict More...
 
void get_status (DictionaryDatum &) const
 get distribution parameters from SLI dict 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...
 
- 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...
 
virtual long ldev (void)
 integer valued functions for discrete distributions More...
 
void set_rng (RngPtr rng)
 set RNG More...
 

Private Member Functions

void init_ ()
 re-compute internal parameters More...
 
void proc_f_ (const unsigned k, double &px, double &py, double &fx, double &fy) const
 Procedure F from Ahrens & Dieter. More...
 

Private Attributes

RngPtr r
 
double mu_
 Poisson parameter, aka lambda. More...
 
double s_
 sqrt(mu_) More...
 
double d_
 6 mu_^2 More...
 
unsigned long L_
 floor(mu-1.1484) More...
 
double c_
 0.1069 / mu_ More...
 
double om_
 
double c0_
 
double c1_
 
double c2_
 
double c3_
 
std::vector< double > P_
 PoissonCDF. More...
 

Static Private Attributes

static const unsigned n_tab_ = 46
 tabulate P_0 ... P_{n_tab_-1} More...
 
static const unsigned fact_ []
 array of factorials 0! .. 10! More...
 
static const double a_ []
 array of a_i coeffs More...
 
static const unsigned n_a_ = 10
 length of array More...
 

Additional Inherited Members

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

Detailed Description

Class PoissonRandomDev Create Poisson distributed random numbers.

Constructor & Destructor Documentation

librandom::PoissonRandomDev::PoissonRandomDev ( RngPtr  r_source,
double  lambda = 0.0 
)

References init_().

librandom::PoissonRandomDev::PoissonRandomDev ( double  lambda = 0.0)

References init_().

Member Function Documentation

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

get distribution parameters from SLI dict

Implements librandom::RandomDev.

References nest::names::d.

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

true if RDG implements ldev function

Reimplemented from librandom::RandomDev.

void librandom::PoissonRandomDev::init_ ( )
private

re-compute internal parameters

References assert(), nest::names::min, nest::names::p, and numerics::pi.

Referenced by PoissonRandomDev().

long librandom::PoissonRandomDev::ldev ( RngPtr  r) const
virtual

draw integer, threaded

Reimplemented from librandom::RandomDev.

References assert(), and lockPTR< D >::valid().

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

return as double, threaded

Implements librandom::RandomDev.

References librandom::RandomDev::ldev().

void librandom::PoissonRandomDev::proc_f_ ( const unsigned  k,
double &  px,
double &  py,
double &  fx,
double &  fy 
) const
private

Procedure F from Ahrens & Dieter.

References numerics::pi.

void librandom::PoissonRandomDev::set_lambda ( double  lambda)
void librandom::PoissonRandomDev::set_status ( const DictionaryDatum d)
virtual

set distribution parameters from SLI dict

Implements librandom::RandomDev.

References nest::names::max.

Member Data Documentation

const double librandom::PoissonRandomDev::a_
staticprivate
Initial value:
= { -0.5000000002,
0.3333333343,
-0.2499998565,
0.1999997049,
-0.1666848753,
0.1428833286,
-0.1241963125,
0.1101687109,
-0.1142650302,
0.1055093006
}

array of a_i coeffs

double librandom::PoissonRandomDev::c0_
private
double librandom::PoissonRandomDev::c1_
private
double librandom::PoissonRandomDev::c2_
private
double librandom::PoissonRandomDev::c3_
private
double librandom::PoissonRandomDev::c_
private

0.1069 / mu_

double librandom::PoissonRandomDev::d_
private

6 mu_^2

const unsigned librandom::PoissonRandomDev::fact_
staticprivate
Initial value:
=
{ 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880 }

array of factorials 0! .. 10!

unsigned long librandom::PoissonRandomDev::L_
private

floor(mu-1.1484)

double librandom::PoissonRandomDev::mu_
private

Poisson parameter, aka lambda.

const unsigned librandom::PoissonRandomDev::n_a_ = 10
staticprivate

length of array

const unsigned librandom::PoissonRandomDev::n_tab_ = 46
staticprivate

tabulate P_0 ... P_{n_tab_-1}

double librandom::PoissonRandomDev::om_
private
std::vector<double> librandom::PoissonRandomDev::P_
private

PoissonCDF.

RngPtr librandom::PoissonRandomDev::r
private
double librandom::PoissonRandomDev::s_
private

sqrt(mu_)


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