pub struct RngType { /* private fields */ }
Implementations
sourceimpl RngType
impl RngType
pub fn default() -> Self
sourcepub fn types_setup() -> Vec<RngType>
pub 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);
}
sourcepub fn env_setup() -> Option<RngType>
pub 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
Auto Trait Implementations
impl RefUnwindSafe for RngType
impl !Send for RngType
impl !Sync for RngType
impl Unpin for RngType
impl UnwindSafe for RngType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more