pub fn row(&self, i: usize) -> Vec<f64> {
        // let mut v: Vec<f64> = Vec::new();

        let mut v = vec![0.; self.ncols];

        assert!(i < self.nrows);

        // this way ~50% faster than .iter_mut().enumerate()
        for j in 0..self.ncols {
            unsafe {
                // let mut old_val = v.get_unchecked_mut(j);

                *v.get_unchecked_mut(j) = self.get_unchecked(i, j);
            }
        }

        v
    }
/// Rows are non-contiguous so it returns a new array.
///
/// TODO: provide a no-copy view of the row instead.
Rows are non-contiguous so it returns a new array.
TODO: provide a no-copy view of the row instead.
Rows are non - contiguous so it returns a new array . TODO : provide a no - copy view of the row instead .
pub fn row(&self, i: usize) -> Vec<f64> {
        // let mut v: Vec<f64> = Vec::new();
        let mut v = vec![0.; self.ncols];
        assert!(i < self.nrows);
        // this way ~50% faster than .iter_mut().enumerate()
        for j in 0..self.ncols {
            unsafe {
                // let mut old_val = v.get_unchecked_mut(j);
                *v.get_unchecked_mut(j) = self.get_unchecked(i, j);
            }
        }
        v
    }
pub fn row ( & self , i : usize ) -> Vec < f64 > { // let mut v: Vec<f64> = Vec::new(); let mut v = vec ! [ 0. self ncols ] ; assert ! ( i self nrows ) ; // this way ~50% faster than .iter_mut().enumerate() for j in 0 .. self . ncols { unsafe { // let mut old_val = v.get_unchecked_mut(j); * v . get_unchecked_mut ( j ) = self . get_unchecked ( i , j ) ; } } v }
Rows are non-contiguous so it returns a new array.
Rows are non - contiguous so it returns a new array .
&self
i
usize