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

pub struct RngType {
    // some fields omitted
}

Methods

impl RngType
[src]

fn name(&self) -> String

wrapper for name element

fn max(&self) -> usize

wrapper for max element

fn min(&self) -> usize

wrapper for min element

fn size(&self) -> usize

wrapper for size element

fn types_setup() -> Vec<RngType>

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);
}

fn env_setup() -> Option<RngType>

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 Copy for RngType
[src]

impl Clone for RngType
[src]

fn clone(&self) -> RngType

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more