cpnRate[loopcpn] = Math.min(Math.max(cpnFloor, cpnMain), cpnCap);
calibration.add(new CapFloorIbor(cpn.getCurrency(), cpn.getPaymentTime(), cpn.getFundingCurveName(), cpn.getPaymentYearFraction(), cpn.getNotional(), cpn.getFixingTime(), cpn.getIndex(),
cpn.getFixingPeriodStartTime(), cpn.getFixingPeriodEndTime(), cpn.getFixingAccrualFactor(), cpn.getForwardCurveName(), cpnRate[loopcpn], true));
} else {
if (getNthPayment(loopcpn) instanceof CouponFixed) {
final CouponFixed cpn = (CouponFixed) getNthPayment(loopcpn);
cpnRate[loopcpn] = cpn.getFixedRate();
} else {
final CouponIborGearing cpn = (CouponIborGearing) getNthPayment(loopcpn);
final double ibor = prc.visitCouponIborGearing(cpn, curves);
cpnRate[loopcpn] = cpn.getFactor() * ibor + cpn.getSpread();
}
}
}
break;