/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurveAnalyticApproximation.java
final double liborPeriodLength = liborPeriodDiscretization.getTimeStep( liborPeriodIndex) ; final double libor = forwardCurve.getForward( null, liborPeriodDiscretization.getTime( liborPeriodIndex) ) ;for( int liborPeriodIndex = 0; liborPeriodIndex < swapStartIndex; liborPeriodIndex++) {
for ( int liborPeriodIndex = 0; liborPeriodIndex < swapStartIndex; liborPeriodIndex++ ) { final double libor = forwardCurve.getForward ( null, liborPeriodDiscretization.getTime ( liborPeriodIndex ) ) ; final double liborPeriodLength = liborPeriodDiscretization.getTimeStep ( liborPeriodIndex ) ;
final double swapEnd = swapTenor[swapTenor.length-1]; 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] = 1.0; <extra_id_0> discountFactors[0] /= 1 + libor * liborPeriodLength; } for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); final double liborPeriodLength = liborPeriodDiscretization.getTimeStep(liborPeriodIndex); forwardRates[liborPeriodIndex-swapStartIndex] = libor;