Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28332/qlo
Modified Files:
swaption.cpp swaption.hpp
Added Files:
pricingengines.cpp pricingengines.hpp
Removed Files:
fixedcouponbond.cpp fixedcouponbond.hpp instruments.hpp
pricingengine.hpp zerocouponbond.cpp zerocouponbond.hpp
Log Message:
1) doc projects renamed
2) obsolete files removed
3) introduced proper PricingEngine Object and files
--- NEW FILE: pricingengines.cpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
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.
*/
#include <qlo/pricingengines.hpp>
namespace QuantLibAddin {
BlackSwaptionEngine::BlackSwaptionEngine(
QuantLib::Volatility vol,
const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS)
{
boost::shared_ptr<QuantLib::Quote> vol_q(
new QuantLib::SimpleQuote(vol));
QuantLib::Handle<QuantLib::Quote> vol_hq(vol_q);
boost::shared_ptr<QuantLib::BlackModel> model(
new QuantLib::BlackModel(vol_hq, hYTS));
boost::shared_ptr<QuantLib::PricingEngine> eng(
new QuantLib::BlackSwaptionEngine(model));
libraryObject_ = boost::shared_ptr<QuantLib::PricingEngine>(
new QuantLib::BlackSwaptionEngine(model));
}
}
--- fixedcouponbond.cpp DELETED ---
--- fixedcouponbond.hpp DELETED ---
--- NEW FILE: pricingengines.hpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2006 Cristina Duminuco
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_pricingengine_hpp
#define qla_pricingengine_hpp
#include <oh/objhandler.hpp>
#include <ql/pricingengine.hpp>
#include <ql/PricingEngines/Swaption/blackswaptionengine.hpp>
namespace QuantLibAddin {
class PricingEngine : public ObjHandler::LibraryObject<QuantLib::PricingEngine> {
};
class BlackSwaptionEngine : public PricingEngine {
public:
BlackSwaptionEngine(
QuantLib::Volatility vol,
const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS);
};
}
#endif
Index: swaption.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaption.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** swaption.cpp 19 Jun 2006 14:18:01 -0000 1.1
--- swaption.cpp 20 Jun 2006 10:05:09 -0000 1.2
***************
*** 28,49 ****
Swaption::Swaption(const boost::shared_ptr<QuantLib::VanillaSwap>& swap,
const boost::shared_ptr<QuantLib::Exercise>& exercise,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS
! //,
! //const boost::shared_ptr<QuantLib::BlackSwaptionEngine>& engine
! )
{
- boost::shared_ptr<QuantLib::Quote> vol_me(
- new QuantLib::SimpleQuote(0.2));
- QuantLib::Handle<QuantLib::Quote> vol_rh(vol_me);
- boost::shared_ptr<QuantLib::BlackModel> model(
- new QuantLib::BlackModel(vol_rh, hYTS));
- boost::shared_ptr<QuantLib::PricingEngine> eng(
- new QuantLib::BlackSwaptionEngine(model));
-
libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(
! new QuantLib::Swaption(swap, exercise, hYTS, eng));
}
-
}
-
--- 28,37 ----
Swaption::Swaption(const boost::shared_ptr<QuantLib::VanillaSwap>& swap,
const boost::shared_ptr<QuantLib::Exercise>& exercise,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS,
! const boost::shared_ptr<QuantLib::BlackSwaptionEngine>& engine)
{
libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(
! new QuantLib::Swaption(swap, exercise, hYTS, engine));
}
}
--- zerocouponbond.hpp DELETED ---
Index: swaption.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/swaption.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** swaption.hpp 19 Jun 2006 14:18:01 -0000 1.1
--- swaption.hpp 20 Jun 2006 10:05:09 -0000 1.2
***************
*** 30,37 ****
Swaption(const boost::shared_ptr<QuantLib::VanillaSwap>& swap,
const boost::shared_ptr<QuantLib::Exercise>& exercise,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS
! //,
! //const boost::shared_ptr<QuantLib::BlackSwaptionEngine>& engine
! );
std::string underlyingSwap()
{
--- 30,35 ----
Swaption(const boost::shared_ptr<QuantLib::VanillaSwap>& swap,
const boost::shared_ptr<QuantLib::Exercise>& exercise,
! const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS,
! const boost::shared_ptr<QuantLib::BlackSwaptionEngine>& engine);
std::string underlyingSwap()
{
--- pricingengine.hpp DELETED ---
--- zerocouponbond.cpp DELETED ---
--- instruments.hpp DELETED ---
|