Function rustml::vectors::random [] [src]

pub fn random<T: Rand + Clone>(n: usize) -> Vec<T>

Creates a vector with random elements.

Example

use rustml::vectors::*;

let r = random::<u32>(100);
assert!(r.iter().any(|&x| x != 0));

Implemenation details

The function uses thread_rng to create the random elements.