pub fn diag(&self) -> Vec<f64> {
        let mut diagonal = Vec::new();

        for j in 0..self.ncols {
            for i in 0..self.nrows {
                if i == j {
                    diagonal.push(self.get(i, j));
                }
            }
        }

        diagonal
    }
/// Gets all elements ij where i == j.
///
/// So it works on square or not square!
Gets all elements ij where i == j.
So it works on square or not square!
Gets all elements ij where i == j . So it works on square or not square!
pub fn diag(&self) -> Vec<f64> {
        let mut diagonal = Vec::new();
        for j in 0..self.ncols {
            for i in 0..self.nrows {
                if i == j {
                    diagonal.push(self.get(i, j));
                }
            }
        }
        diagonal
    }
pub fn diag ( & self ) -> Vec < f64 > { let mut diagonal = Vec :: new ( ) ; for j in 0 .. self . ncols { for i in 0 .. self . nrows { if i == j { diagonal . push ( self . get ( i , j ) ) ; } } } diagonal }
Gets all elements ij where i == j.
Gets all elements ij where i == j .
&self