Function unit_test_utils::assert_nearly_equal_array
source · 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 numbersb
second array of floating point numbersrel_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