Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26080/qlo
Modified Files:
index.cpp ratehelpers.cpp schedule.cpp
swaptionvolstructure.cpp swaptionvolstructure.hpp
vanillaoption.cpp
Log Message:
1) swaptionvolcube refactoring
2) PLEASE AVOID USELESS INCLUSIONS!!!!!!!
Index: index.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/index.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** index.cpp 31 Oct 2006 11:54:17 -0000 1.16
--- index.cpp 2 Nov 2006 08:35:31 -0000 1.17
***************
*** 24,28 ****
#include <qlo/index.hpp>
- #include <qlo/typefactory.hpp>
#include <ql/Indexes/swapindex.hpp>
--- 24,27 ----
Index: vanillaoption.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/vanillaoption.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** vanillaoption.cpp 17 Oct 2006 10:31:13 -0000 1.11
--- vanillaoption.cpp 2 Nov 2006 08:35:31 -0000 1.12
***************
*** 20,24 ****
#endif
#include <qlo/vanillaoption.hpp>
- #include <qlo/typefactory.hpp>
#include <qlo/exercise.hpp>
--- 20,23 ----
***************
*** 26,39 ****
VanillaOption::VanillaOption(
! const boost::shared_ptr < QuantLib::GeneralizedBlackScholesProcess > &blackScholesProcess,
! const boost::shared_ptr<QuantLib::StrikedTypePayoff> &payoff,
! const boost::shared_ptr < QuantLib::Exercise > &exercise,
! const boost::shared_ptr<QuantLib::PricingEngine> &pricingEngine) {
! libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(
! new QuantLib::VanillaOption(
! blackScholesProcess,
! payoff,
! exercise,
! pricingEngine));
}
}
--- 25,37 ----
VanillaOption::VanillaOption(
! const boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess>& blackScholesProcess,
! const boost::shared_ptr<QuantLib::StrikedTypePayoff>& payoff,
! const boost::shared_ptr<QuantLib::Exercise>& exercise,
! const boost::shared_ptr<QuantLib::PricingEngine>& pricingEngine) {
! libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(new
! QuantLib::VanillaOption(blackScholesProcess,
! payoff,
! exercise,
! pricingEngine));
}
}
Index: schedule.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/schedule.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** schedule.cpp 3 Oct 2006 18:23:59 -0000 1.6
--- schedule.cpp 2 Nov 2006 08:35:31 -0000 1.7
***************
*** 21,25 ****
#endif
#include <qlo/schedule.hpp>
- #include <qlo/typefactory.hpp>
namespace QuantLibAddin {
--- 21,24 ----
***************
*** 37,54 ****
const QuantLib::Date& nextToLastDate) {
! libraryObject_ = boost::shared_ptr<QuantLib::Schedule>(
! new QuantLib::Schedule(effectiveDate,
! terminationDate,
! tenor,
! calendar,
! convention,
! terminationDateConvention,
! backward,
! endOfMonth,
! firstDate,
! nextToLastDate));
!
}
-
}
--- 36,51 ----
const QuantLib::Date& nextToLastDate) {
! libraryObject_ = boost::shared_ptr<QuantLib::Schedule>(new
! QuantLib::Schedule(effectiveDate,
! terminationDate,
! tenor,
! calendar,
! convention,
! terminationDateConvention,
! backward,
! endOfMonth,
! firstDate,
! nextToLastDate));
}
}
Index: swaptionvolstructure.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.hpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** swaptionvolstructure.hpp 31 Oct 2006 11:04:43 -0000 1.34
--- swaptionvolstructure.hpp 2 Nov 2006 08:35:31 -0000 1.35
***************
*** 64,69 ****
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
! const QuantLib::Calendar& calendar,
! const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase);
};
--- 64,69 ----
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
! const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase,
! bool vegaWeightedSmileFit);
};
***************
*** 72,76 ****
class SwaptionVolatilityCubeBySabr : public SwaptionVolatilityCube {
! public:
SwaptionVolatilityCubeBySabr(
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& atmVol,
--- 72,76 ----
class SwaptionVolatilityCubeBySabr : public SwaptionVolatilityCube {
! public:
SwaptionVolatilityCubeBySabr(
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& atmVol,
***************
*** 79,89 ****
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
- const QuantLib::Calendar& calendar,
const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase,
const QuantLib::Matrix& parametersGuess,
std::vector<bool> isParameterFixed,
! bool isVegaWeighted,
! bool isAtmCalibrated
! );
const std::vector<std::vector<boost::any> > getSparseSabrParameters()
--- 79,87 ----
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase,
+ bool vegaWeightedSmileFit,
const QuantLib::Matrix& parametersGuess,
std::vector<bool> isParameterFixed,
! bool isAtmCalibrated);
const std::vector<std::vector<boost::any> > getSparseSabrParameters()
***************
*** 103,107 ****
return getVolCube(volCubeAtmCalibrated_);
}
! protected:
QuantLib::Matrix sparseSabrParameters_;
QuantLib::Matrix denseSabrParameters_;
--- 101,105 ----
return getVolCube(volCubeAtmCalibrated_);
}
! protected:
QuantLib::Matrix sparseSabrParameters_;
QuantLib::Matrix denseSabrParameters_;
Index: swaptionvolstructure.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** swaptionvolstructure.cpp 31 Oct 2006 11:04:43 -0000 1.39
--- swaptionvolstructure.cpp 2 Nov 2006 08:35:31 -0000 1.40
***************
*** 77,92 ****
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
! const QuantLib::Calendar& calendar,
! const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase)
{
QL_REQUIRE(!atmVol.empty(), "atm vol handle not linked to anything");
libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
QuantLib::SwaptionVolatilityCubeByLinear(atmVol,
! expiries,
! lengths,
! strikeSpreads,
! volSpreads,
! calendar,
! swapIndexBase));
}
--- 77,92 ----
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
! const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase,
! bool vegaWeightedSmileFit)
{
QL_REQUIRE(!atmVol.empty(), "atm vol handle not linked to anything");
libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
QuantLib::SwaptionVolatilityCubeByLinear(atmVol,
! expiries,
! lengths,
! strikeSpreads,
! volSpreads,
! swapIndexBase,
! vegaWeightedSmileFit));
}
***************
*** 97,129 ****
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
- const QuantLib::Calendar& calendar,
const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase,
const QuantLib::Matrix& parametersGuess,
std::vector<bool> isParameterFixed,
! bool isVegaWeighted,
! bool isAtmCalibrated
! ) {
! libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
! QuantLib::SwaptionVolatilityCubeBySabr(atmVol,
! expiries,
! lengths,
! strikeSpreads,
! volSpreads,
! calendar,
! swapIndexBase,
! parametersGuess,
! isParameterFixed,
! isVegaWeighted,
! isAtmCalibrated
! ));
!
! const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>
! volCube = boost::dynamic_pointer_cast<QuantLib::SwaptionVolatilityCubeBySabr>(libraryObject_);
! sparseSabrParameters_ = volCube->sparseSabrParameters();
! denseSabrParameters_ = volCube->denseSabrParameters();
! marketVolCube_ = volCube->marketVolCube();
! volCubeAtmCalibrated_ = volCube->volCubeAtmCalibrated();
}
--- 97,126 ----
const std::vector<QuantLib::Spread>& strikeSpreads,
const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >& volSpreads,
const boost::shared_ptr<QuantLib::SwapIndex>& swapIndexBase,
+ bool vegaWeightedSmileFit,
const QuantLib::Matrix& parametersGuess,
std::vector<bool> isParameterFixed,
! bool isAtmCalibrated)
! {
! libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
! QuantLib::SwaptionVolatilityCubeBySabr(atmVol,
! expiries,
! lengths,
! strikeSpreads,
! volSpreads,
! swapIndexBase,
! vegaWeightedSmileFit,
! parametersGuess,
! isParameterFixed,
! isAtmCalibrated));
! const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>
! volCube = boost::dynamic_pointer_cast<QuantLib::SwaptionVolatilityCubeBySabr>(libraryObject_);
!
! sparseSabrParameters_ = volCube->sparseSabrParameters();
! denseSabrParameters_ = volCube->denseSabrParameters();
! marketVolCube_ = volCube->marketVolCube();
! volCubeAtmCalibrated_ = volCube->volCubeAtmCalibrated();
}
Index: ratehelpers.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/ratehelpers.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ratehelpers.cpp 11 Oct 2006 11:46:31 -0000 1.10
--- ratehelpers.cpp 2 Nov 2006 08:35:31 -0000 1.11
***************
*** 24,33 ****
#include <oh/objhandlerdefines.hpp>
#include <qlo/ratehelpers.hpp>
- #include <qlo/typefactory.hpp>
#include <ql/date.hpp>
- #include <ql/Math/cubicspline.hpp>
- #include <ql/TermStructures/discountcurve.hpp>
- #include <ql/TermStructures/forwardcurve.hpp>
namespace QuantLibAddin {
--- 24,29 ----
|