/src/main/java/net/finmath/montecarlo/BrownianMotionWithControlVariate.java
final double average = averages.computeIfAbsent( mapIndex, index -> { return brownianIncrementControlled.getAverage( ) ;}) ;
final double average = averages.computeIfAbsent ( mapIndex, index -> { return brownianIncrement.getAverage ( ) ;} ) ;
this.brownianMotion = brownianMotion; } @Override public RandomVariable getBrownianIncrement(final int timeIndex, final int factorIndex) { final RandomVariable brownianIncrement = brownianMotion.getBrownianIncrement(timeIndex, factorIndex); final int mapIndex = timeIndex * brownianMotion.getNumberOfFactors() + factorIndex; <extra_id_0> final double scaling = scalings.computeIfAbsent(mapIndex, index -> { return Math.sqrt(brownianMotion.getTimeDiscretization().getTimeStep(timeIndex)) / brownianIncrement.getStandardDeviation();}); RandomVariable brownianIncrementControlled = brownianIncrement; if(average != 0.0) { brownianIncrementControlled = brownianIncrementControlled.sub(average); } if(Double.isFinite(scaling) && scaling != 1.0) {