Skip to main content

get_max_value_idx

Function get_max_value_idx 

Source
pub fn get_max_value_idx<T: PartialOrd + Display + Copy>(
    values: &[T],
    start_idx: usize,
    n_idx: usize,
) -> Result<usize, WaveformError>
Expand description

Return the index of the maximum value in an array of floats. This works also for numbers which don’t implement Ord, only PartialOrd is required.

§Arguments:

  • start_idx : start the search within the input array-like at this index
  • n_idx : restrict the search to the last index of start_idx + n_idx