code: public Matrix transform(MatrixFunction function) {
          Matrix result = blank();
          MatrixIterator it = iterator();
  
          while (it.hasNext()) {
              double x  = it.next();
              int i = it.rowIndex();
              int j = it.columnIndex();
              result.set(i, j, function.evaluate(i, j, x));
          }
  
          return result;
      }
docs: Builds a new matrix by applying given {@code function} to each element of this matrix.
  
  @param function the matrix function
  
  @return the transformed matrix