Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8406/qlo
Modified Files:
cmsmarket.cpp cmsmarket.hpp vo_cmsmarket.cpp vo_cmsmarket.hpp
Log Message:
Index: cmsmarket.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/cmsmarket.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cmsmarket.hpp 12 Sep 2006 15:08:11 -0000 1.2
--- cmsmarket.hpp 12 Sep 2006 16:14:29 -0000 1.3
***************
*** 50,54 ****
protected:
QuantLib::Matrix cmsMarket_;
! };
}
--- 50,63 ----
protected:
QuantLib::Matrix cmsMarket_;
! };
!
! class SmileAndCmsCalibrationBySabr: public ObjHandler::LibraryObject<QuantLib::SmileAndCmsCalibrationBySabr>{
! public:
! SmileAndCmsCalibrationBySabr::SmileAndCmsCalibrationBySabr(
! QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& volCube,
! boost::shared_ptr<QuantLib::CmsMarket>& cmsMarket,
! const QuantLib::Matrix& weights);
!
! };
}
Index: cmsmarket.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/cmsmarket.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cmsmarket.cpp 12 Sep 2006 15:08:11 -0000 1.2
--- cmsmarket.cpp 12 Sep 2006 16:14:29 -0000 1.3
***************
*** 79,81 ****
--- 79,94 ----
return result;
}
+
+
+ SmileAndCmsCalibrationBySabr::SmileAndCmsCalibrationBySabr(
+ QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& volCube,
+ boost::shared_ptr<QuantLib::CmsMarket>& cmsMarket,
+ const QuantLib::Matrix& weights){
+
+ libraryObject_ = boost::shared_ptr<QuantLib::SmileAndCmsCalibrationBySabr>(
+ new QuantLib::SmileAndCmsCalibrationBySabr(
+ volCube,
+ cmsMarket,
+ weights));
+ }
}
Index: vo_cmsmarket.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/vo_cmsmarket.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** vo_cmsmarket.hpp 12 Sep 2006 09:38:25 -0000 1.1
--- vo_cmsmarket.hpp 12 Sep 2006 16:14:29 -0000 1.2
***************
*** 59,62 ****
--- 59,82 ----
};
+ class qlSmileAndCmsCalibrationBySabr : public ObjHandler::ValueObject {
+ public:
+ qlSmileAndCmsCalibrationBySabr(
+ const std::string& objectID,
+ const std::string& volCube,
+ const std::string& cmsMarketID,
+ const std::vector<std::vector <double> >& weights);
+
+ std::vector<std::string> getPropertyNames() const;
+
+ boost::any getProperty(const std::string& name) const;
+
+ protected:
+ static const char* mPropertyNames[];
+ std::string objectID_;
+ std::string volCube_;
+ std::string cmsMarketID_;
+ std::vector<std::vector <double> > weights_;
+ };
+
} }
Index: vo_cmsmarket.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/vo_cmsmarket.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** vo_cmsmarket.cpp 12 Sep 2006 09:38:25 -0000 1.1
--- vo_cmsmarket.cpp 12 Sep 2006 16:14:29 -0000 1.2
***************
*** 79,82 ****
--- 79,114 ----
modelOfYieldCurve_(modelOfYieldCurve) {}
+ const char* qlSmileAndCmsCalibrationBySabr::mPropertyNames[] = {
+ "objectID",
+ "volCube",
+ "cmsMarketID",
+ "weights"};
+
+ std::vector<std::string> qlSmileAndCmsCalibrationBySabr::getPropertyNames() const {
+ return std::vector<std::string>(
+ mPropertyNames, mPropertyNames + sizeof(mPropertyNames)/sizeof(const char*));
+ }
+
+ boost::any qlSmileAndCmsCalibrationBySabr::getProperty(const std::string& name) const {
+ if(name == "objectID") return objectID_;
+ else if(name == "volCube") return volCube_;
+ else if(name == "cmsMarketID") return cmsMarketID_;
+ else if(name == "weights") return weights_;
+ else
+ throw ObjHandler::Exception("Error: attempt to retrieve non-existent Property: '" + name + "'");
+
+ return boost::any(); /* Dummy return - just to avoid stupid compiler warnings/errors */
+ }
+
+ qlSmileAndCmsCalibrationBySabr::qlSmileAndCmsCalibrationBySabr(
+ const std::string& objectID,
+ const std::string& volCube,
+ const std::string& cmsMarketID,
+ const std::vector<std::vector <double> >& weights) :
+ objectID_(objectID),
+ volCube_(volCube),
+ cmsMarketID_(cmsMarketID),
+ weights_(weights) {}
+
} }
|