Function unit_test_utils::nearly_equal_array
source · pub fn nearly_equal_array<T>(a: &[T], b: &[T], rel_tol: T, abs_tol: T) -> boolwhere
T: Float + Zero,
Expand description
Checks whether two arrays are element-wise nearly equal
Arguments
a
first arrayb
second arrayrel_tol
relative toleranceabs_tol
absolute tolerance
Returns
The function returns true if and only if the application of nearly_equal
on all elements of the two arrays returns true, i.e., if the two arrays
are element-wise almost equal
Panics
The function will panic in the following cases:
- if the specified relative or absolute tolerance is not positive and
- if the two arrays have different lengths