pub fn linspace(start: f64, end: f64, n: usize) -> Vec<f64> {
    if n == 0 {
        return Vec::new();
    } else if n == 1 || start == end {
        return vec![start];
    }
    let step = (end - start) / (n - 1) as f64;
    (0..n).map(|i| start + step * i as f64).collect()
}

#[test]
fn pointwise_linspace() {
    let ls = linspace(0.0, 0.0, 1000);
    assert!(ls.len() == 1)
}
