Trait Diag

Source
pub trait Diag {
    type Output;

    // Required method
    fn diag(&self) -> Self::Output;
}

Required Associated Types§

Required Methods§

Source

fn diag(&self) -> Self::Output

Returns the diagonal of the given matrix

{aᵢᵢ}

§Examples
let a = [
    [1.0, 2.0],
    [3.0, 4.0]
];
assert_eq!(a.diag(), [1.0, 4.0]);

Implementations on Foreign Types§

Source§

impl<F, const L: usize, const H: usize> Diag for [[F; L]; H]
where F: Clone,

Source§

type Output = Vec<F>

Source§

fn diag(&self) -> Self::Output

Implementors§