pub fn assert_nearly_equal_array<T>(
    a: &[T],
    b: &[T],
    rel_tol: T,
    abs_tol: T,
    msg: &'static str
)where
    T: Float + Zero,
Expand description

Asserts that two given arrays are almost equal

Arguments

  • a first array of floating-point numbers
  • b second array of floating point numbers
  • rel_tol relative tolerance (must be positive)
  • abs_tol absolute tolerance (must be positive)
  • msg an error message that will be thrown if the assertion fails

Panics

The function will panic if there is at least one coordinate at which the two arrays differ at a relative tolerance more than rel_tol and an absolute tolerance of more than abs_tol