[QuantLibAddin-cvs] QuantLibAddin/qlo couponvectors.cpp,1.28,1.29
Brought to you by:
ericehlers,
nando
|
From: Cristina D. <cdu...@us...> - 2006-09-06 08:44:34
|
Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25901/qlo Modified Files: couponvectors.cpp Log Message: Management of returned errors in coupon inspectors methods, using try-cach blocks. Index: couponvectors.cpp =================================================================== RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/couponvectors.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** couponvectors.cpp 5 Sep 2006 07:49:04 -0000 1.28 --- couponvectors.cpp 6 Sep 2006 08:44:31 -0000 1.29 *************** *** 70,75 **** std::vector<boost::any> cf(numberOfColumn, std::string("N/A")); cf[0]=cashflows[i]->date().serialNumber(); ! cf[1]=cashflows[i]->amount(); ! boost::shared_ptr<QuantLib::SimpleCashFlow> simpleCashFlow = boost::dynamic_pointer_cast<QuantLib::SimpleCashFlow>(cashflows[i]); --- 70,78 ---- std::vector<boost::any> cf(numberOfColumn, std::string("N/A")); cf[0]=cashflows[i]->date().serialNumber(); ! try { ! cf[1]=cashflows[i]->amount(); ! } catch(...) { ! cf[1]=std::string("N/A"); ! } boost::shared_ptr<QuantLib::SimpleCashFlow> simpleCashFlow = boost::dynamic_pointer_cast<QuantLib::SimpleCashFlow>(cashflows[i]); *************** *** 89,94 **** cf[6]=c->dayCounter().name(); cf[7]=c->accrualPeriod(); ! cf[8]=c->rate(); ! boost::shared_ptr<QuantLib::FloatingRateCoupon> floatingCoupon = boost::dynamic_pointer_cast<QuantLib::FloatingRateCoupon>( --- 92,100 ---- cf[6]=c->dayCounter().name(); cf[7]=c->accrualPeriod(); ! try { ! cf[8]=c->rate(); ! } catch(...) { ! cf[8]=std::string("N/A"); ! } boost::shared_ptr<QuantLib::FloatingRateCoupon> floatingCoupon = boost::dynamic_pointer_cast<QuantLib::FloatingRateCoupon>( *************** *** 103,108 **** cf[12]=std::string("N/A"); cf[13]=floatingCoupon->gearing(); ! cf[14]=floatingCoupon->indexFixing(); ! cf[15]=floatingCoupon->convexityAdjustment(); cf[16]=floatingCoupon->spread(); cf[17]=std::string("N/A"); --- 109,122 ---- cf[12]=std::string("N/A"); cf[13]=floatingCoupon->gearing(); ! try { ! cf[14]=floatingCoupon->indexFixing(); ! } catch(...) { ! cf[14]=std::string("N/A"); ! } ! try { ! cf[15]=floatingCoupon->convexityAdjustment(); ! } catch(...) { ! cf[15]=std::string("N/A"); ! } cf[16]=floatingCoupon->spread(); cf[17]=std::string("N/A"); *************** *** 113,118 **** cf[12]=cmsCoupon->floor(); cf[13]=cmsCoupon->gearing(); ! cf[14]=cmsCoupon->indexFixing(); ! cf[15]=cmsCoupon->convexityAdjustment(); cf[16]=cmsCoupon->spread(); cf[17]=cmsCoupon->cap(); --- 127,141 ---- cf[12]=cmsCoupon->floor(); cf[13]=cmsCoupon->gearing(); ! try { ! cf[14]=cmsCoupon->indexFixing(); ! } catch(...) { ! cf[14]=std::string("N/A"); ! } ! try { ! cf[15]=cmsCoupon->convexityAdjustment(); ! } ! catch(...) { ! cf[15]=std::string("N/A"); ! } cf[16]=cmsCoupon->spread(); cf[17]=cmsCoupon->cap(); |