Struct rgsl::types::rng::RngType [] [src]

pub struct RngType { /* fields omitted */ }

Methods

impl RngType
[src]

wrapper for name element

wrapper for max element

wrapper for min element

wrapper for size element

This function returns a pointer to an array of all the available generator types, terminated by a null pointer. The function should be called once at the start of the program, if needed. The following code fragment shows how to iterate over the array of generator types to print the names of the available algorithms,

let t = RngType::types_setup ();
 
println!("Available generators:");
for tmp in t.iter() {
    println!("{}", tmp.name);
}

This function reads the environment variables GSL_RNG_TYPE and GSL_RNG_SEED and uses their values to set the corresponding library variables gsl_rng_default and gsl_rng_default_seed. These global variables are defined as follows,

extern const gsl_rng_type *gsl_rng_default
extern unsigned long int gsl_rng_default_seed

The environment variable GSL_RNG_TYPE should be the name of a generator, such as taus or mt19937. The environment variable GSL_RNG_SEED should contain the desired seed value. It is converted to an unsigned long int using the C library function strtoul.

If you don’t specify a generator for GSL_RNG_TYPE then gsl_rng_mt19937 is used as the default. The initial value of gsl_rng_default_seed is zero. See rng example in examples folder for more details.

Trait Implementations

impl Clone for RngType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for RngType
[src]