tiny.simd.minRange
Defined in robust.
Source
Source: lib/simd/src/robust.zig:55
zig
pub fn minRange( comptime T: type, sorted: []const T, index_begin: usize, half_count: usize,) usize { comptime requireUnsignedInteger(T); std.debug.assert(half_count != 0); std.debug.assert(index_begin <= sorted.len); std.debug.assert(half_count <= (sorted.len - index_begin) / 2); var min_range: T = std.math.maxInt(T); var min_index = index_begin; for (index_begin..index_begin + half_count) |index| { std.debug.assert(sorted[index] <= sorted[index + half_count]); const range = sorted[index + half_count] - sorted[index]; if (range < min_range) { min_range = range; min_index = index; } } return min_index;}Source: lib/simd/src/root.zig:549
zig
pub const minRange = robust.minRange;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |