NEST  2.6.0,not_revisioned_source_dir@0
Classes

Random deviate generators (RDGs) produce random numbers with various distributions on the basis of [0,1) uniformly distributed numbers. More...

Classes

class  librandom::BinomialRandomDev
 Class BinomialRNG. More...
 
class  librandom::ClippedRedrawContinuousRandomDev< BaseRDV >
 Wrapper template turning any continuous RDV into a clipped RDV. More...
 
class  librandom::ClippedRedrawDiscreteRandomDev< BaseRDV >
 Wrapper template turning any discrete RDV into a clipped RDV. More...
 
class  librandom::ClippedToBoundaryContinuousRandomDev< BaseRDV >
 Wrapper template turning any continuous RDV into a clipped-to-boundary RDV. More...
 
class  librandom::ClippedToBoundaryDiscreteRandomDev< BaseRDV >
 Wrapper template turning any discrete RDV into a clipped-to-boundary RDV. More...
 
class  librandom::ExpRandomDev
 Class ExpRandomDev Create exponential random numbers. More...
 
class  librandom::GammaRandomDev
 Class GammaRandomDev Create gamma distributed random numbers. More...
 
class  librandom::GSL_BinomialRandomDev
 Class GSL_BinomialRandomDev. More...
 
class  librandom::LognormalRandomDev
 Create lognormal random numbers with uniform variance. More...
 
class  librandom::NormalRandomDev
 Create normal (Gaussian) random numbers with uniform variance. More...
 
class  librandom::PoissonRandomDev
 Class PoissonRandomDev Create Poisson distributed random numbers. More...
 
class  librandom::UniformRandomDev
 Class UniformRandomDev Create uniformly distributed random numbers in [low, high). More...
 
class  librandom::UniformIntRandomDev
 Class UniformIntRandomDev Create uniformly distributed random integers from a given range. More...
 

Detailed Description

Random deviate generators (RDGs) produce random numbers with various distributions on the basis of [0,1) uniformly distributed numbers.

Discrete and continuous distributions are available. For a complete list of available deviates, please use the following sli command

* SLI ] rdevdict info
* --------------------------------------------------
* Name                     Type                Value
* --------------------------------------------------
* binomial                 rdvfacttype         <rdvfacttype>
* poisson                  rdvfacttype         <rdvfacttype>
* normal                   rdvfacttype         <rdvfacttype>
* exponential              rdvfacttype         <rdvfacttype>
* gamma                    rdvfacttype         <rdvfacttype>
* uniformint               rdvfacttype         <rdvfacttype>
* --------------------------------------------------
* 
Note
RDGs that are to be used in multithreaded code, must be called with the thread-RNG as argument whenever a number is drawn, to ensure thread-consistent number generation.
All RDGs provide double numbers, generators for discrete distributions may provide unsigned longs as well (eg, Poisson). This can be checked with the has_ldev().
Here is a code example for the use of the Poisson generator:
class poisson_generator :
public Node,
protected Device
{
...
private:
...
};
:...
poisson_dev_(0.0),
...
{
calibrate(network()->get_resolution());
}
{
poisson_dev_.set_lambda(dt.get_ms() * rate_*1e-3);
}
void nest::poisson_generator::update(thread thrd, Time const & T)
{
...
...
long_t n_spikes = poisson_dev_.ldev(rng);
...
}

Note that the RNG used by the deviate generator must be obtained via get_rng(thrd) on each call to update, to get the proper generator for the present thread.