INNER CODE UNIT · Rust

median

TheMaxMur/RS-Key · crates/rsk-bench/src/lib.rs:97

    let median = warm[n / 2];
    // MAD: overwrite the (no-longer-needed) warm slice with absolute deviations,
    // re-sort, take their median. `abs_diff` avoids the signed detour.
    for x in warm.iter_mut() {
        *x = x.abs_diff(median);
    }
    warm.sort_unstable();
    let mad = warm[n / 2];
    Summary {
        n: n as u32,
        cold,
        min,
        median,
        mad,
    }
}

#[cfg(kani)]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…