opensrdk-linear-algebra 0.6.3

Standard linear algebra library using blas and lapack for OpenSRDK toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::{matrix::Matrix, number::Number};
use rayon::prelude::*;

impl<T> Matrix<T>
where
    T: Number,
{
    /// # Trace
    pub fn tr(&self) -> T {
        (0..self.rows).into_par_iter().map(|i| self[i][i]).sum()
    }
}