/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionGeneralizedAnalyticApproximation.java
final double swapEnd   = swapAnnuities[swapTenor.length-1];
final double swapEnd  = swapTenor[swapTenor.length-1];
AnalyticModelFromCurvesAndVols model = null; if(discountCurve == null) { discountCurve = new DiscountCurveFromForwardCurve(forwardCurve.getName()); model = new AnalyticModelFromCurvesAndVols(new Curve[] { forwardCurve, discountCurve }); } final double swapStart = swapTenor[0]; <extra_id_0> final int swapStartIndex = liborPeriodDiscretization.getTimeIndex(swapStart); final int swapEndIndex = liborPeriodDiscretization.getTimeIndex(swapEnd); 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++) {