code: public double[] foldRows(VectorAccumulator accumulator) {
          double[] result = new double[rows];
  
          for (int i = 0; i < rows; i++) {
              result[i] = foldRow(i, accumulator);
          }
  
          return result;
      }
docs: Folds all elements (in row-by-row manner) of this matrix with given {@code accumulator}.
  
  @param accumulator the vector accumulator
  
  @return the accumulated double array