Function iter_num_tools::lin_space[][src]

pub fn lin_space<R, T>(range: R, steps: usize) -> LinSpace<T>

Notable traits for LinSpace<T>

impl<T: Linear> Iterator for LinSpace<T> type Item = T;
where
    R: IntoLinSpace<T>, 
Expand description

Creates a linear space over range with a fixed number of steps

use iter_num_tools::lin_space;

// Inclusive
let it = lin_space(20.0..=21.0, 3);
assert!(it.eq(vec![20.0, 20.5, 21.0]));

// Exclusive
let it = lin_space(20.0..21.0, 2);
assert!(it.eq(vec![20.0, 20.5]));