[][src]Function rulinalg::utils::argmin

pub fn argmin<T>(u: &[T]) -> (usize, T) where
    T: Copy + PartialOrd

Find argmin of slice.

Returns index of first occuring minimum.

Examples

use rulinalg::utils;
let a = vec![5.0, 2.0, 3.0, 4.0];

let c = utils::argmin(&a);
assert_eq!(c.0, 1);
assert_eq!(c.1, 2.0);