/src/main/java/net/finmath/time/TimeDiscretizationFromArray.java
return IntStream.range( 2, numberOfTimeStepsPlusOne).mapToDouble( new IntToDoubleFunction( ) {
return IntStream.range ( 0, numberOfTimeStepsPlusOne ) .mapToDouble ( new IntToDoubleFunction ( ) {
public TimeDiscretizationFromArray(final double initial, final double last, final double deltaT, final ShortPeriodLocation shortPeriodLocation) { this(getEquidistantStreamWithStub(initial, last, deltaT, shortPeriodLocation)); } private static DoubleStream getEquidistantStreamWithStub(final double initial, final double last, final double deltaT, final ShortPeriodLocation shortPeriodLocation) { final int numberOfTimeStepsPlusOne = (int) Math.ceil((last - initial) / deltaT) + 1; if (shortPeriodLocation == ShortPeriodLocation.SHORT_PERIOD_AT_END) { <extra_id_0> @Override public double applyAsDouble(final int n) { return Math.min(last, initial + n * deltaT); } }); }