Function rulinalg::utils::find [] [src]

pub fn find<T>(p: &[T], u: T) -> usize where T: PartialOrd

Find index of value in slice.

Returns index of first occuring value.

Examples

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

let c = utils::find(&a, 3.0);
assert_eq!(c, 2);