/// <summary> /// Asserts content equality for two blocked spans of primal type /// </summary> /// <param name="lhs">The left span</param> /// <param name="rhs">The right span</param> /// <param name="caller">The invoking function</param> /// <param name="file">The file in which the invoking function is defined </param> /// <param name="line">The file line number of invocation</param> /// <typeparam name="T">The element type</typeparam> public static void ClaimEqual <T>(this ReadOnlySpan256 <T> lhs, ReadOnlySpan256 <T> rhs, [Member] string caller = null, [File] string file = null, [Line] int?line = null) where T : struct { for (var i = 0; i < length(lhs, rhs); i++) { if (!gmath.eq(lhs[i], rhs[i])) { throw Errors.ItemsNotEqual(i, lhs[i], rhs[i], caller, file, line); } } }
public static void ClaimEqual <T>(this Span <T> lhs, Span <T> rhs, T tolerance, [Member] string caller = null, [File] string file = null, [Line] int?line = null) where T : struct { for (var i = 0; i < length(lhs, rhs); i++) { if (!gmath.within(lhs[i], rhs[i], tolerance)) { throw Errors.ItemsNotEqual(i, lhs[i], rhs[i], caller, file, line); } } }