Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5265/qlo
Modified Files:
swaptionvolstructure.cpp swaptionvolstructure.hpp
Log Message:
work in progress ...
Index: swaptionvolstructure.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** swaptionvolstructure.cpp 5 Sep 2006 07:49:04 -0000 1.18
--- swaptionvolstructure.cpp 5 Sep 2006 08:28:33 -0000 1.19
***************
*** 169,174 ****
const boost::shared_ptr<QuantLib::SwaptionVolatilityCubeBySabr>
volCube = boost::dynamic_pointer_cast<QuantLib::SwaptionVolatilityCubeBySabr>(libraryObject_);
! sparseSabrParameters_=volCube->sparseSabrParameters();
! denseSabrParameters_=volCube->denseSabrParameters();
}
--- 169,176 ----
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();
}
***************
*** 206,208 ****
--- 208,243 ----
}
+ std::vector<std::vector<boost::any> > getVolCube(QuantLib::Matrix & volCube)
+ {
+ std::vector<std::vector<boost::any> > volatilityCube;
+ QuantLib::Size numberOfColumn = 11;
+
+ std::vector<boost::any> headings(numberOfColumn);
+ headings[0]=std::string("Swap Lenght");
+ headings[1]=std::string("Expiriy");
+
+ headings[2]=std::string("-200 bps");
+ headings[3]=std::string("-100 bps");
+ headings[4]=std::string("-50 bps");
+ headings[5]=std::string("-25 bps");
+ headings[6]=std::string("0 bps");
+ headings[7]=std::string("25 bps");
+ headings[8]=std::string("50 bps");
+ headings[9]=std::string("100 bps");
+ headings[10]=std::string("200 bps");
+
+ volatilityCube.push_back(headings);
+
+ for(QuantLib::Size i=0; i<volCube.rows(); i++)
+ {
+ std::vector<boost::any> vol(numberOfColumn, std::string("N/A"));
+ for(QuantLib::Size j=0; j<volCube.columns(); j++)
+ {
+ vol[j] = volCube[i][j];
+ }
+ volatilityCube.push_back(vol);
+ }
+ return volatilityCube;
+ }
+
}
Index: swaptionvolstructure.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaptionvolstructure.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** swaptionvolstructure.hpp 5 Sep 2006 07:49:04 -0000 1.16
--- swaptionvolstructure.hpp 5 Sep 2006 08:28:33 -0000 1.17
***************
*** 80,83 ****
--- 80,84 ----
std::vector<std::vector<boost::any> > getSabrParameters(QuantLib::Matrix & sabrParameters);
+ std::vector<std::vector<boost::any> > getVolCube(QuantLib::Matrix & volCube);
class SwaptionVolatilityCubeBySabr : public SwaptionVolatilityStructure {
***************
*** 108,114 ****
--- 109,125 ----
return getSabrParameters(denseSabrParameters_);
}
+ const std::vector<std::vector<boost::any> > getMarketVolCube()
+ {
+ return getVolCube(marketVolCube_);
+ }
+ const std::vector<std::vector<boost::any> > getVolCubeAtmCalibrated()
+ {
+ return getVolCube(volCubeAtmCalibrated_);
+ }
protected:
QuantLib::Matrix sparseSabrParameters_;
QuantLib::Matrix denseSabrParameters_;
+ QuantLib::Matrix marketVolCube_;
+ QuantLib::Matrix volCubeAtmCalibrated_;
};
|