pub fn rnd_scalar_vec_in_fp_range(len: usize, scale: usize) -> Vec<Scalar> {
        let mut rng = rand::thread_rng();
        let max: f32 = Fix::max_value().to_float::<f32>() / (scale as f32);
        let min = -max;
        let rnd_f32_vec: Vec<f32> = (0..len).map(|_| rng.gen_range(min, max)).collect();
        let rnd_scalar_vec: Vec<Scalar> = f32_to_scalar_vec(&rnd_f32_vec);
        rnd_scalar_vec
    }
// Note mlei: purpose of scale is to scale down the interval to avoid overflow when adding multple fixed precision values
Note mlei: purpose of scale is to scale down the interval to avoid overflow when adding multple fixed precision values
Note mlei : purpose of scale is to scale down the interval to avoid overflow when adding multple fixed precision values
pub fn rnd_scalar_vec_in_fp_range(len: usize, scale: usize) -> Vec<Scalar> {
        let mut rng = rand::thread_rng();
        let max: f32 = Fix::max_value().to_float::<f32>() / (scale as f32);
        let min = -max;
        let rnd_f32_vec: Vec<f32> = (0..len).map(|_| rng.gen_range(min, max)).collect();
        let rnd_scalar_vec: Vec<Scalar> = f32_to_scalar_vec(&rnd_f32_vec);
        rnd_scalar_vec
    }
pub fn rnd_scalar_vec_in_fp_range ( len : usize , scale : usize ) -> Vec < Scalar > { let mut rng = rand :: thread_rng ( ) ; let max : f32 = Fix :: max_value ( ) . to_float :: < f32 > ( ) / ( scale as f32 ) ; let min = - max ; let rnd_f32_vec : Vec < f32 > = ( 0 .. len ) . map ( | _ | rng . gen_range ( min , max ) ) . collect ( ) ; let rnd_scalar_vec : Vec < Scalar > = f32_to_scalar_vec ( & rnd_f32_vec ) ; rnd_scalar_vec }
Note mlei: purpose of scale is to scale down the interval to avoid overflow when adding multple fixed precision values
Note mlei : purpose of scale is to scale down the interval to avoid overflow when adding multple fixed precision values
len
usize
scale
usize
len
usize
scale
usize