Class
NumCosmoMathRNG
Description [src]
class NumCosmoMath.RNG : GObject.Object
{
/* No available fields */
}
Encapsulated GNU Scientific Library (GSL) random number generator with support for multhreading.
This object encapsulates the GNU Scientific Library (GSL) pseudo random number generator (PRNG). Its main purpose is to add support for saving and loading state and multhreading. For more information about the GSL routines see both links: random number generation and random number distributions.
Constructors
ncm_rng_new
Creates a new NcmRNG using the algorithm algo.
See the list of algorithms here.
If algo is NULL the default algorithm and seed are used.
See this link for more details.
ncm_rng_seeded_new
Creates a new NcmRNG using the algorithm algo.
See the list of algorithms here.
If algo is NULL the default algorithm is used.
See this link for more details.
Functions
ncm_rng_pool_get
Gets the NcmRNG named name from the pool.
If it doesn’t exists, it creates one, add it to the pool and returns it.
Instance methods
ncm_rng_beta_gen
This function returns a random number drawn from the
beta distribution
with shape parameters a and b. The shape parameters must be positive.
ncm_rng_bivariate_gaussian_gen
This function returns a random number drawn from the
Bivariate Gaussian distribution,
with standard deviations sigma_x and sigma_y and correlation coefficient rho.
The correlation coefficient must be in the range $-1 \leq \rho \leq 1$.
ncm_rng_chisq_gen
This function returns a random number drawn from the Chi-square Distribution, with $\nu$ degrees of freedom.
ncm_rng_choose
This function fills the array dest with k elements from the array src.
The elements are chosen randomly using the algorithm (choose with replecement) in
gsl_ran_choose().
ncm_rng_discrete_gen
This function returns a random number drawn from the discrete distribution. The weights must created using ncm_rng_discrete_new().
ncm_rng_exponential_gen
This function returns a random number drawn from the
exponential distribution
with scale parameter (mean) mu.
ncm_rng_exppow_gen
This function returns a random number drawn from the
exponential power distribution
with scale parameter a and exponent b.
ncm_rng_gamma_gen
This function returns a random number drawn from the
gamma distribution
with shape parameter a and scale parameter b.
ncm_rng_gaussian_gen
This function returns a random number drawn from the
Gaussian distribution,
with mean mu and standard deviation sigma.
ncm_rng_gaussian_tail_gen
This function returns a random number drawn from the upper tail of the
Gaussian distribution with standard deviation sigma.
The value returned is larger than the lower limit a, which must be positive.
ncm_rng_get_state
Gets the state of the algorithm in Base64. It can be a very large string depending on the underlining state.
ncm_rng_laplace_gen
This function returns a random number drawn from the
Laplace distribution
with width a.
ncm_rng_multinomial
This function fills the array n with K elements using a multinomial distribution
defined by the array p.
ncm_rng_poisson_gen
This function returns a random number drawn from the Poisson distribution,
with frequency mu.
ncm_rng_rayleigh_gen
This function returns a random number drawn from the
Rayleigh distribution
with scale parameter sigma.
ncm_rng_sample
This function fills the array dest with k elements from the array src.
The elements are chosen randomly using the algorithm (sample with replecement) in
gsl_ran_sample().
ncm_rng_set_random_seed
Sets the algorithm seed using a PRNG seeded by /dev/urandom (Unix/Linux)
or current time, when the first is not available (see #g_rand_new).
If allow_colisions is FALSE this function will set the first unused seed generated.
ncm_rng_ugaussian_gen
This function returns a random number drwan from the
Gaussian distribution,
with mean zero and standard deviation one.
Equivalent as above but with mean = 0 and sigma = 1.
ncm_rng_uniform01_gen
This function returns a random number drawn from the uniform distribution between zero and one $[0,1)$.
ncm_rng_uniform01_pos_gen
This function returns a random number drawn from the uniform distribution between zero and one $(0,1)$.
ncm_rng_uniform_gen
This functions returns a random number drawn from the
uniform distribution between the values xl and xu.
ncm_rng_uniform_int_gen
This function returns a random number drawn from the
uniform distribution between zero and n.
Properties
NumCosmoMath.RNG:algorithm
The name of the pseudo random number algorithm to be used from GNU Scientific Library (GSL). A list of the available algorithms can be find here.
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.