public static VectorAccumulator mkMaxAccumulator ( ) { return new VectorAccumulator ( ) { private double result = Double . NEGATIVE_INFINITY ; @ Override public void update ( int i , double value ) { result = Math . max ( result , value ) ; } @ Override public double accumulate ( ) { double value = result ; result = Double . NEGATIVE_INFINITY ; return value ; } } ; }
Makes a maximum vector accumulator that accumulates the maximum across vector elements .