Struct ndarray_rand::F32 [−][src]
pub struct F32<S>(pub S);
A wrapper type that allows casting f64 distributions to f32
extern crate rand; extern crate ndarray; extern crate ndarray_rand; use rand::distributions::Normal; use ndarray::Array; use ndarray_rand::{RandomExt, F32}; let a = Array::random((2, 5), F32(Normal::new(0., 1.))); println!("{:8.4}", a); // Example Output: // [[ -0.6910, 1.1730, 1.0902, -0.4092, -1.7340], // [ -0.6810, 0.1678, -0.9487, 0.3150, 1.2981]]
Trait Implementations
impl<S: Copy> Copy for F32<S>
[src]
impl<S: Copy> Copy for F32<S>
impl<S: Clone> Clone for F32<S>
[src]
impl<S: Clone> Clone for F32<S>
fn clone(&self) -> F32<S>
[src]
fn clone(&self) -> F32<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for F32<S>
[src]
impl<S: Debug> Debug for F32<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S> Distribution<f32> for F32<S> where
S: Distribution<f64>,
[src]
impl<S> Distribution<f32> for F32<S> where
S: Distribution<f64>,
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f32
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f32
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more