code: public static MatrixProcedure asAccumulatorProcedure(final MatrixAccumulator accumulator) {
          return new MatrixProcedure() {
              @Override
              public void apply(int i, int j, double value) {
                  accumulator.update(i, j, value);
              }
          };
      }
docs: Creates an accumulator procedure that adapts a matrix accumulator for procedure
  interface. This is useful for reusing a single accumulator for multiple fold operations
  in multiple matrices.
  
  @param accumulator the matrix accumulator
  
  @return an accumulator procedure