Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5556/qlo
Added Files:
cmsmarket.cpp cmsmarket.hpp vo_cmsmarket.cpp vo_cmsmarket.hpp
Log Message:
Added files
--- NEW FILE: cmsmarket.hpp ---
/*
Copyright (C) 2006 Giorgio Facchinetti
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef qla_cmsmarket_hpp
#define qla_cmsmarket_hpp
#include <oh/objhandler.hpp>
#include <ql/swaptionvolstructure.hpp>
//#include <ql/Volatilities/swaptionvolcubebysabr.hpp>
#include <ql/Volatilities/cmsmarket.hpp>
#include <ql/termstructure.hpp>
#include <ql/CashFlows/conundrumpricer.hpp>
namespace QuantLibAddin {
class CmsMarket: public ObjHandler::LibraryObject<QuantLib::CmsMarket>{
public:
CmsMarket(
const std::vector<QuantLib::Period>& expiries,
const std::vector<QuantLib::Period>& lengths,
const QuantLib::Matrix& bidsAsks,
const QuantLib::Matrix& meanReversions,
const QuantLib::Handle<QuantLib::YieldTermStructure>& yieldTermStructure,
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& volStructure,
const std::string & typeOfVanillaCMSCouponPricer,
const QuantLib::GFunctionFactory::ModelOfYieldCurve modelOfYieldCurve);
};
}
#endif
--- NEW FILE: cmsmarket.cpp ---
/*
Copyright (C) 2006 Giorgio Facchinetti
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#if defined(HAVE_CONFIG_H)
#include <qlo/config.hpp>
#endif
#include <qlo/cmsmarket.hpp>
#include <qlo/couponvectors.hpp>
#include <qlo/termstructures.hpp>
#include <qlo/typefactory.hpp>
namespace QuantLibAddin {
CmsMarket::CmsMarket(
const std::vector<QuantLib::Period>& expiries,
const std::vector<QuantLib::Period>& lengths,
const QuantLib::Matrix& bidsAsks,
const QuantLib::Matrix& meanReversions,
const QuantLib::Handle<QuantLib::YieldTermStructure>& yieldTermStructure,
const QuantLib::Handle<QuantLib::SwaptionVolatilityStructure>& volStructure,
const std::string & typeOfVanillaCMSCouponPricer,
const QuantLib::GFunctionFactory::ModelOfYieldCurve modelOfYieldCurve) {
VanillaCMSCouponPricer vanillaCMSCouponPricer(typeOfVanillaCMSCouponPricer,modelOfYieldCurve);
boost::shared_ptr<QuantLib::VanillaCMSCouponPricer> pricer = vanillaCMSCouponPricer.underlyingObject();
libraryObject_ = boost::shared_ptr<QuantLib::CmsMarket>(
new QuantLib::CmsMarket(
expiries,
lengths,
bidsAsks,
meanReversions,
pricer,
yieldTermStructure,
volStructure));
}
}
--- NEW FILE: vo_cmsmarket.hpp ---
/*
Copyright (C) 2005, 2006 Plamen Neykov
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
// this file generated automatically by gensrc.py
// editing this file manually is not recommended
#ifndef qla_vo_cmsmarket_hpp
#define qla_vo_cmsmarket_hpp
#include <oh/valueobject.hpp>
#include <string>
#include <vector>
#include <boost/any.hpp>
namespace QuantLibAddin { namespace ValueObjects {
class qlCmsMarket : public ObjHandler::ValueObject {
public:
qlCmsMarket(
const std::string& objectID,
const std::vector<std::string>& expiries,
const std::vector<std::string>& swapLengths,
const std::vector<std::vector <double> >& bidsAsks,
const std::vector<std::vector <double> >& meanReversions,
const std::string& YTStructure,
const std::string& volStructure,
const std::string& VanillaCMSCouponPricerType,
const std::string& modelOfYieldCurve);
std::vector<std::string> getPropertyNames() const;
boost::any getProperty(const std::string& name) const;
protected:
static const char* mPropertyNames[];
std::string objectID_;
std::vector<std::string> expiries_;
std::vector<std::string> swapLengths_;
std::vector<std::vector <double> > bidsAsks_;
std::vector<std::vector <double> > meanReversions_;
std::string YTStructure_;
std::string volStructure_;
std::string VanillaCMSCouponPricerType_;
std::string modelOfYieldCurve_;
};
} }
#endif
--- NEW FILE: vo_cmsmarket.cpp ---
/*
Copyright (C) 2005, 2006 Plamen Neykov
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
// this file generated automatically by gensrc.py
// editing this file manually is not recommended
#include <qlo/qladdindefines.hpp>
#include <qlo/typefactory.hpp>
#include <qlo/conversions.hpp>
#include <qlo/cmsmarket.hpp>
#include <qlo/vo_cmsmarket.hpp>
namespace QuantLibAddin { namespace ValueObjects {
const char* qlCmsMarket::mPropertyNames[] = {
"objectID",
"expiries",
"swapLengths",
"bidsAsks",
"meanReversions",
"YTStructure",
"volStructure",
"VanillaCMSCouponPricerType",
"modelOfYieldCurve"};
std::vector<std::string> qlCmsMarket::getPropertyNames() const {
return std::vector<std::string>(
mPropertyNames, mPropertyNames + sizeof(mPropertyNames)/sizeof(const char*));
}
boost::any qlCmsMarket::getProperty(const std::string& name) const {
if(name == "objectID") return objectID_;
else if(name == "expiries") return expiries_;
else if(name == "swapLengths") return swapLengths_;
else if(name == "bidsAsks") return bidsAsks_;
else if(name == "meanReversions") return meanReversions_;
else if(name == "YTStructure") return YTStructure_;
else if(name == "volStructure") return volStructure_;
else if(name == "VanillaCMSCouponPricerType") return VanillaCMSCouponPricerType_;
else if(name == "modelOfYieldCurve") return modelOfYieldCurve_;
else
throw ObjHandler::Exception("Error: attempt to retrieve non-existent Property: '" + name + "'");
return boost::any(); /* Dummy return - just to avoid stupid compiler warnings/errors */
}
qlCmsMarket::qlCmsMarket(
const std::string& objectID,
const std::vector<std::string>& expiries,
const std::vector<std::string>& swapLengths,
const std::vector<std::vector <double> >& bidsAsks,
const std::vector<std::vector <double> >& meanReversions,
const std::string& YTStructure,
const std::string& volStructure,
const std::string& VanillaCMSCouponPricerType,
const std::string& modelOfYieldCurve) :
objectID_(objectID),
expiries_(expiries),
swapLengths_(swapLengths),
bidsAsks_(bidsAsks),
meanReversions_(meanReversions),
YTStructure_(YTStructure),
volStructure_(volStructure),
VanillaCMSCouponPricerType_(VanillaCMSCouponPricerType),
modelOfYieldCurve_(modelOfYieldCurve) {}
} }
|