| 266 | |
| 267 | template<class T> |
| 268 | Matrix<T> Matrix<T>::applyFunction(T (*function)(T)) const { |
| 269 | Matrix<T> result(height, width); |
| 270 | int i, j; |
| 271 | |
| 272 | for (i = 0; i < height; i++) { |
| 273 | for (j = 0; j < width; j++) { |
| 274 | result.array[i][j] = (*function)(array[i][j]); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | return result; |
| 279 | } |
| 280 | |
| 281 | template<class T> |
| 282 | Matrix<T> Matrix<T>::subMatrix(int startH, int startW, int h, int w) const { |
no outgoing calls
no test coverage detected