(&self, f: F)
| 657 | } |
| 658 | |
| 659 | pub fn map<F, U>(&self, f: F) -> Matrix<U> |
| 660 | where F: FnMut(&T) -> U { |
| 661 | |
| 662 | Matrix { |
| 663 | nrows: self.nrows, |
| 664 | ncols: self.ncols, |
| 665 | data: self.data.iter().map(f).collect() |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | pub fn add_row(&mut self, row: &[T]) { |
| 670 |