Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6411/qlo
Modified Files:
.cvsignore
Added Files:
enumclassctors.cpp enumclassctors.hpp
Removed Files:
enumclassregistry.cpp
Log Message:
autogenerate source for enumerated classes
Index: .cvsignore
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/.cvsignore,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** .cvsignore 29 Jun 2006 16:52:12 -0000 1.11
--- .cvsignore 2 Jul 2006 15:50:26 -0000 1.12
***************
*** 8,11 ****
--- 8,12 ----
stamp-h1
enumtyperegistry.cpp
+ enumclassregistry.cpp
qladdin.hpp
vo_bonds.*pp
--- enumclassregistry.cpp DELETED ---
--- NEW FILE: enumclassctors.cpp ---
/*
Copyright (C) 2005 Plamen Neykov
Copyright (C) 2006 Eric Ehlers
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/enumclassctors.hpp>
namespace QuantLibAddin {
/* *** StrikedTypePayoff - strike only *** */
boost::shared_ptr<QuantLib::StrikedTypePayoff> VANILLA_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike) {
return boost::shared_ptr<QuantLib::StrikedTypePayoff> (
new QuantLib::PlainVanillaPayoff(optionType, strike));
}
boost::shared_ptr<QuantLib::StrikedTypePayoff> ASSETORNOTHING_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike) {
return boost::shared_ptr<QuantLib::StrikedTypePayoff> (
new QuantLib::AssetOrNothingPayoff(optionType, strike));
}
boost::shared_ptr<QuantLib::StrikedTypePayoff> PERCENTAGESTRIKE_Payoff(
const QuantLib::Option::Type& optionType,
const double &moneyness) {
return boost::shared_ptr<QuantLib::StrikedTypePayoff> (
new QuantLib::PercentageStrikePayoff(optionType, moneyness));
}
/* *** StrikedTypePayoff - strike & strikeIncrement *** */
boost::shared_ptr<QuantLib::StrikedTypePayoff> SUPERSHARE_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike,
const double &strikeIncrement) {
return boost::shared_ptr<QuantLib::StrikedTypePayoff> (
new QuantLib::SuperSharePayoff(optionType, strike, strikeIncrement));
}
boost::shared_ptr<QuantLib::StrikedTypePayoff> CASHORNOTHING_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike,
const double &strikeIncrement) {
return boost::shared_ptr<QuantLib::StrikedTypePayoff> (
new QuantLib::CashOrNothingPayoff(optionType, strike, strikeIncrement));
}
boost::shared_ptr<QuantLib::StrikedTypePayoff> GAP_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike,
const double &strikeIncrement) {
return boost::shared_ptr<QuantLib::StrikedTypePayoff> (
new QuantLib::GapPayoff(optionType, strike, strikeIncrement));
}
/* *** PricingEngine - without timesteps *** */
boost::shared_ptr<QuantLib::PricingEngine> AB_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticBarrierEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> AC_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticCliquetEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> ACGAPA_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticContinuousGeometricAveragePriceAsianEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> ADA_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticDigitalAmericanEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> ADGAPA_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticDiscreteGeometricAveragePriceAsianEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> ADE_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticDividendEuropeanEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> AE_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticEuropeanEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> AP_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::AnalyticPerformanceEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> BAWA_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BaroneAdesiWhaleyApproximationEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> I_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::IntegralEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> BSA_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BjerksundStenslandApproximationEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> PE_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine>();
}
boost::shared_ptr<QuantLib::PricingEngine> SE_Engine() {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::StulzEngine);
}
boost::shared_ptr<QuantLib::PricingEngine> FE_Engine() {
boost::shared_ptr<QuantLib::VanillaOption::engine>
underlyingEngine(new QuantLib::AnalyticEuropeanEngine);
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::ForwardEngine<QuantLib::VanillaOption::arguments,
QuantLib::VanillaOption::results>(underlyingEngine));
}
boost::shared_ptr<QuantLib::PricingEngine> FPE_Engine() {
boost::shared_ptr<QuantLib::VanillaOption::engine>
underlyingEngine(new QuantLib::AnalyticEuropeanEngine);
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::ForwardPerformanceEngine
<QuantLib::VanillaOption::arguments,
QuantLib::VanillaOption::results>(underlyingEngine));
}
boost::shared_ptr<QuantLib::PricingEngine> QE_Engine() {
boost::shared_ptr<QuantLib::VanillaOption::engine>
underlyingEngine(new QuantLib::AnalyticEuropeanEngine);
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::QuantoEngine<QuantLib::VanillaOption::arguments,
QuantLib::VanillaOption::results>(underlyingEngine));
}
boost::shared_ptr<QuantLib::PricingEngine> QFE_Engine() {
boost::shared_ptr<QuantLib::VanillaOption::engine>
underlyingEngine(new QuantLib::AnalyticEuropeanEngine);
boost::shared_ptr<QuantLib::ForwardVanillaOption::engine> forwardEngine(
new QuantLib::ForwardEngine<QuantLib::VanillaOption::arguments,
QuantLib::VanillaOption::results>(underlyingEngine));
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::QuantoEngine<QuantLib::ForwardVanillaOption::arguments,
QuantLib::ForwardVanillaOption::results>(forwardEngine));
}
/* *** PricingEngine - with timesteps *** */
boost::shared_ptr<QuantLib::PricingEngine> AEQPB_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BinomialVanillaEngine<QuantLib::AdditiveEQPBinomialTree>(timeSteps));
}
boost::shared_ptr<QuantLib::PricingEngine> CRR_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BinomialVanillaEngine<QuantLib::CoxRossRubinstein>(timeSteps));
}
boost::shared_ptr<QuantLib::PricingEngine> FDA_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::FDAmericanEngine(timeSteps, timeSteps-1));
}
boost::shared_ptr<QuantLib::PricingEngine> FDE_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::FDEuropeanEngine(timeSteps, timeSteps-1));
}
boost::shared_ptr<QuantLib::PricingEngine> FDB_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::FDBermudanEngine(timeSteps, timeSteps-1));
}
boost::shared_ptr<QuantLib::PricingEngine> JR_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BinomialVanillaEngine<QuantLib::JarrowRudd>(timeSteps));
}
boost::shared_ptr<QuantLib::PricingEngine> LR_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BinomialVanillaEngine<QuantLib::LeisenReimer>(timeSteps));
}
boost::shared_ptr<QuantLib::PricingEngine> TIAN_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BinomialVanillaEngine<QuantLib::Tian>(timeSteps));
}
boost::shared_ptr<QuantLib::PricingEngine> TRI_Engine(const long& timeSteps) {
return boost::shared_ptr<QuantLib::PricingEngine> (
new QuantLib::BinomialVanillaEngine<QuantLib::Trigeorgis>(timeSteps));
}
/* *** Extrapolator - 1D *** */
boost::shared_ptr<QuantLib::Extrapolator> LinearInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin) {
return boost::shared_ptr<QuantLib::Extrapolator>(
new QuantLib::LinearInterpolation(
xBegin, xEnd, yBegin));
}
boost::shared_ptr<QuantLib::Extrapolator> BackwardFlatInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin) {
return boost::shared_ptr<QuantLib::Extrapolator>(
new QuantLib::BackwardFlatInterpolation(
xBegin, xEnd, yBegin));
}
boost::shared_ptr<QuantLib::Extrapolator> ForwardFlatInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin) {
return boost::shared_ptr<QuantLib::Extrapolator>(
new QuantLib::ForwardFlatInterpolation(
xBegin, xEnd, yBegin));
}
/* *** Extrapolator - 2D *** */
boost::shared_ptr<QuantLib::Extrapolator> BilinearInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin, dbl_itr& yEnd,
const QuantLib::Matrix& zData) {
return boost::shared_ptr<QuantLib::Extrapolator>(
new QuantLib::BilinearInterpolation(
xBegin, xEnd, yBegin, yEnd, zData));
}
boost::shared_ptr<QuantLib::Extrapolator> BicubicSpline_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin, dbl_itr& yEnd,
const QuantLib::Matrix& zData) {
return boost::shared_ptr<QuantLib::Extrapolator>(
new QuantLib::BicubicSpline(
xBegin, xEnd, yBegin, yEnd, zData));
}
}
--- NEW FILE: enumclassctors.hpp ---
/*
Copyright (C) 2005 Plamen Neykov
Copyright (C) 2006 Eric Ehlers
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_enumclassctors_hpp
#define qla_enumclassctors_hpp
#include <qlo/typefactory.hpp>
#include <ql/option.hpp>
#include <ql/Instruments/payoffs.hpp>
#include <ql/Instruments/quantoforwardvanillaoption.hpp>
#include <ql/PricingEngines/all.hpp>
#include <ql/Math/backwardflatinterpolation.hpp>
#include <ql/Math/forwardflatinterpolation.hpp>
#include <ql/Math/linearinterpolation.hpp>
#include <ql/Math/bilinearinterpolation.hpp>
#include <ql/Math/bicubicsplineinterpolation.hpp>
namespace QuantLibAddin {
/* *** StrikedTypePayoff - strike only *** */
boost::shared_ptr<QuantLib::StrikedTypePayoff> VANILLA_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike);
boost::shared_ptr<QuantLib::StrikedTypePayoff> ASSETORNOTHING_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike);
boost::shared_ptr<QuantLib::StrikedTypePayoff> PERCENTAGESTRIKE_Payoff(
const QuantLib::Option::Type& optionType,
const double &moneyness);
/* *** StrikedTypePayoff - strike & strikeIncrement *** */
boost::shared_ptr<QuantLib::StrikedTypePayoff> SUPERSHARE_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike,
const double &strikeIncrement);
boost::shared_ptr<QuantLib::StrikedTypePayoff> CASHORNOTHING_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike,
const double &strikeIncrement);
boost::shared_ptr<QuantLib::StrikedTypePayoff> GAP_Payoff(
const QuantLib::Option::Type& optionType,
const double &strike,
const double &strikeIncrement);
/* *** PricingEngine - without timesteps *** */
boost::shared_ptr<QuantLib::PricingEngine> AB_Engine();
boost::shared_ptr<QuantLib::PricingEngine> AC_Engine();
boost::shared_ptr<QuantLib::PricingEngine> ACGAPA_Engine();
boost::shared_ptr<QuantLib::PricingEngine> ADA_Engine();
boost::shared_ptr<QuantLib::PricingEngine> ADGAPA_Engine();
boost::shared_ptr<QuantLib::PricingEngine> ADE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> AE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> AP_Engine();
boost::shared_ptr<QuantLib::PricingEngine> BAWA_Engine();
boost::shared_ptr<QuantLib::PricingEngine> I_Engine();
boost::shared_ptr<QuantLib::PricingEngine> BSA_Engine();
boost::shared_ptr<QuantLib::PricingEngine> PE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> SE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> FE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> FPE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> QE_Engine();
boost::shared_ptr<QuantLib::PricingEngine> QFE_Engine();
/* *** PricingEngine - with timesteps *** */
boost::shared_ptr<QuantLib::PricingEngine> AEQPB_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> CRR_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> FDA_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> FDE_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> FDB_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> JR_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> LR_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> TIAN_Engine(const long& timeSteps);
boost::shared_ptr<QuantLib::PricingEngine> TRI_Engine(const long& timeSteps);
/* *** Extrapolator - 1D *** */
boost::shared_ptr<QuantLib::Extrapolator> LinearInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin);
boost::shared_ptr<QuantLib::Extrapolator> BackwardFlatInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin);
boost::shared_ptr<QuantLib::Extrapolator> ForwardFlatInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin);
/* *** Extrapolator - 2D *** */
boost::shared_ptr<QuantLib::Extrapolator> BilinearInterpolation_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin, dbl_itr& yEnd,
const QuantLib::Matrix& zData);
boost::shared_ptr<QuantLib::Extrapolator> BicubicSpline_Extrapolator(
dbl_itr& xBegin, dbl_itr& xEnd, dbl_itr& yBegin, dbl_itr& yEnd,
const QuantLib::Matrix& zData);
}
#endif
|