/// Modify each cell in the matrix using some function of the previous value
/// and its row and column.
Modify each cell in the matrix using some function of the previous value
and its row and column.
Modify each cell in the matrix using some function of the previous value and its row and column .
pub fn modify_each<F>(&mut self, f: F)
        where F: Fn(&mut T, usize, usize) -> T
    {
        for (rowi, row) in self.iter_rows_mut().enumerate() {
            for (coli, x) in row.iter_mut().enumerate() {
                *x = f(x, rowi, coli);
            }
        }
    }
pub fn modify_each < F > ( & mut self , f : F ) where F : Fn ( & mut T , usize , usize ) -> T { for ( rowi , row ) in self . iter_rows_mut ( ) . enumerate ( ) { for ( coli , x ) in row . iter_mut ( ) . enumerate ( ) { * x = f ( x , rowi , coli ) ; } } }
Modify each cell in the matrix using some function of the previous value
and its row and column.
Modify each cell in the matrix using some function of the previous value and its row and column .
&mut self
f
F