|
NEST
2.6.0,not_revisioned_source_dir@0
|
Class BinomialRNG. More...
#include <binomial_randomdev.h>
Public Member Functions | |
| BinomialRandomDev (RngPtr, double p_s=0.5, unsigned int n_s=1) | |
| 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 (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... | |
| virtual long | ldev (void) |
| integer valued functions for discrete distributions More... | |
| void | set_rng (RngPtr rng) |
| set RNG More... | |
Private Member Functions | |
| void | init_ () |
| check and initialize internal parameters More... | |
| void | PrecomputeTable (size_t) |
| compute the internal lookup table More... | |
Private Attributes | |
| PoissonRandomDev | poisson_dev_ |
| source of Poisson random numbers More... | |
| ExpRandomDev | exp_dev_ |
| source of exponential random numbers More... | |
| double | p_ |
| probability p of binomial distribution More... | |
| double | phi_ |
| long | m_ |
| unsigned int | n_ |
| parameter n in binomial distribution More... | |
| std::vector< double_t > | f_ |
| precomputed table of f More... | |
| unsigned int | n_tablemax_ |
| current maximal n with precomputed values More... | |
Additional Inherited Members | |
Protected Attributes inherited from librandom::RandomDev | |
| RngPtr | rng_ |
| store underlying RNG More... | |
Class BinomialRNG.
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:
| librandom::BinomialRandomDev::BinomialRandomDev | ( | RngPtr | r_s, |
| double | p_s = 0.5, |
||
| unsigned int | n_s = 1 |
||
| ) |
References init_(), and PrecomputeTable().
| librandom::BinomialRandomDev::BinomialRandomDev | ( | double | p_s = 0.5, |
| unsigned int | n_s = 1 |
||
| ) |
References init_(), and PrecomputeTable().
|
virtual |
get distribution parameters from SLI dict
Implements librandom::RandomDev.
References nest::names::d.
|
inlinevirtual |
true if RDG implements ldev function
Reimplemented from librandom::RandomDev.
|
private |
check and initialize internal parameters
References assert(), nest::names::mu, and nest::names::theta.
Referenced by BinomialRandomDev().
|
virtual |
draw integer, threaded
Reimplemented from librandom::RandomDev.
References assert(), and lockPTR< D >::valid().
Referenced by nest::FixedTotalNumberBuilder::connect_().
|
inlinevirtual |
return as double, threaded
Implements librandom::RandomDev.
References librandom::RandomDev::ldev().
|
private |
compute the internal lookup table
Referenced by BinomialRandomDev().
| void librandom::BinomialRandomDev::set_n | ( | unsigned int | n_s | ) |
set n
Referenced by nest::FixedTotalNumberBuilder::connect_().
| void librandom::BinomialRandomDev::set_p | ( | double | p_s | ) |
set p
Referenced by nest::FixedTotalNumberBuilder::connect_().
| void librandom::BinomialRandomDev::set_p_n | ( | double | p_s, |
| unsigned int | n_s | ||
| ) |
set parameters for p and n p - success probability for single trial n - number of trials
|
virtual |
set distribution parameters from SLI dict
Implements librandom::RandomDev.
References nest::names::d, and nest::names::max.
|
private |
source of exponential random numbers
|
private |
precomputed table of f
|
private |
|
private |
parameter n in binomial distribution
|
private |
current maximal n with precomputed values
|
private |
probability p of binomial distribution
|
private |
|
private |
source of Poisson random numbers
1.8.7