Skip to main content

try_random_vec

Function try_random_vec 

Source
pub fn try_random_vec<T, D, R>(
    n: usize,
    distribution: &D,
    rng: &mut R,
    precision_out: u32,
) -> Result<Vec<T>, T::Error>
Expand description

Generates a vector of random values, converting every sample at precision_out.

The operation stops at the first conversion or validation failure instead of retrying indefinitely. precision_out must match the fixed precision of f32 and f64; it configures the precision of a rug::Float target.