|
From: Simon I. <s.i...@gm...> - 2008-11-05 18:04:11
|
Hi Pepe, I'm afraid that I'm on holiday at the moment - won't be back at my desk for about 10 days. Also, after I wrote the code, Luigi did some modifications - so I can't be certain that the code in the library will work. As the code that uses a simple sinking schedule also doesn't work (and therefore has nothing to do with how you've input the notional schedule) I'd guess that there is a problem with the code. Can you send me the full file - I can't get to the repository on this PC? Thanks, Simon On Wed, Nov 5, 2008 at 7:01 AM, Jose Aparicio-Navarro <ja...@fr...>wrote: > > Hi all, I am failing to create an amortizing notional bond schedule and I > am not > sure whether I am misinterpreting the way I have to pass the data or a > REQUIRE > is written with the test condition in the reverse direction. > > I create the bond: > > DayCounter dayCtr = ActualActual(); > > Real bondFaceVal = 1000000.0; > Real redemption = 100.0; > Date bondMaturity(todaysDate + Period(3, Years)); > > Schedule scheFix(todaysDate, > bondMaturity, > Period(3,TimeUnit::Months), > TARGET(), > ModifiedFollowing, > ModifiedFollowing, > DateGeneration::Backward, > false); > > std::vector<Real> notionls(5, bondFaceVal); > notionls.insert(notionls.end(), 4, bondFaceVal/10.); > notionls.insert(notionls.end(), 4, bondFaceVal/100.); > > boost::shared_ptr<AmortizingFixedRateBond> amortFix( > new AmortizingFixedRateBond(0, > notionls, scheFix, std::vector<Rate>(1, 0.05), > dayCtr, ModifiedFollowing, > std::vector<Real>(1, 100.))); > > > I fail the REQUIRE (line 508 in bond.cpp) at the second notional insertion > in > > void Bond::calculateNotionalsFromCashflows() > > > When constructing the bond with a sinking freq I get the same test failure: > > boost::shared_ptr<AmortizingFixedRateBond> amortFix( > new AmortizingFixedRateBond(0, > TARGET(), bondFaceVal, todaysDate, > Period(3, Months), Frequency::Monthly, 0.05, > dayCtr, ModifiedFollowing, todaysDate)); > > > Regards > Pepe > > |