Value comparison with tolerance
[is_equal] = CL_isAlmostEqual(A, B [,rtol, atol, crit])
This function returns %t if a value (A) is equal to a reference value (B) to within a tolerance tol defined by:
- tol = rtol*max_val + atol,
where rtol and atol are the relative and absolute tolerance, respectively, and max_val depends on the comparison criterion crit defined by:
- crit = "element" => the comparison will be done element by element: max_val = max(abs(A),abs(B))
- crit = "CLnorm" => the comparison will be done on the norms of the columns vectors: max_val = max(CL_norm(A),CL_norm(B))
Notes:
- A and B can be matrices (type="constant"), hypermatrices (type="hypermat"), structures or lists (type="struct", "list", "tlist" or "mlist").
- This function only works for "double" values (booleans or strings are not handled).
- If A and B are of different type, different size, or have different field names, %f is returned.
- Hypermatrices can only be compared using the "element" comparison criterion.
First value used in comparison (the result)
Second value used in comparison (the reference)
(optional) Relative precision. Default is 1.e-14 if atol is 0, 0 otherwise. (1x1)
(optional) Absolute precision. Default is 0. (1x1)
(optional, string) Comparison criterion: "element" or "CLnorm". Default is "element".
(boolean) %t if A and B are equal, %f otherwise (1x1)
CNES - DCT/SB