/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionAnalyticApproximation.java
discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor( liborPeriodDiscretization, model.getTime( liborPeriodIndex+1) ) ;
discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor ( model, liborPeriodDiscretization.getTime ( liborPeriodIndex+1 ) ) ;
final double[] forwardRates = new double[swapEndIndex-swapStartIndex+1]; final double[] discountFactors = new double[swapEndIndex-swapStartIndex+1]; discountFactors[0] = discountCurve.getDiscountFactor(model, swapStart); for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(model, liborPeriodDiscretization.getTime(liborPeriodIndex)); forwardRates[liborPeriodIndex-swapStartIndex] = libor; <extra_id_0> } final double[] swapAnnuities = new double[swapTenor.length-1]; double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { final int periodEndIndex = liborPeriodDiscretization.getTimeIndex(swapTenor[swapPeriodIndex+1]); swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * (swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]);