Class: Numo::GSL::Rng::RandomLibc5

Inherits:
Numo::GSL::Rng show all
Defined in:
ext/numo/gsl/rng/gsl_rng.c

Class Method Summary collapse

Methods inherited from Numo::GSL::Rng

#clone, #get, #max, #memcpy, #min, #name, #set, #size, #uniform, #uniform_int, #uniform_pos

Methods included from Numo::GSL::Ran

#bernoulli, #beta, #binomial, #bivariate_gaussian, #cauchy, #chisq, #dir_2d, #dir_2d_trig_method, #dir_3d, #dirichlet, #exponential, #exppow, #fdist, #flat, #gamma, #gamma_knuth, #gaussian, #gaussian_ratio_method, #gaussian_tail, #gaussian_ziggurat, #geometric, #gumbel1, #gumbel2, #hypergeometric, #landau, #laplace, #levy, #logarithmic, #logistic, #lognormal, #multinomial, #pareto, #pascal, #poisson, #rayleigh, #rayleigh_tail, #tdist, #ugaussian, #ugaussian_ratio_method, #ugaussian_tail, #weibull

Class Method Details

.new([seed]) ⇒ Object

Generate an instance of Numo::GSL::Rng::RandomLibc5 class, a subclass of Numo::GSL::Rng class with gsl_rng_random_libc5 type.

This function returns a pointer to a newly-created instance of a random number generator of type T. For example, the following code creates an instance of the Tausworthe generator,

gsl_rng * r = gsl_rng_alloc (gsl_rng_taus);

If there is insufficient memory to create the generator then the function returns a null pointer and the error handler is invoked with an error code of GSL_ENOMEM.

The generator is automatically initialized with the default seed, gsl_rng_default_seed. This is zero by default but can be changed either directly or by using the environment variable GSL_RNG_SEED (Random number environment variables).

The details of the available generator types are described later in this chapter.

Parameters:

  • seed (Integer)

    Random seed.



1508
1509
1510
1511
1512
# File 'ext/numo/gsl/rng/gsl_rng.c', line 1508

static VALUE
rng_random_libc5_s_new(int argc, VALUE *argv, VALUE self)
{
    return rng_s_new(argc, argv, self, gsl_rng_random_libc5);
}