/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
final double[] regressionBasisfunctionTimes = Stream.concat( Arrays.stream( swapEndDate) ,Stream.of( exerciseDates) ).mapToDouble( new ToDoubleFunction<LocalDate>( ) {
final double[] regressionBasisfunctionTimes = Stream.concat ( Arrays.stream ( exerciseDates ) ,Stream.of ( swapEndDate ) ) .mapToDouble ( new ToDoubleFunction<LocalDate> ( ) {
public RandomVariable[] getBasisFunctions(final double evaluationTime, final MonteCarloSimulationModel model) throws CalculationException { final LIBORModelMonteCarloSimulationModel liborModel = (LIBORModelMonteCarloSimulationModel)model; return getBasisFunctions(evaluationTime, liborModel); } public RandomVariable[] getBasisFunctions(final double evaluationTime, final LIBORModelMonteCarloSimulationModel model) throws CalculationException { final LocalDateTime modelReferenceDate = model.getReferenceDate(); <extra_id_0> @Override public double applyAsDouble(final LocalDate date) { return FloatingpointDate.getFloatingPointDateFromDate(modelReferenceDate, date.atStartOfDay()); } }).sorted().toArray(); final ArrayList<RandomVariable> basisFunctions = new ArrayList<>(); final double exerciseTime = evaluationTime; int exerciseIndex = Arrays.binarySearch(regressionBasisfunctionTimes, exerciseTime);