Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5325/qlo
Modified Files:
couponvectors.cpp couponvectors.hpp enumclassctors.cpp
enumclassctors.hpp typefactory.hpp
Log Message:
new CMSCoupon/Conundrum interface
Index: couponvectors.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/couponvectors.hpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** couponvectors.hpp 31 Jul 2006 18:17:37 -0000 1.14
--- couponvectors.hpp 3 Aug 2006 15:39:55 -0000 1.15
***************
*** 65,68 ****
--- 65,82 ----
const std::vector<QuantLib::Spread>& spreads);
};
+
+ class VanillaCMSCouponPricer:public ObjHandler::LibraryObject<QuantLib::VanillaCMSCouponPricer> {
+ public:
+ VanillaCMSCouponPricer(const std::string &typeOfVanillaCMSCouponPricer);
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> underlyingObject()
+ {
+ return libraryObject_;
+ }
+ };
+
+ //class ConundrumPricer : public VanillaCMSCouponPricer {
+ // public:
+ // ConundrumPricer(const std::string &typeOfVanillaCMSCouponPricer);
+ //};
class CMSCouponVector : public CouponVector {
***************
*** 80,84 ****
const std::vector<QuantLib::Real>& floors,
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& vol,
! QuantLib::ConvexityAdjustmentPricer::Type typeOfConvexityAdjustment);
};
}
--- 94,98 ----
const std::vector<QuantLib::Real>& floors,
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& vol,
! const std::string & typeOfVanillaCMSCouponPricer);
};
}
Index: couponvectors.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/couponvectors.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** couponvectors.cpp 2 Aug 2006 07:08:00 -0000 1.20
--- couponvectors.cpp 3 Aug 2006 15:39:55 -0000 1.21
***************
*** 92,96 ****
cf[ 9]=floatingCoupon->fixingDays();
cf[10]=floatingCoupon->fixingDate().serialNumber();
! cf[11]=std::string("N/A");
cf[12]=std::string("N/A");
cf[13]=floatingCoupon->gearing();
--- 92,96 ----
cf[ 9]=floatingCoupon->fixingDays();
cf[10]=floatingCoupon->fixingDate().serialNumber();
! cf[11]=floatingCoupon->index()->name();
cf[12]=std::string("N/A");
cf[13]=floatingCoupon->gearing();
***************
*** 159,162 ****
--- 159,169 ----
}
+ VanillaCMSCouponPricer::VanillaCMSCouponPricer(
+ const std::string &typeOfVanillaCMSCouponPricer)
+ {
+ libraryObject_ = Create<boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> >()
+ (typeOfVanillaCMSCouponPricer);
+ }
+
CMSCouponVector::CMSCouponVector(
const boost::shared_ptr<QuantLib::Schedule>& schedule,
***************
*** 171,176 ****
const std::vector<QuantLib::Rate>& floors,
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& vol,
! QuantLib::ConvexityAdjustmentPricer::Type typeOfConvexityAdjustment) {
cashFlowVector_ = QuantLib::CMSCouponVector(*schedule,
paymentAdjustment,
--- 178,185 ----
const std::vector<QuantLib::Rate>& floors,
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& vol,
! const std::string & typeOfVanillaCMSCouponPricer) {
+ VanillaCMSCouponPricer vanillaCMSCouponPricer(typeOfVanillaCMSCouponPricer);
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> pricer = vanillaCMSCouponPricer.underlyingObject();
cashFlowVector_ = QuantLib::CMSCouponVector(*schedule,
paymentAdjustment,
***************
*** 183,188 ****
caps,
floors,
! vol,
! typeOfConvexityAdjustment);
}
--- 192,197 ----
caps,
floors,
! pricer,
! vol);
}
Index: enumclassctors.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/enumclassctors.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** enumclassctors.cpp 31 Jul 2006 11:21:16 -0000 1.12
--- enumclassctors.cpp 3 Aug 2006 15:39:55 -0000 1.13
***************
*** 499,502 ****
--- 499,511 ----
}
+ //VanillaCMSCouponPricer
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> CONUNDRUM_BY_BLACK_Pricer( ){
+ return boost::shared_ptr<QuantLib::VanillaCMSCouponPricer>(
+ new QuantLib::ConundrumPricerByBlack( ));
+ };
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> CONUNDRUM_BY_NUMERICAL_INTEGRATION_Pricer( ){
+ return boost::shared_ptr<QuantLib::VanillaCMSCouponPricer>(
+ new QuantLib::ConundrumPricerByNumericalIntegration( ));
+ };
}
Index: enumclassctors.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/enumclassctors.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** enumclassctors.hpp 31 Jul 2006 11:21:16 -0000 1.10
--- enumclassctors.hpp 3 Aug 2006 15:39:55 -0000 1.11
***************
*** 30,33 ****
--- 30,35 ----
#include <ql/Math/bilinearinterpolation.hpp>
#include <ql/Math/bicubicsplineinterpolation.hpp>
+ #include <ql/cashflows/cmscoupon.hpp>
+ #include <ql/cashflows/conundrumpricer.hpp>
namespace QuantLibAddin {
***************
*** 188,191 ****
--- 190,197 ----
const QuantLib::DayCounter &dayCounter);
+ //VanillaCMSCouponPricer
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> CONUNDRUM_BY_BLACK_Pricer( );
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer>
+ CONUNDRUM_BY_NUMERICAL_INTEGRATION_Pricer( );
}
Index: typefactory.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/typefactory.hpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** typefactory.hpp 31 Jul 2006 11:21:16 -0000 1.24
--- typefactory.hpp 3 Aug 2006 15:39:55 -0000 1.25
***************
*** 28,31 ****
--- 28,32 ----
#include <ql/Indexes/euriborswapfixa.hpp>
#include <ql/TermStructures/ratehelpers.hpp>
+ #include <ql/CashFlows/cmscoupon.hpp>
#include <oh/exception.hpp>
***************
*** 265,268 ****
--- 266,284 ----
};
+ /* *** VanillaCMSCouponPricer *** */
+ typedef boost::shared_ptr<QuantLib::VanillaCMSCouponPricer>(*VanillaCMSCouponPricerConstructor)( );
+
+ template<>
+ class Create<boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> > :
+ private RegistryManager<QuantLib::VanillaCMSCouponPricer, EnumClassRegistry> {
+ public:
+ boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> operator() (
+ const std::string& vanillaCMSCouponPricerID) {
+ VanillaCMSCouponPricerConstructor vanillaCMSCouponPricerConstructor =
+ getType<std::string, VanillaCMSCouponPricerConstructor>(vanillaCMSCouponPricerID);
+ return vanillaCMSCouponPricerConstructor();
+ }
+ };
+
}
|