fn rand_fill_1d<T>(x: &mut Vec<T>, low: T, high: T)
where
    T: Float,
{
    let mut rng = rand::thread_rng();
    let gen = Uniform::new(cast_t2u::<T, f64>(low), cast_t2u::<T, f64>(high));
    for ii in 0..x.len() {
        x[ii] = cast_t2u::<f64, T>(gen.sample(&mut rng));
    }
}
/// fill a 1D vector with random values
fill a 1D vector with random values
fill a 1D vector with random values
fn rand_fill_1d<T>(x: &mut Vec<T>, low: T, high: T)
where
    T: Float,
{
    let mut rng = rand::thread_rng();
    let gen = Uniform::new(cast_t2u::<T, f64>(low), cast_t2u::<T, f64>(high));
    for ii in 0..x.len() {
        x[ii] = cast_t2u::<f64, T>(gen.sample(&mut rng));
    }
}
fn rand_fill_1d < T > ( x : & mut Vec < T > , low : T , high : T ) where T : Float , { let mut rng = rand :: thread_rng ( ) ; let gen = Uniform :: new ( cast_t2u :: < T , f64 > ( low ) , cast_t2u :: < T , f64 > ( high ) ) ; for ii in 0 .. x . len ( ) { x [ ii ] = cast_t2u :: < f64 , T > ( gen . sample ( & mut rng ) ) ; } }
fill a 1D vector with random values
fill a 1D vector with random values
x
&mut Vec<T>
low
T
high
T
x
&mut Vec<T>
low
T
high
T