static double [ ] incremental ( final double [ ] values ) { final DoubleAdder adder = new DoubleAdder ( values [ 0 ] ) ; for ( int i = 1 ; i < values . length ; ++ i ) { values [ i ] = adder . add ( values [ i ] ) . doubleValue ( ) ; } return values ; }
In - place summation of the probability array .