pub trait Diag { type Output; // Required method fn diag(&self) -> Self::Output; }
Returns the diagonal of the given matrix
{aᵢᵢ}
let a = [ [1.0, 2.0], [3.0, 4.0] ]; assert_eq!(a.diag(), [1.0, 4.0]);