opensrdk-linear-algebra 0.9.3

Standard linear algebra library using blas and lapack for OpenSRDK toolchain.
Documentation
use crate::{Matrix, Number, Tensor};

impl<T> Tensor<T> for Matrix<T>
where
    T: Number,
{
    fn rank(&self) -> usize {
        2
    }

    fn size(&self, level: usize) -> usize {
        match level {
            0 => self.rows(),
            1 => self.cols(),
            _ => 0,
        }
    }

    fn elem(&self, indices: &[usize]) -> T {
        self[(indices[0], indices[1])]
    }

    fn elem_mut(&mut self, indices: &[usize]) -> &mut T {
        &mut self[(indices[0], indices[1])]
    }
}