pub trait Array2dOps<T, const M: usize, const N: usize>: ArrayOps<[T; N], M> {
    // Required methods
    fn transpose(self) -> [[T; M]; N];
    fn mul_kronecker<Rhs, const H: usize, const W: usize>(
        &self,
        rhs: &[[Rhs; W]; H]
    ) -> [[<T as Mul<Rhs>>::Output; { _ }]; { _ }]
       where T: Mul<Rhs> + Copy,
             Rhs: Copy;
    fn into_diagonal(self) -> [T; { _ }];
    fn diagonal_ref(&self) -> [&T; { _ }];
    fn diagonal_mut(&mut self) -> [&mut T; { _ }];
}

Required Methods§

source

fn transpose(self) -> [[T; M]; N]

Transposes a two-dimensional array (as if it were a matrix)

§Example
use array__ops::*;
 
let matrix: [[u8; 5]; 3] = [
    [1,   2,  3,  4,  5],
    [6,   7,  8,  9, 10],
    [11, 12, 13, 14, 15]
];
 
assert_eq!(matrix.transpose(), [
    [1,  6, 11],
    [2,  7, 12],
    [3,  8, 13],
    [4,  9, 14],
    [5, 10, 15]
]);
source

fn mul_kronecker<Rhs, const H: usize, const W: usize>( &self, rhs: &[[Rhs; W]; H] ) -> [[<T as Mul<Rhs>>::Output; { _ }]; { _ }]
where T: Mul<Rhs> + Copy, Rhs: Copy,

source

fn into_diagonal(self) -> [T; { _ }]

source

fn diagonal_ref(&self) -> [&T; { _ }]

source

fn diagonal_mut(&mut self) -> [&mut T; { _ }]

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T, const M: usize, const N: usize> Array2dOps<T, M, N> for [[T; N]; M]

source§

fn transpose(self) -> [[T; M]; N]

source§

fn mul_kronecker<Rhs, const H: usize, const W: usize>( &self, rhs: &[[Rhs; W]; H] ) -> [[<T as Mul<Rhs>>::Output; { _ }]; { _ }]
where T: Mul<Rhs> + Copy, Rhs: Copy,

source§

fn into_diagonal(self) -> [T; { _ }]

source§

fn diagonal_ref(&self) -> [&T; { _ }]

source§

fn diagonal_mut(&mut self) -> [&mut T; { _ }]

Implementors§