Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6155/qlo
Modified Files:
swaptionvolstructure.cpp swaptionvolstructure.hpp
Log Message:
SmileSection first refactoring
Index: swaptionvolstructure.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** swaptionvolstructure.cpp 23 Oct 2006 13:57:33 -0000 1.35
--- swaptionvolstructure.cpp 23 Oct 2006 18:31:11 -0000 1.36
***************
*** 234,238 ****
}
! SmileSection::SmileSection(
const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>& cubeBySabr,
const double expiry,
--- 234,238 ----
}
! SabrSmileSection::SabrSmileSection(
const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>& cubeBySabr,
const double expiry,
***************
*** 241,255 ****
}
! SmileSection::SmileSection(
double expiryTime,
const std::vector<double>& strikes,
const std::vector<double>& volatilities){
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSection>(
! new QuantLib::SmileSection(expiryTime,
strikes,
volatilities));
}
! SmileSection::SmileSection(
double expiryTime,
double flatVolatility){
--- 241,255 ----
}
! InterpolatedSmileSection::InterpolatedSmileSection(
double expiryTime,
const std::vector<double>& strikes,
const std::vector<double>& volatilities){
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSectionInterface>(
! new QuantLib::InterpolatedSmileSection(expiryTime,
strikes,
volatilities));
}
! InterpolatedSmileSection::InterpolatedSmileSection(
double expiryTime,
double flatVolatility){
***************
*** 260,265 ****
}
const std::vector<double> volatilities = std::vector<double>(n, flatVolatility);
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSection>(
! new QuantLib::SmileSection(expiryTime,
fictitiousStrikes,
volatilities));
--- 260,265 ----
}
const std::vector<double> volatilities = std::vector<double>(n, flatVolatility);
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSectionInterface>(
! new QuantLib::InterpolatedSmileSection(expiryTime,
fictitiousStrikes,
volatilities));
Index: swaptionvolstructure.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.hpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** swaptionvolstructure.hpp 18 Oct 2006 13:48:53 -0000 1.30
--- swaptionvolstructure.hpp 23 Oct 2006 18:31:11 -0000 1.31
***************
*** 121,144 ****
};
! class SmileSection: public ObjHandler::LibraryObject<QuantLib::SmileSection>{
! public:
! SmileSection(
! const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>& cubeBySabr,
! const double expiry,
! const double length);
! SmileSection(
double expiryTime,
const std::vector<double>& strikes,
const std::vector<double>& volatilities);
!
! SmileSection(
double expiryTime,
double flatVolatility);
};
-
}
#endif
-
--- 121,147 ----
};
! class SmileSectionInterface : public ObjHandler::LibraryObject<QuantLib::SmileSectionInterface> {
! };
! class InterpolatedSmileSection : public SmileSectionInterface {
! public:
! InterpolatedSmileSection(
double expiryTime,
const std::vector<double>& strikes,
const std::vector<double>& volatilities);
! InterpolatedSmileSection(
double expiryTime,
double flatVolatility);
};
+ class SabrSmileSection : public SmileSectionInterface {
+ public:
+ SabrSmileSection(
+ const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>& cubeBySabr,
+ const double expiry,
+ const double length);
+ };
+
}
#endif
|