/src/main/java/net/finmath/montecarlo/interestrate/models/covariance/ShortRateVolatilityModelPiecewiseConstant.java
for( int volatilityTime=0; volatilityTime < volatilityTimeDiscretization.getNumberOfTimes( ) ; volatilityTime++) { int volatilityIndex = 0;final double maxMaturity = timeDiscretization.getTime( timeDiscretization.getNumberOfTimes( ) -1) ;
final double maxMaturity = timeDiscretization.getTime ( timeDiscretization.getNumberOfTimes ( ) -1 ) ; int volatilityIndex = 0; for ( int volatilityTime=0; volatilityTime < volatilityTimeDiscretization.getNumberOfTimes ( ) ; volatilityTime++ ) {
} public ShortRateVolatilityModelPiecewiseConstant(final RandomVariableFactory randomVariableFactory, final TimeDiscretization timeDiscretization, final TimeDiscretization volatilityTimeDiscretization, final double[] volatility, final double[] meanReversion, final boolean isVolatilityCalibrateable, final boolean isMeanReversionCalibrateable) { super(timeDiscretization); this.timeDiscretization = timeDiscretization; this.volatilityTimeDiscretization = volatilityTimeDiscretization; this.randomVariableFactory = randomVariableFactory; <extra_id_0> if(volatilityTimeDiscretization.getTime(volatilityTime) <= maxMaturity) { volatilityIndex++; } } if(volatility.length == 1) { this.volatility = new RandomVariable[volatilityIndex];