ndarray-inverse 0.1.9

Pure Rust Inverse and Determinant trait for ndarray Array2
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ndarray::{Array2, Zip, Axis};
use ndarray::prelude::*;

fn main() {
    let a: Array2<f64> = Array2::zeros((5,5));
    let mut d: Array1<f64> = array![1.0,2.0,3.0,4.0,5.0];

    for i in 0 .. 5 {
        Zip::from(a.index_axis(Axis(0), i))
            .and(&mut d)
            .for_each(|x, y| *y = *y + x + 10.0);
    }

    println!("{:?}", d);
}