Changeset 134
- Timestamp:
- 04/28/08 19:00:45 (2 months ago)
- Files:
-
- trunk/QLNet/QLNet/Cashflows/ConundrumPricer.cs (modified) (3 diffs)
- trunk/QLNet/QLNet/Cashflows/CouponPricer.cs (modified) (1 diff)
- trunk/QLNet/QLNet/Instruments/VanillaSwap.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/QLNet/QLNet/Cashflows/ConundrumPricer.cs
r133 r134 158 158 VanillaSwap swap = swapIndex.underlyingSwap(coupon.fixingDate()); 159 159 160 Schedule schedule = swap.fixedSchedule ;160 Schedule schedule = swap.fixedSchedule(); 161 161 Handle<YieldTermStructure> rateCurve = swapIndex.termStructure(); 162 162 … … 469 469 objectiveFunction_ = new ObjectiveFunction( this, swapRateValue_); 470 470 471 Schedule schedule = swap.fixedSchedule ;471 Schedule schedule = swap.fixedSchedule(); 472 472 Handle<YieldTermStructure> rateCurve = swapIndex.termStructure(); 473 473 DayCounter dc = swapIndex.dayCounter(); … … 645 645 646 646 int q = (int)swapIndex.fixedLegTenor().frequency(); 647 Schedule schedule = swap.fixedSchedule ;647 Schedule schedule = swap.fixedSchedule(); 648 648 DayCounter dc = swapIndex.dayCounter(); 649 649 //DayCounter dc = coupon.dayCounter(); trunk/QLNet/QLNet/Cashflows/CouponPricer.cs
r133 r134 249 249 } 250 250 public void visit(IborCoupon c) { 251 if (!(pricer_ is IborCouponPricer)) 251 IborCouponPricer pricer = pricer_ as IborCouponPricer; 252 if (pricer == null) 252 253 throw new ApplicationException("pricer not compatible with Ibor coupon"); 253 c.setPricer(pricer _ as IborCouponPricer);254 c.setPricer(pricer); 254 255 } 255 256 public void visit(CappedFlooredIborCoupon c) { 256 if (!(pricer_ is IborCouponPricer)) 257 IborCouponPricer pricer = pricer_ as IborCouponPricer; 258 if (pricer == null) 257 259 throw new ApplicationException("pricer not compatible with Ibor coupon"); 258 c.setPricer(pricer _ as IborCouponPricer);260 c.setPricer(pricer); 259 261 } 260 262 public void visit(DigitalIborCoupon c) { 261 if (!(pricer_ is IborCouponPricer)) 263 IborCouponPricer pricer = pricer_ as IborCouponPricer; 264 if (pricer == null) 262 265 throw new ApplicationException("pricer not compatible with Ibor coupon"); 263 c.setPricer(pricer _ as IborCouponPricer);266 c.setPricer(pricer); 264 267 } 265 268 public void visit(CmsCoupon c) { 266 if (!(pricer_ is CmsCouponPricer)) 269 CmsCouponPricer pricer = pricer_ as CmsCouponPricer; 270 if (pricer == null) 267 271 throw new ApplicationException("pricer not compatible with CMS coupon"); 268 c.setPricer(pricer _ as CmsCouponPricer);272 c.setPricer(pricer); 269 273 } 270 274 public void visit(CappedFlooredCmsCoupon c) { 271 if (!(pricer_ is CmsCouponPricer)) 275 CmsCouponPricer pricer = pricer_ as CmsCouponPricer; 276 if (pricer == null) 272 277 throw new ApplicationException("pricer not compatible with CMS coupon"); 273 c.setPricer(pricer _ as CmsCouponPricer);278 c.setPricer(pricer); 274 279 } 275 280 public void visit(DigitalCmsCoupon c) { 276 if (!(pricer_ is CmsCouponPricer)) 281 CmsCouponPricer pricer = pricer_ as CmsCouponPricer; 282 if (pricer == null) 277 283 throw new ApplicationException("pricer not compatible with CMS coupon"); 278 c.setPricer(pricer _ as CmsCouponPricer);284 c.setPricer(pricer); 279 285 } 280 286 //public void visit(RangeAccrualFloatersCoupon c) trunk/QLNet/QLNet/Instruments/VanillaSwap.cs
r133 r134 39 39 private double spread_; 40 40 private double nominal_; 41 41 42 private Schedule fixedSchedule_; 43 public Schedule fixedSchedule() { return fixedSchedule_; } 44 42 45 private DayCounter fixedDayCount_; 46 43 47 private Schedule floatingSchedule_; 48 public Schedule floatingSchedule() { return floatingSchedule_; } 49 44 50 private IborIndex iborIndex_; 45 51 private DayCounter floatingDayCount_; … … 185 191 } 186 192 187 // inspectors188 public Schedule fixedSchedule { get { return fixedSchedule_; } }189 public Schedule floatingSchedule { get { return floatingSchedule_; } }190 191 193 public double fixedRate { get { return fixedRate_; } } 192 194 public double spread { get { return spread_; } }