ohsl 0.12.0

A collection of numerical routines and mathematical types for use in scientific computing.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ohsl::vector::Vector;

#[test]
fn linspace() {
    let v = Vector::<f64>::linspace( 0.0, 1.0, 11 );
    assert_eq!( v[10], 1.0 );
    assert_eq!( v[0], 0.0 );
    assert_eq!( v[5], 0.5 );
}

#[test]
fn powspace() {
    let v = Vector::<f64>::powspace( 0.0, 1.0, 11, 2.0 );
    assert_eq!( v[10], 1.0 );
    assert_eq!( v[0], 0.0 );
    assert_eq!( v[5], 0.25 );
}