code: public Matrix transformRow(int i, VectorFunction function) {
          Matrix result = copy();
          VectorIterator it = result.iteratorOfRow(i);
  
          while (it.hasNext()) {
              double x = it.next();
              int j = it.index();
              it.set(function.evaluate(j, x));
          }
  
          return result;
      }
docs: Builds a new matrix by applying given {@code function} to each element of specified
  row in this matrix.
  
  @param i the row index
  @param function the vector function
  
  @return the transformed matrix