numrst 0.5.0

Fundamental package for scientific computing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use numrst::{view::AsMatrixViewMut, IndexOp, NdArray};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let total = NdArray::<f32>::zeros((5, 5)).unwrap();

    {
        let mut sub = total.index((1..3, 2..4)).unwrap();
        let source = sub.randn_like(0.0, 1.0).unwrap();
        let mut sub_view = sub.matrix_view_mut().unwrap();

        sub_view.copy_from(&source).unwrap();
    }
    
    println!("{}", total);

    Ok(())
}