| Hello Can anybody help me regarding QuantLib . I am using Quantlib 0.9.0 and trying to built a wrapper code for Floating Rate Bond. It's working fine on WINDOWS but when i build it on AIX 5.3,it dumps core The code is as follows struct CommonVars { // common data Calendar calendar; Date today; Real faceAmount; DayCounter dayCounter;
// cleanup SavedSettings backup;
// setup CommonVars() { calendar = TARGET();
today = calendar.adjust(Date:: faceAmount = 100.0; dayCounter = Actual360(); } };
int main(int, char* []) { try {
boost::timer timer;
// "Testing floating-rate bond prices against cached values..."
CommonVars vars; Date today(22,November,2004);
Settings::instance(). Natural settlementDays = 1;
Handle<YieldTermStructure>
riskFreeRate(boost::shared_ new
FlatForward(today,0.025,
Handle<YieldTermStructure>
discountCurve(boost::shared_
boost::shared_ptr<IborIndex> index(new USDLibor(6*Months, riskFreeRate));
Natural fixingDays = 1; Real tolerance = 1.0e-6;
Volatility capletVolatility = 0.00022; Real capVal = 0.03; Real floorVal = 0.02;
// plain Schedule sch(Date(30,November,2004), Date(30,November,2008), Period(Semiannual),
UnitedStates(UnitedStates:: ModifiedFollowing, ModifiedFollowing, DateGeneration::Backward, false);
FloatingRateBond bond1(settlementDays, vars.faceAmount, sch,
boost::shared_ptr<
bond1.setPricingEngine(
Real pri1 = bond1.NPV(); cout<<"\n Floating Rate NPV = "<< pri1 <<"\n"; } catch (std::exception& e) { std::cout << e.what() << std::endl; return 1; } catch (....) { std::cout << "unknown error" << std::endl; return 1; } } Can anyone tell me what can be the reason for it??? |
| Free forum by Nabble | Edit this page |