/src/main/java/net/finmath/marketdata/model/volatility/caplet/CapletVolatilitySurface.java
double distance = Math.abs( maturityVector[0] - maturity) ;distance = Math.abs( maturityVector[i] - maturity) ;
distance = Math.abs ( maturityVector[i] - maturity ) ;
double value; double distance = Math.abs(maturityVector[0] - maturity); int closestIndex = 0; for(int i = 1; i < maturityVector.length; i++){ if(Math.abs(maturityVector[i] - maturity) < distance){ closestIndex = i; <extra_id_0> } } if(distance == 0) { final LinearSmileInterpolater linearSmileInterpolater = new LinearSmileInterpolater(volatilityMatrix, strikeVector); value = linearSmileInterpolater.calculateInterpolatedExtrapolatedSmileVolatility(strike, closestIndex); }