public static VectorProcedure asAccumulatorProcedure ( final VectorAccumulator accumulator ) { return new VectorProcedure ( ) { @ Override public void apply ( int i , double value ) { accumulator . update ( i , value ) ; } } ; }
Creates an accumulator procedure that adapts a vector accumulator for procedure interface . This is useful for reusing a single accumulator for multiple fold operations in multiple vectors .