tiny.simd.modeOfSorted
Defined in robust.
Source
Source: lib/simd/src/robust.zig:78
zig
pub fn modeOfSorted(comptime T: type, sorted: []const T) T { comptime requireUnsignedInteger(T); std.debug.assert(sorted.len != 0); var index_begin: usize = 0; var half_count = sorted.len / 2; while (half_count > 1) { index_begin = minRange(T, sorted, index_begin, half_count); half_count >>= 1; } const lower = sorted[index_begin]; if (half_count == 0) return lower; std.debug.assert(half_count == 1); return roundedUnsignedAverage(lower, sorted[index_begin + 1]);}Source: lib/simd/src/root.zig:550
zig
pub const modeOfSorted = robust.modeOfSorted;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |