fn vectors(av: &Vec<f64>, bv: &Vec<f64>, epsilon: f64, relth: f64) -> bool {
    // both are empty, as a definition: same
    if av.is_empty() && bv.is_empty() {
        return true;
    }

    // sizes must be equal
    if av.len() != bv.len() {
        return false;
    }

    // each element must be equal
    return av
        .iter()
        .zip(bv.iter())
        .map(|(&a, &b)| equal(a, b, epsilon, relth))
        .fold(true, |acc, x| acc && x);
}
// compare if two vectors Vec<f64> are equal
compare if two vectors Vec are equal
compare if two vectors Vec are equal
fn vectors(av: &Vec<f64>, bv: &Vec<f64>, epsilon: f64, relth: f64) -> bool {
    // both are empty, as a definition: same
    if av.is_empty() && bv.is_empty() {
        return true;
    }
    // sizes must be equal
    if av.len() != bv.len() {
        return false;
    }
    // each element must be equal
    return av
        .iter()
        .zip(bv.iter())
        .map(|(&a, &b)| equal(a, b, epsilon, relth))
        .fold(true, |acc, x| acc && x);
}
fn vectors ( av : & Vec < f64 > , bv : & Vec < f64 > , epsilon : f64 , relth : f64 ) -> bool { // both are empty, as a definition: same if av . is_empty ( ) && bv . is_empty ( ) { return true ; } // sizes must be equal if av . len ( ) != bv . len ( ) { return false ; } // each element must be equal return av . iter ( ) . zip ( bv . iter ( ) ) . map ( | ( & a , & b ) | equal ( a , b , epsilon , relth ) ) . fold ( true , | acc , x | acc && x ) ; }
compare if two vectors Vec<f64> are equal
compare if two vectors Vec<f64 > are equal
av
&Vec<f64>
bv
&Vec<f64>
epsilon
f64
relth
f64
av
&Vec<f64>
bv
&Vec<f64>
epsilon
f64
relth
f64