Function approx_pearson_skew::next_min[][src]

pub fn next_min(slice: &[u8], prev: Option<&u8>) -> Option<(usize, usize)>

Determine the next minimum index and count of occurances

If given a previous minimum index, find the first index and count occurances. Returns None if slice length zero, or if previous value was max.

let arr = [0, 2, 5, 7, 2, 1];
let found = next_min(&arr, Some(&1));
let (ind, occurance, value) = (1, 2, 2);
assert_eq!(found, Some((ind, occurance)));
assert_eq!(arr[ind], value);