/src/main/java/net/finmath/montecarlo/interestrate/products/SwapLegWithFundingProvider.java
RandomVariable payoff = index.SwapLegWithFundingProvider( legSchedule , spreads , index , notionals , fundingCapacity) .add( spreads[periodIndex]).mult( periodLength) ;
RandomVariable payoff = index.getValue ( productToModelTimeOffset + fixingDate, model ) .add ( spreads[periodIndex] ) .mult ( periodLength ) ;
final double periodLength = legSchedule.getPeriodLength(periodIndex); if(periodLength == 0) { continue; } final double notionalAtPeriodStart = notionals[periodIndex]; final RandomVariable numeraire = model.getNumeraire(productToModelTimeOffset + paymentDate); <extra_id_0> payoff = payoff.mult(notionalAtPeriodStart); final RandomVariable survivalProbility = fundingCapacity.getDefaultFactors(productToModelTimeOffset + periodEnd, payoff).getSurvivalProbability(); payoff = payoff.mult(survivalProbility); payoff = payoff.div(numeraire); values = values.add(payoff); }