Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11101/qlo
Modified Files:
capfloor.cpp capfloor.hpp pricingengines.cpp
pricingengines.hpp swap.cpp swap.hpp swaption.hpp
swaptionvolstructure.cpp vanillaoption.hpp vanillaswap.cpp
vanillaswap.hpp
Log Message:
cap floor refactored
Index: pricingengines.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/pricingengines.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pricingengines.cpp 22 Jun 2006 16:58:04 -0000 1.6
--- pricingengines.cpp 26 Jun 2006 21:31:03 -0000 1.7
***************
*** 29,32 ****
--- 29,38 ----
}
+ BlackCapFloorEngine::BlackCapFloorEngine(
+ const QuantLib::Handle<QuantLib::CapletVolatilityStructure>& vol)
+ {
+ libraryObject_ = boost::shared_ptr<QuantLib::PricingEngine>(
+ new QuantLib::BlackCapFloorEngine(vol));
+ }
BlackCapFloorEngine::BlackCapFloorEngine(QuantLib::Volatility vol)
***************
*** 48,51 ****
--- 54,64 ----
}
+ AnalyticCapFloorEngine::AnalyticCapFloorEngine(
+ const boost::shared_ptr < QuantLib::AffineModel >& model) {
+
+ libraryObject_ = boost::shared_ptr<QuantLib::PricingEngine>(
+ new QuantLib::AnalyticCapFloorEngine(model));
+ }
+
}
Index: pricingengines.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/pricingengines.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pricingengines.hpp 22 Jun 2006 16:58:04 -0000 1.5
--- pricingengines.hpp 26 Jun 2006 21:31:03 -0000 1.6
***************
*** 24,27 ****
--- 24,29 ----
#include <ql/PricingEngines/Swaption/blackswaptionengine.hpp>
#include <ql/PricingEngines/CapFloor/blackcapfloorengine.hpp>
+ #include <ql/ShortRateModels/model.hpp>
+ #include <ql/PricingEngines/CapFloor/analyticcapfloorengine.hpp>
namespace QuantLibAddin {
***************
*** 38,46 ****
class BlackCapFloorEngine : public PricingEngine {
public:
! BlackCapFloorEngine::BlackCapFloorEngine(QuantLib::Volatility);
private:
boost::shared_ptr<QuantLib::SimpleQuote> quote_;
QuantLib::Handle<QuantLib::Quote> quoteHandle_;
};
}
--- 40,57 ----
class BlackCapFloorEngine : public PricingEngine {
public:
! BlackCapFloorEngine(QuantLib::Volatility);
! BlackCapFloorEngine(
! const QuantLib::Handle<QuantLib::CapletVolatilityStructure>&);
private:
boost::shared_ptr<QuantLib::SimpleQuote> quote_;
QuantLib::Handle<QuantLib::Quote> quoteHandle_;
};
+
+ class AnalyticCapFloorEngine : public ObjHandler::LibraryObject<QuantLib::PricingEngine> {
+ public:
+ AnalyticCapFloorEngine(
+ const boost::shared_ptr < QuantLib::AffineModel >& model);
+ };
+
}
Index: swaptionvolstructure.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** swaptionvolstructure.cpp 23 Jun 2006 17:53:29 -0000 1.5
--- swaptionvolstructure.cpp 26 Jun 2006 21:31:03 -0000 1.6
***************
*** 1,4 ****
--- 1,5 ----
/*
+ Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2006 Silvia Frasson
Index: capfloor.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/capfloor.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** capfloor.cpp 16 Jun 2006 17:37:16 -0000 1.4
--- capfloor.cpp 26 Jun 2006 21:31:03 -0000 1.5
***************
*** 1,4 ****
--- 1,5 ----
/*
+ Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2005 Plamen Neykov
Copyright (C) 2005 Aurelien Chanudet
***************
*** 20,58 ****
#include <qlo/config.hpp>
#endif
#include <qlo/capfloor.hpp>
- #include <qlo/couponvectors.hpp>
- #include <qlo/termstructures.hpp>
- #include <qlo/typefactory.hpp>
namespace QuantLibAddin {
CapFloor::CapFloor(
! const std::string& couponVectorID,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS,
! const std::vector<double>& capStrikes,
! const std::vector<double>& floorStrikes,
! const std::string& engineID,
! const QuantLib::CapFloor::Type& option) {
!
! OH_GET_REFERENCE(engine, engineID,
! AnalyticCapFloorEngine, QuantLib::PricingEngine)
!
! OH_GET_OBJECT(couponVectorWrapper, couponVectorID, CouponVector)
! const CashFlowVector& couponVector = couponVectorWrapper->getVector();
!
libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(
! new QuantLib::CapFloor(option,
! couponVector,
! capStrikes,
! floorStrikes,
! hYTS,
engine));
}
! AnalyticCapFloorEngine::AnalyticCapFloorEngine(
! const boost::shared_ptr < QuantLib::AffineModel >& model) {
!
! libraryObject_ = boost::shared_ptr<QuantLib::PricingEngine>(
! new QuantLib::AnalyticCapFloorEngine(model));
}
--- 21,54 ----
#include <qlo/config.hpp>
#endif
+
#include <qlo/capfloor.hpp>
namespace QuantLibAddin {
CapFloor::CapFloor(
! QuantLib::CapFloor::Type type,
! const boost::shared_ptr<CouponVector>& floatingLegWrapper,
! const std::vector<QuantLib::Rate>& capRates,
! const std::vector<QuantLib::Rate>& floorRates,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& termStructure,
! const boost::shared_ptr<QuantLib::PricingEngine>& engine)
! {
! const CashFlowVector& floatingLeg = floatingLegWrapper->getVector();
libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(
! new QuantLib::CapFloor(type,
! floatingLeg,
! capRates,
! floorRates,
! termStructure,
engine));
}
! std::vector<std::vector<double> > CapFloor::legAnalysis()
! {
! const boost::shared_ptr<QuantLib::CapFloor> temp =
! getLibraryObject<QuantLib::CapFloor>();
! const std::vector<boost::shared_ptr<QuantLib::CashFlow> >& cashflows =
! temp->floatingLeg();
! return flowAnalysis(cashflows);
}
Index: vanillaswap.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/vanillaswap.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** vanillaswap.hpp 22 Jun 2006 10:18:49 -0000 1.7
--- vanillaswap.hpp 26 Jun 2006 21:31:03 -0000 1.8
***************
*** 21,26 ****
#define qla_simpleswap_hpp
- #include <qlo/index.hpp>
- #include <ql/Instruments/vanillaswap.hpp>
#include <qlo/swap.hpp>
--- 21,24 ----
Index: vanillaswap.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/vanillaswap.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** vanillaswap.cpp 20 Jun 2006 09:44:18 -0000 1.6
--- vanillaswap.cpp 26 Jun 2006 21:31:03 -0000 1.7
***************
*** 25,33 ****
#include <qlo/vanillaswap.hpp>
! #include <qlo/termstructures.hpp>
! #include <qlo/typefactory.hpp>
! #include <ql/CashFlows/fixedratecoupon.hpp>
! #include <ql/CashFlows/parcoupon.hpp>
! #include <vector>
namespace QuantLibAddin {
--- 25,29 ----
#include <qlo/vanillaswap.hpp>
! #include <ql/Instruments/vanillaswap.hpp>
namespace QuantLibAddin {
Index: capfloor.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/capfloor.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** capfloor.hpp 16 Jun 2006 17:37:16 -0000 1.4
--- capfloor.hpp 26 Jun 2006 21:31:03 -0000 1.5
***************
*** 1,4 ****
--- 1,5 ----
/*
+ Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2005 Aurelien Chanudet
***************
*** 20,26 ****
#include <qlo/baseinstruments.hpp>
! #include <qlo/shortratemodels.hpp>
#include <ql/Instruments/capfloor.hpp>
- #include <ql/PricingEngines/CapFloor/analyticcapfloorengine.hpp>
namespace QuantLibAddin {
--- 21,26 ----
#include <qlo/baseinstruments.hpp>
! #include <qlo/couponvectors.hpp>
#include <ql/Instruments/capfloor.hpp>
namespace QuantLibAddin {
***************
*** 28,46 ****
class CapFloor : public Instrument {
public:
! CapFloor(
! const std::string& couponVectorID,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS,
! const std::vector<double>& capStrikes,
! const std::vector<double>& floorStrikes,
! const std::string& engineID,
! const QuantLib::CapFloor::Type& option);
};
- class AnalyticCapFloorEngine : public ObjHandler::LibraryObject<QuantLib::PricingEngine> {
- public:
- AnalyticCapFloorEngine(
- const boost::shared_ptr < QuantLib::AffineModel >& model);
- };
-
}
--- 28,41 ----
class CapFloor : public Instrument {
public:
! CapFloor(QuantLib::CapFloor::Type type,
! const boost::shared_ptr<CouponVector>& floatingLegWrapper,
! const std::vector<QuantLib::Rate>& capRates,
! const std::vector<QuantLib::Rate>& floorRates,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& termStructure,
! const boost::shared_ptr<QuantLib::PricingEngine>& engine);
!
! std::vector<std::vector<double> > legAnalysis();
};
}
Index: swaption.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaption.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** swaption.hpp 23 Jun 2006 10:35:49 -0000 1.4
--- swaption.hpp 26 Jun 2006 21:31:03 -0000 1.5
***************
*** 21,25 ****
#include <qlo/baseinstruments.hpp>
- #include <qlo/termstructures.hpp>
#include <ql/PricingEngines/Swaption/blackswaptionengine.hpp>
--- 21,24 ----
Index: swap.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swap.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** swap.cpp 20 Jun 2006 09:17:11 -0000 1.10
--- swap.cpp 26 Jun 2006 21:31:03 -0000 1.11
***************
*** 25,30 ****
#include <qlo/swap.hpp>
! #include <qlo/couponvectors.hpp>
! #include <ql/CashFlows/parcoupon.hpp>
namespace QuantLibAddin {
--- 25,29 ----
#include <qlo/swap.hpp>
! #include <ql/Instruments/swap.hpp>
namespace QuantLibAddin {
Index: vanillaoption.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/vanillaoption.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** vanillaoption.hpp 9 Jun 2006 18:58:47 -0000 1.3
--- vanillaoption.hpp 26 Jun 2006 21:31:03 -0000 1.4
***************
*** 20,25 ****
#include <qlo/baseinstruments.hpp>
- #include <qlo/processes.hpp>
#include <ql/Instruments/vanillaoption.hpp>
namespace QuantLibAddin {
--- 20,25 ----
#include <qlo/baseinstruments.hpp>
#include <ql/Instruments/vanillaoption.hpp>
+ #include <qlo/processes.hpp>
namespace QuantLibAddin {
Index: swap.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swap.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** swap.hpp 23 Jun 2006 10:35:49 -0000 1.8
--- swap.hpp 26 Jun 2006 21:31:03 -0000 1.9
***************
*** 25,30 ****
#include <qlo/baseinstruments.hpp>
#include <qlo/couponvectors.hpp>
- #include <qlo/termstructures.hpp>
- #include <ql/Instruments/swap.hpp>
namespace QuantLibAddin {
--- 25,28 ----
|