hasquant-0.5.0.2: cbits/qlaux.h
#include <ql/time/date.hpp>
#include <ql/errors.hpp>
#include <string.h>
#include <vector>
#include <boost/optional.hpp>
#include <ql/math/matrix.hpp>
#include <ql/instruments/varianceswap.hpp>
// SabrSwaptionVolatilityCube is a typedef of a template instantiation
// (XabrSwaptionVolatilityCube<SwaptionVolCubeSabrModel>), not an ordinary class -- it cannot be
// forward-declared the way every other type below is, so its full header is pulled in here
// instead. InterpolatedSwaptionVolatilityCube is an ordinary class and stays forward-declared.
#include <ql/termstructures/volatility/swaption/sabrswaptionvolatilitycube.hpp>
int *qlAllocateInts(size_t size);
double *qlAllocateDoubles(size_t size);
void **qlAllocatePointerArray(size_t size);
char *tracedup(const char *p);
#define DUP(p) tracedup((p))
#ifdef QLTRACK_ALLOCATIONS
template <class T> T traceval(const char *text, T val);
/* trace a pointer */
# define TP(text, p) traceval((text), (p))
# define TP2(text, p) (void)traceval((text), (p));
# include <fstream>
#else
# define TP(text, p) (p)
# define TP2(text, p)
#endif
namespace QuantLib {
template <class T> class Handle;
class Quote;
class Bond;
class FixedRateBond;
class FloatingRateBond;
class ZeroCouponBond;
class Forward;
class BondForward;
class ForwardRateAgreement;
class DayCounter;
class Business252;
class Calendar;
class JointCalendar;
class BespokeCalendar;
class Schedule;
class Currency;
class Region;
class InterestRate;
class FixedRateBondHelper;
class DepositRateHelper;
class YieldTermStructure;
class FlatForward;
class PricingEngine;
class DiscountingBondEngine;
class Instrument;
class CompositeInstrument;
class CustomIborIndex;
class IborIndex;
class Index;
class FloatingRateCouponPricer;
class OptionletVolatilityStructure;
class Coupon;
class AffineModel;
class AmericanExercise;
class AnalyticBSMHullWhiteEngine;
class AnalyticBarrierEngine;
class AnalyticCapFloorEngine;
class AnalyticCliquetEngine;
class AnalyticContinuousFixedLookbackEngine;
class AnalyticContinuousFloatingLookbackEngine;
class AnalyticContinuousGeometricAveragePriceAsianEngine;
class AnalyticDigitalAmericanEngine;
class AnalyticDiscreteGeometricAveragePriceAsianEngine;
class AnalyticDiscreteGeometricAverageStrikeAsianEngine;
class AnalyticDividendEuropeanEngine;
class AnalyticEuropeanEngine;
class AnalyticGJRGARCHEngine;
class AnalyticHestonEngine;
class AnalyticHestonHullWhiteEngine;
class AnalyticPerformanceEngine;
class AssetOrNothingPayoff;
class AssetSwap;
class BMAIndex;
class BMASwap;
class BMASwapRateHelper;
class BachelierCalculator;
class BaroneAdesiWhaleyApproximationEngine;
class BarrierOption;
class DoubleBarrierOption;
class BasketPayoff;
class BatesDetJumpEngine;
class BatesDetJumpModel;
class BatesDoubleExpDetJumpEngine;
class BatesDoubleExpDetJumpModel;
class BatesDoubleExpEngine;
class BatesDoubleExpModel;
class BatesEngine;
class BatesModel;
class BatesProcess;
class BermudanExercise;
class BjerksundStenslandApproximationEngine;
class BlackCalculator;
class BlackDeltaCalculator;
class BlackCalibrationHelper;
class BlackCallableFixedRateBondEngine;
class BlackCallableZeroCouponBondEngine;
class BlackCapFloorEngine;
class BlackConstantVol;
class BlackKarasinski;
class BlackProcess;
class BlackScholesCalculator;
class BlackScholesMertonProcess;
class BlackScholesProcess;
class BlackSwaptionEngine;
class BlackVarianceCurve;
class BlackVolTermStructure;
class BlackVolatilitySurfaceDelta;
class BondHelper;
class BoundaryConstraint;
class CalibratedModel;
class CalibrationHelper;
class Callability;
class CallableBond;
class CallableBondVolatilityStructure;
class CallableFixedRateBond;
class CallableZeroCouponBond;
class CapFloor;
class CapFloorTermVolSurface;
class CapHelper;
class CashOrNothingPayoff;
class CdsOption;
class Claim;
class CompositeConstraint;
class Constraint;
class ConvertibleBond;
class ConvertibleFixedCouponBond;
class ConvertibleFloatingRateBond;
class ConvertibleZeroCouponBond;
class CPIBond;
class CPICashFlow;
class CPISwap;
class CreditDefaultSwap;
class CubicBSplinesFitting;
class DefaultProbabilityTermStructure;
class DeltaVolQuote;
class DiscountingFxForwardEngine;
class DiscountingSwapEngine;
class Dividend;
class EarlyExercise;
class EndCriteria;
class EquityCashFlow;
class EquityCashFlowPricer;
class EquityIndex;
class EquityQuantoCashFlowPricer;
class EquityTotalReturnSwap;
class EuropeanExercise;
class EuropeanOption;
class ExchangeRate;
class Exercise;
class ExponentialSplinesFitting;
class ExtOUWithJumpsProcess;
class ExtendedBlackScholesMertonProcess;
class ExtendedOrnsteinUhlenbeckProcess;
class FFTVanillaEngine;
class FaceValueAccrualClaim;
class FaceValueClaim;
class FdG2SwaptionEngine;
class FdHullWhiteSwaptionEngine;
class FdmQuantoHelper;
struct FdmSchemeDesc;
class FittedBondDiscountCurve;
class FixedDividend;
class ForwardSpreadedTermStructure;
class FraRateHelper;
class FractionalDividend;
class FuturesRateHelper;
class FxForward;
class G2;
class G2SwaptionEngine;
class GJRGARCHModel;
class GJRGARCHProcess;
class GapPayoff;
class GarmanKohlagenProcess;
class Gaussian1dModel;
class GeneralizedBlackScholesProcess;
class GeneralizedHullWhite;
class Gsr;
class HestonModel;
class HestonModelHelper;
class HestonProcess;
class HullWhite;
class HullWhiteForwardProcess;
class HullWhiteProcess;
class HybridHestonHullWhiteProcess;
class ImpliedTermStructure;
class ImpliedVolTermStructure;
class InflationIndex;
class IntegralCdsEngine;
class IntegralEngine;
class InterestRateIndex;
class JamshidianSwaptionEngine;
class JuQuadraticApproximationEngine;
class JumpDiffusionEngine;
class KirkEngine;
class KlugeExtOUProcess;
class LevenbergMarquardt;
class LfmSwaptionEngine;
class LiborForwardModel;
class LiborForwardModelProcess;
class LmCorrelationModel;
class LmVolatilityModel;
class LocalVolTermStructure;
class MargrabeOption;
class MarkovFunctional;
class Merton76Process;
class MidPointCdsEngine;
class MultiAssetOption;
class MultiCurve;
class NelsonSiegelFitting;
class NoConstraint;
class OISRateHelper;
class OneAssetOption;
class OneFactorAffineModel;
class OptimizationMethod;
class Option;
class OvernightIndex;
class OvernightIndexedSwap;
class OvernightIndexedSwapIndex;
class Payoff;
class PercentageStrikePayoff;
class PiecewiseTimeDependentHestonModel;
class PlainVanillaPayoff;
class PositiveConstraint;
class QuantoBarrierOption;
class QuantoForwardVanillaOption;
class QuantoTermStructure;
class QuantoVanillaOption;
class ReplicatingVarianceSwapEngine;
class Rounding;
class SabrInterpolatedSmileSection;
class ShortRateModel;
class SimplePolynomialFitting;
class SimpleQuote;
class Simplex;
class SmileSection;
class SoftCallability;
class SpreadCdsHelper;
class StochasticProcess;
class StochasticProcess1D;
class StochasticProcessArray;
class StrikedTypePayoff;
class StulzEngine;
class SuperFundPayoff;
class SuperSharePayoff;
class SvenssonFitting;
class InterpolatedSwaptionVolatilityCube;
class Swap;
class SwapIndex;
class SwapRateHelper;
class Swaption;
class SwaptionHelper;
class SwaptionVolatilityStructure;
class SwingExercise;
class TermStructure;
class TimeGrid;
class TreeCallableFixedRateBondEngine;
class TreeCallableZeroCouponBondEngine;
class TreeCapFloorEngine;
class TreeSwaptionEngine;
class TreeVanillaSwapEngine;
class TypePayoff;
class UpfrontCdsHelper;
class VanillaOption;
class VanillaSwap;
class VarianceGammaEngine;
class VarianceGammaProcess;
class VarianceOption;
class VegaStressedBlackScholesProcess;
class VolatilityTermStructure;
class YearOnYearInflationSwap;
class YearOnYearInflationSwapHelper;
class YoYInflationIndex;
class YoYInflationTermStructure;
class ZeroCouponInflationSwap;
class ZeroCouponInflationSwapHelper;
class ZeroCouponSwap;
class ZeroInflationCashFlow;
class ZeroInflationIndex;
class ZeroInflationTermStructure;
class ZeroSpreadedTermStructure;
}
using QuantLib::Handle;
using QuantLib::RelinkableHandle;
using QuantLib::Quote;
using QuantLib::BusinessDayConvention;
using QuantLib::Bond;
using QuantLib::FixedRateBond;
using QuantLib::FloatingRateBond;
using QuantLib::ZeroCouponBond;
using QuantLib::Forward;
using QuantLib::BondForward;
using QuantLib::ForwardRateAgreement;
using QuantLib::DayCounter;
using QuantLib::Business252;
using QuantLib::Calendar;
using QuantLib::JointCalendar;
using QuantLib::BespokeCalendar;
using QuantLib::Schedule;
using QuantLib::Currency;
using QuantLib::Region;
using QuantLib::InterestRate;
using QuantLib::FixedRateBondHelper;
using QuantLib::DepositRateHelper;
using QuantLib::YieldTermStructure;
using QuantLib::FlatForward;
using QuantLib::PricingEngine;
using QuantLib::DiscountingBondEngine;
using QuantLib::Instrument;
using QuantLib::CompositeInstrument;
using QuantLib::CustomIborIndex;
using QuantLib::IborIndex;
using QuantLib::Index;
using QuantLib::FloatingRateCouponPricer;
using QuantLib::OptionletVolatilityStructure;
using QuantLib::Coupon;
using QuantLib::AffineModel;
using QuantLib::AmericanExercise;
using QuantLib::AnalyticBSMHullWhiteEngine;
using QuantLib::AnalyticBarrierEngine;
using QuantLib::AnalyticCapFloorEngine;
using QuantLib::AnalyticCliquetEngine;
using QuantLib::AnalyticContinuousFixedLookbackEngine;
using QuantLib::AnalyticContinuousFloatingLookbackEngine;
using QuantLib::AnalyticContinuousGeometricAveragePriceAsianEngine;
using QuantLib::AnalyticDigitalAmericanEngine;
using QuantLib::AnalyticDiscreteGeometricAveragePriceAsianEngine;
using QuantLib::AnalyticDiscreteGeometricAverageStrikeAsianEngine;
using QuantLib::AnalyticDividendEuropeanEngine;
using QuantLib::AnalyticEuropeanEngine;
using QuantLib::AnalyticGJRGARCHEngine;
using QuantLib::AnalyticHestonEngine;
using QuantLib::AnalyticHestonHullWhiteEngine;
using QuantLib::AnalyticPerformanceEngine;
using QuantLib::AssetOrNothingPayoff;
using QuantLib::AssetSwap;
using QuantLib::BMAIndex;
using QuantLib::BMASwap;
using QuantLib::BMASwapRateHelper;
using QuantLib::BachelierCalculator;
using QuantLib::BaroneAdesiWhaleyApproximationEngine;
using QuantLib::BarrierOption;
using QuantLib::DoubleBarrierOption;
using QuantLib::BasketPayoff;
using QuantLib::BatesDetJumpEngine;
using QuantLib::BatesDetJumpModel;
using QuantLib::BatesDoubleExpDetJumpEngine;
using QuantLib::BatesDoubleExpDetJumpModel;
using QuantLib::BatesDoubleExpEngine;
using QuantLib::BatesDoubleExpModel;
using QuantLib::BatesEngine;
using QuantLib::BatesModel;
using QuantLib::BatesProcess;
using QuantLib::BermudanExercise;
using QuantLib::BjerksundStenslandApproximationEngine;
using QuantLib::BlackCalculator;
using QuantLib::BlackDeltaCalculator;
using QuantLib::BlackCalibrationHelper;
using QuantLib::BlackCallableFixedRateBondEngine;
using QuantLib::BlackCallableZeroCouponBondEngine;
using QuantLib::BlackCapFloorEngine;
using QuantLib::BlackConstantVol;
using QuantLib::BlackKarasinski;
using QuantLib::BlackProcess;
using QuantLib::BlackScholesCalculator;
using QuantLib::BlackScholesMertonProcess;
using QuantLib::BlackScholesProcess;
using QuantLib::BlackSwaptionEngine;
using QuantLib::BlackVarianceCurve;
using QuantLib::BlackVolTermStructure;
using QuantLib::BlackVolatilitySurfaceDelta;
using QuantLib::BondHelper;
using QuantLib::BoundaryConstraint;
using QuantLib::CalibratedModel;
using QuantLib::CalibrationHelper;
using QuantLib::Callability;
using QuantLib::CallableBond;
using QuantLib::CallableBondVolatilityStructure;
using QuantLib::CallableFixedRateBond;
using QuantLib::CallableZeroCouponBond;
using QuantLib::CapFloor;
using QuantLib::CapFloorTermVolSurface;
using QuantLib::CapHelper;
using QuantLib::CashOrNothingPayoff;
using QuantLib::CdsOption;
using QuantLib::Claim;
using QuantLib::CompositeConstraint;
using QuantLib::Constraint;
using QuantLib::ConvertibleBond;
using QuantLib::ConvertibleFixedCouponBond;
using QuantLib::ConvertibleFloatingRateBond;
using QuantLib::ConvertibleZeroCouponBond;
using QuantLib::CPIBond;
using QuantLib::CPICashFlow;
using QuantLib::CPISwap;
using QuantLib::CreditDefaultSwap;
using QuantLib::CubicBSplinesFitting;
using QuantLib::DefaultProbabilityTermStructure;
using QuantLib::DeltaVolQuote;
using QuantLib::DiscountingFxForwardEngine;
using QuantLib::DiscountingSwapEngine;
using QuantLib::Dividend;
using QuantLib::EarlyExercise;
using QuantLib::EndCriteria;
using QuantLib::EquityCashFlow;
using QuantLib::EquityCashFlowPricer;
using QuantLib::EquityIndex;
using QuantLib::EquityQuantoCashFlowPricer;
using QuantLib::EquityTotalReturnSwap;
using QuantLib::EuropeanExercise;
using QuantLib::EuropeanOption;
using QuantLib::ExchangeRate;
using QuantLib::Exercise;
using QuantLib::ExponentialSplinesFitting;
using QuantLib::ExtOUWithJumpsProcess;
using QuantLib::ExtendedBlackScholesMertonProcess;
using QuantLib::ExtendedOrnsteinUhlenbeckProcess;
using QuantLib::FFTVanillaEngine;
using QuantLib::FaceValueAccrualClaim;
using QuantLib::FaceValueClaim;
using QuantLib::FdG2SwaptionEngine;
using QuantLib::FdHullWhiteSwaptionEngine;
using QuantLib::FdmQuantoHelper;
using QuantLib::FdmSchemeDesc;
using QuantLib::FittedBondDiscountCurve;
using QuantLib::FixedDividend;
using QuantLib::ForwardSpreadedTermStructure;
using QuantLib::FraRateHelper;
using QuantLib::FractionalDividend;
using QuantLib::FuturesRateHelper;
using QuantLib::FxForward;
using QuantLib::G2;
using QuantLib::G2SwaptionEngine;
using QuantLib::GJRGARCHModel;
using QuantLib::GJRGARCHProcess;
using QuantLib::GapPayoff;
using QuantLib::GarmanKohlagenProcess;
using QuantLib::Gaussian1dModel;
using QuantLib::GeneralizedBlackScholesProcess;
using QuantLib::GeneralizedHullWhite;
using QuantLib::Gsr;
using QuantLib::HestonModel;
using QuantLib::HestonModelHelper;
using QuantLib::HestonProcess;
using QuantLib::HullWhite;
using QuantLib::HullWhiteForwardProcess;
using QuantLib::HullWhiteProcess;
using QuantLib::HybridHestonHullWhiteProcess;
using QuantLib::ImpliedTermStructure;
using QuantLib::ImpliedVolTermStructure;
using QuantLib::InflationIndex;
using QuantLib::IntegralCdsEngine;
using QuantLib::IntegralEngine;
using QuantLib::InterestRateIndex;
using QuantLib::JamshidianSwaptionEngine;
using QuantLib::JuQuadraticApproximationEngine;
using QuantLib::JumpDiffusionEngine;
using QuantLib::KirkEngine;
using QuantLib::KlugeExtOUProcess;
using QuantLib::LevenbergMarquardt;
using QuantLib::LfmSwaptionEngine;
using QuantLib::LiborForwardModel;
using QuantLib::LiborForwardModelProcess;
using QuantLib::LmCorrelationModel;
using QuantLib::LmVolatilityModel;
using QuantLib::LocalVolTermStructure;
using QuantLib::MargrabeOption;
using QuantLib::MarkovFunctional;
using QuantLib::Merton76Process;
using QuantLib::MidPointCdsEngine;
using QuantLib::MultiAssetOption;
using QuantLib::MultiCurve;
using QuantLib::NelsonSiegelFitting;
using QuantLib::NoConstraint;
using QuantLib::OISRateHelper;
using QuantLib::OneAssetOption;
using QuantLib::OneFactorAffineModel;
using QuantLib::OptimizationMethod;
using QuantLib::Option;
using QuantLib::OvernightIndex;
using QuantLib::OvernightIndexedSwap;
using QuantLib::OvernightIndexedSwapIndex;
using QuantLib::Payoff;
using QuantLib::PercentageStrikePayoff;
using QuantLib::Period;
using QuantLib::PiecewiseTimeDependentHestonModel;
using QuantLib::PlainVanillaPayoff;
using QuantLib::PositiveConstraint;
using QuantLib::QuantoBarrierOption;
using QuantLib::QuantoForwardVanillaOption;
using QuantLib::QuantoTermStructure;
using QuantLib::QuantoVanillaOption;
using QuantLib::ReplicatingVarianceSwapEngine;
using QuantLib::Rounding;
using QuantLib::SabrInterpolatedSmileSection;
using QuantLib::ShortRateModel;
using QuantLib::SimplePolynomialFitting;
using QuantLib::SimpleQuote;
using QuantLib::Simplex;
using QuantLib::SmileSection;
using QuantLib::SoftCallability;
using QuantLib::SpreadCdsHelper;
using QuantLib::StochasticProcess1D;
using QuantLib::StochasticProcess;
using QuantLib::StochasticProcessArray;
using QuantLib::StrikedTypePayoff;
using QuantLib::StulzEngine;
using QuantLib::SuperFundPayoff;
using QuantLib::SuperSharePayoff;
using QuantLib::SvenssonFitting;
using QuantLib::InterpolatedSwaptionVolatilityCube;
using QuantLib::SabrSwaptionVolatilityCube;
using QuantLib::Swap;
using QuantLib::SwapIndex;
using QuantLib::SwapRateHelper;
using QuantLib::Swaption;
using QuantLib::SwaptionHelper;
using QuantLib::SwaptionVolatilityStructure;
using QuantLib::SwingExercise;
using QuantLib::TermStructure;
using QuantLib::TimeGrid;
using QuantLib::TimeUnit;
using QuantLib::TreeCallableFixedRateBondEngine;
using QuantLib::TreeCallableZeroCouponBondEngine;
using QuantLib::TreeCapFloorEngine;
using QuantLib::TreeSwaptionEngine;
using QuantLib::TreeVanillaSwapEngine;
using QuantLib::TypePayoff;
using QuantLib::UpfrontCdsHelper;
using QuantLib::VanillaOption;
using QuantLib::VanillaSwap;
using QuantLib::VarianceGammaEngine;
using QuantLib::VarianceGammaProcess;
using QuantLib::VarianceOption;
using QuantLib::VarianceSwap;
using QuantLib::VegaStressedBlackScholesProcess;
using QuantLib::VolatilityTermStructure;
using QuantLib::YearOnYearInflationSwap;
using QuantLib::YearOnYearInflationSwapHelper;
using QuantLib::YoYInflationIndex;
using QuantLib::YoYInflationTermStructure;
using QuantLib::ZeroCouponInflationSwap;
using QuantLib::ZeroCouponInflationSwapHelper;
using QuantLib::ZeroCouponSwap;
using QuantLib::ZeroInflationCashFlow;
using QuantLib::ZeroInflationIndex;
using QuantLib::ZeroInflationTermStructure;
using QuantLib::ZeroSpreadedTermStructure;
using QuantLib::Date;
using QuantLib::Matrix;
using QuantLib::ext::shared_ptr;
using QuantLib::ext::optional;
class PolymorphicPathGenerator;
// Haskell CRateHelper is actually a pointer to a shared_ptr, because rate helpers are used via
// shared_ptr in QuantLib and have no Handle-based counterpart upstream.
// A Quote is a Handle, not a bare shared_ptr, so that a RelinkableHandle can be passed wherever
// a quote is expected: copies of a Handle share one Link, which is what makes a linkTo()
// propagate to everything already built on it. Handle constructs implicitly from nothing (the
// ctor is explicit) but *arg(x) recovers the shared_ptr where one is needed. Mirrors
// QlYieldTermStructure below; see the invariant note there before touching either.
typedef Handle<Quote> QlQuote;
// RelinkableHandle publicly inherits Handle, so a relinkable quote IS a QlQuote and needs no
// separate parameter type -- same reasoning as QlRelinkableYieldTermStructure below.
typedef RelinkableHandle<Quote> QlRelinkableQuote;
// A curve is a Handle, not a bare shared_ptr, so that a RelinkableHandle can be passed
// wherever a curve is expected: copies of a Handle share one Link, which is what makes a
// linkTo() propagate to everything already built on it. Handle constructs implicitly from
// nothing (the ctor is explicit) but *arg(x) recovers the shared_ptr where one is needed.
typedef Handle<YieldTermStructure> QlYieldTermStructure;
// RelinkableHandle publicly inherits Handle, so a relinkable curve IS a QlYieldTermStructure
// and needs no separate parameter type: it goes wherever a curve goes, through the ordinary
// Upcastable machinery, and the upcast copy shares its Link so relinking still propagates.
typedef RelinkableHandle<YieldTermStructure> QlRelinkableYieldTermStructure;
typedef shared_ptr<PricingEngine> QlPricingEngine;
typedef shared_ptr<IborIndex> QlIborIndex;
typedef shared_ptr<Index> QlIndex;
typedef shared_ptr<FloatingRateCouponPricer> QlFloatingRateCouponPricer;
// A vol structure is a Handle, same reasoning as QlBlackVolTermStructure/QlSwaptionVolatilityStructure below.
typedef Handle<OptionletVolatilityStructure> QlOptionletVolatilityStructure;
typedef RelinkableHandle<OptionletVolatilityStructure> QlRelinkableOptionletVolatilityStructure;
typedef shared_ptr<Instrument> QlInstrument;
typedef shared_ptr<Bond> QlBond;
typedef shared_ptr<FixedRateBond> QlFixedRateBond;
typedef shared_ptr<Forward> QlForward;
typedef shared_ptr<BondForward> QlBondForward;
typedef shared_ptr<ForwardRateAgreement> QlForwardRateAgreement;
typedef shared_ptr<AffineModel> QlAffineModel;
typedef shared_ptr<AmericanExercise> QlAmericanExercise;
typedef shared_ptr<AssetSwap> QlAssetSwap;
typedef shared_ptr<BMAIndex> QlBMAIndex;
typedef shared_ptr<BMASwap> QlBMASwap;
typedef shared_ptr<BarrierOption> QlBarrierOption;
typedef shared_ptr<DoubleBarrierOption> QlDoubleBarrierOption;
typedef shared_ptr<BachelierCalculator> QlBachelierCalculator;
typedef shared_ptr<BasketPayoff> QlBasketPayoff;
typedef shared_ptr<BatesDetJumpModel> QlBatesDetJumpModel;
typedef shared_ptr<BatesDoubleExpDetJumpModel> QlBatesDoubleExpDetJumpModel;
typedef shared_ptr<BatesDoubleExpModel> QlBatesDoubleExpModel;
typedef shared_ptr<BatesModel> QlBatesModel;
typedef shared_ptr<BatesProcess> QlBatesProcess;
typedef shared_ptr<BermudanExercise> QlBermudanExercise;
typedef shared_ptr<BlackCalculator> QlBlackCalculator;
typedef shared_ptr<BlackCalibrationHelper> QlBlackCalibrationHelper;
typedef shared_ptr<BlackProcess> QlBlackProcess;
typedef shared_ptr<BlackScholesCalculator> QlBlackScholesCalculator;
typedef shared_ptr<BlackVarianceCurve> QlBlackVarianceCurve;
typedef shared_ptr<BlackVolatilitySurfaceDelta> QlBlackVolatilitySurfaceDelta;
// A vol structure is a Handle, same reasoning as QlYieldTermStructure/QlQuote above -- upstream
// itself speaks Handle<BlackVolTermStructure> throughout, unlike the VolatilityTermStructure
// base (never a Handle upstream, confirmed by grep; stays shared_ptr, same as QlTermStructure).
typedef Handle<BlackVolTermStructure> QlBlackVolTermStructure;
typedef RelinkableHandle<BlackVolTermStructure> QlRelinkableBlackVolTermStructure;
typedef shared_ptr<BondHelper> QlBondHelper;
typedef shared_ptr<CalibratedModel> QlCalibratedModel;
typedef shared_ptr<CalibrationHelper> QlCalibrationHelper;
typedef shared_ptr<Callability> QlCallability;
typedef shared_ptr<CallableBond> QlCallableBond;
typedef shared_ptr<CallableBondVolatilityStructure> QlCallableBondVolatilityStructure;
typedef shared_ptr<CapFloor> QlCapFloor;
typedef shared_ptr<CapFloorTermVolSurface> QlCapFloorTermVolSurface;
typedef shared_ptr<CdsOption> QlCdsOption;
typedef shared_ptr<Claim> QlClaim;
typedef shared_ptr<ConvertibleBond> QlConvertibleBond;
typedef shared_ptr<CPIBond> QlCPIBond;
typedef shared_ptr<CPICashFlow> QlCPICashFlow;
typedef shared_ptr<CPISwap> QlCPISwap;
typedef shared_ptr<CreditDefaultSwap> QlCreditDefaultSwap;
typedef shared_ptr<DefaultProbabilityTermStructure> QlDefaultProbabilityTermStructure;
typedef shared_ptr<DeltaVolQuote> QlDeltaVolQuote;
typedef shared_ptr<Dividend> QlDividend;
typedef shared_ptr<EquityCashFlow> QlEquityCashFlow;
typedef shared_ptr<EquityCashFlowPricer> QlEquityCashFlowPricer;
typedef shared_ptr<EquityIndex> QlEquityIndex;
typedef shared_ptr<EquityQuantoCashFlowPricer> QlEquityQuantoCashFlowPricer;
typedef shared_ptr<EquityTotalReturnSwap> QlEquityTotalReturnSwap;
typedef shared_ptr<EuropeanExercise> QlEuropeanExercise;
typedef shared_ptr<Exercise> QlExercise;
typedef shared_ptr<ExtOUWithJumpsProcess> QlExtOUWithJumpsProcess;
typedef shared_ptr<ExtendedOrnsteinUhlenbeckProcess> QlExtendedOrnsteinUhlenbeckProcess;
typedef shared_ptr<FdmQuantoHelper> QlFdmQuantoHelper;
typedef shared_ptr<FittedBondDiscountCurve> QlFittedBondDiscountCurve;
typedef shared_ptr<FxForward> QlFxForward;
typedef shared_ptr<G2> QlG2;
typedef shared_ptr<GJRGARCHModel> QlGJRGARCHModel;
typedef shared_ptr<GJRGARCHProcess> QlGJRGARCHProcess;
typedef shared_ptr<Gaussian1dModel> QlGaussian1dModel;
typedef shared_ptr<GeneralizedBlackScholesProcess> QlGeneralizedBlackScholesProcess;
typedef shared_ptr<Gsr> QlGsr;
typedef shared_ptr<HestonModel> QlHestonModel;
typedef shared_ptr<HestonProcess> QlHestonProcess;
typedef shared_ptr<HullWhite> QlHullWhite;
typedef shared_ptr<HullWhiteForwardProcess> QlHullWhiteForwardProcess;
typedef shared_ptr<HullWhiteProcess> QlHullWhiteProcess;
typedef shared_ptr<HybridHestonHullWhiteProcess> QlHybridHestonHullWhiteProcess;
typedef shared_ptr<InflationIndex> QlInflationIndex;
typedef shared_ptr<InterestRateIndex> QlInterestRateIndex;
typedef shared_ptr<KlugeExtOUProcess> QlKlugeExtOUProcess;
typedef shared_ptr<LiborForwardModel> QlLiborForwardModel;
typedef shared_ptr<LiborForwardModelProcess> QlLiborForwardModelProcess;
typedef shared_ptr<LmCorrelationModel> QlLmCorrelationModel;
typedef shared_ptr<LmVolatilityModel> QlLmVolatilityModel;
typedef shared_ptr<LocalVolTermStructure> QlLocalVolTermStructure;
typedef shared_ptr<MargrabeOption> QlMargrabeOption;
typedef shared_ptr<MarkovFunctional> QlMarkovFunctional;
typedef shared_ptr<Merton76Process> QlMerton76Process;
typedef shared_ptr<MultiAssetOption> QlMultiAssetOption;
// MultiCurve is enable_shared_from_this and upstream's own doc comment says "This must be a
// shared pointer" -- bound as a standalone leaf type (own Finalizable instance, no Upcastable
// parent: it isn't a TermStructure), same shape as e.g. QlSwapRateHelper.
typedef shared_ptr<MultiCurve> QlMultiCurve;
typedef shared_ptr<OISRateHelper> QlOISRateHelper;
typedef shared_ptr<OneAssetOption> QlOneAssetOption;
typedef shared_ptr<OneFactorAffineModel> QlOneFactorAffineModel;
typedef shared_ptr<Option> QlOption;
typedef shared_ptr<OvernightIndex> QlOvernightIndex;
typedef shared_ptr<OvernightIndexedSwap> QlOvernightIndexedSwap;
typedef shared_ptr<OvernightIndexedSwapIndex> QlOvernightIndexedSwapIndex;
typedef shared_ptr<Payoff> QlPayoff;
typedef shared_ptr<PercentageStrikePayoff> QlPercentageStrikePayoff;
typedef shared_ptr<PiecewiseTimeDependentHestonModel> QlPiecewiseTimeDependentHestonModel;
typedef shared_ptr<PlainVanillaPayoff> QlPlainVanillaPayoff;
typedef shared_ptr<QuantoBarrierOption> QlQuantoBarrierOption;
typedef shared_ptr<QuantoForwardVanillaOption> QlQuantoForwardVanillaOption;
typedef shared_ptr<QuantoVanillaOption> QlQuantoVanillaOption;
typedef shared_ptr<SabrInterpolatedSmileSection> QlSabrInterpolatedSmileSection;
typedef shared_ptr<ShortRateModel> QlShortRateModel;
typedef shared_ptr<SimpleQuote> QlSimpleQuote;
typedef shared_ptr<SmileSection> QlSmileSection;
typedef shared_ptr<StochasticProcess1D> QlStochasticProcess1D;
typedef shared_ptr<StochasticProcess> QlStochasticProcess;
typedef shared_ptr<StochasticProcessArray> QlStochasticProcessArray;
typedef shared_ptr<StrikedTypePayoff> QlStrikedTypePayoff;
typedef shared_ptr<Swap> QlSwap;
typedef shared_ptr<SwapIndex> QlSwapIndex;
typedef shared_ptr<SwapRateHelper> QlSwapRateHelper;
typedef shared_ptr<Swaption> QlSwaption;
typedef shared_ptr<SabrSwaptionVolatilityCube> QlSabrSwaptionVolatilityCube;
typedef shared_ptr<InterpolatedSwaptionVolatilityCube> QlInterpolatedSwaptionVolatilityCube;
// A vol structure is a Handle, same reasoning as QlBlackVolTermStructure above.
typedef Handle<SwaptionVolatilityStructure> QlSwaptionVolatilityStructure;
typedef RelinkableHandle<SwaptionVolatilityStructure> QlRelinkableSwaptionVolatilityStructure;
typedef shared_ptr<SwingExercise> QlSwingExercise;
typedef shared_ptr<TermStructure> QlTermStructure;
typedef shared_ptr<TypePayoff> QlTypePayoff;
typedef shared_ptr<VanillaOption> QlVanillaOption;
typedef shared_ptr<VanillaSwap> QlVanillaSwap;
typedef shared_ptr<VarianceGammaProcess> QlVarianceGammaProcess;
typedef shared_ptr<VarianceOption> QlVarianceOption;
typedef shared_ptr<VarianceSwap> QlVarianceSwap;
typedef shared_ptr<VolatilityTermStructure> QlVolatilityTermStructure;
typedef shared_ptr<YearOnYearInflationSwap> QlYearOnYearInflationSwap;
typedef shared_ptr<YearOnYearInflationSwapHelper> QlYearOnYearInflationSwapHelper;
typedef shared_ptr<YoYInflationIndex> QlYoYInflationIndex;
typedef shared_ptr<YoYInflationTermStructure> QlYoYInflationTermStructure;
typedef shared_ptr<ZeroCouponInflationSwap> QlZeroCouponInflationSwap;
typedef shared_ptr<ZeroCouponInflationSwapHelper> QlZeroCouponInflationSwapHelper;
typedef shared_ptr<ZeroCouponSwap> QlZeroCouponSwap;
typedef shared_ptr<ZeroInflationCashFlow> QlZeroInflationCashFlow;
typedef shared_ptr<ZeroInflationIndex> QlZeroInflationIndex;
typedef shared_ptr<ZeroInflationTermStructure> QlZeroInflationTermStructure;
typedef std::vector<shared_ptr<Coupon> > CouponLeg;
#ifdef QLTRACK_ALLOCATIONS
template <class T> class ObjClassName {public: static void output(std::ostream& os) {os << typeid(T).name();}};
template <> class ObjClassName<AffineModel*> {public: static void output(std::ostream& os) {os << "AffineModel";}};
template <> class ObjClassName<AmericanExercise*> {public: static void output(std::ostream& os) {os << "AmericanExercise";}};
template <> class ObjClassName<AnalyticBSMHullWhiteEngine*> {public: static void output(std::ostream& os) {os << "AnalyticBSMHullWhiteEngine";}};
template <> class ObjClassName<AnalyticBarrierEngine*> {public: static void output(std::ostream& os) {os << "AnalyticBarrierEngine";}};
template <> class ObjClassName<AnalyticCapFloorEngine*> {public: static void output(std::ostream& os) {os << "AnalyticCapFloorEngine";}};
template <> class ObjClassName<AnalyticCliquetEngine*> {public: static void output(std::ostream& os) {os << "AnalyticCliquetEngine";}};
template <> class ObjClassName<AnalyticContinuousFixedLookbackEngine*> {public: static void output(std::ostream& os) {os << "AnalyticContinuousFixedLookbackEngine";}};
template <> class ObjClassName<AnalyticContinuousFloatingLookbackEngine*> {public: static void output(std::ostream& os) {os << "AnalyticContinuousFloatingLookbackEngine";}};
template <> class ObjClassName<AnalyticContinuousGeometricAveragePriceAsianEngine*> {public: static void output(std::ostream& os) {os << "AnalyticContinuousGeometricAveragePriceAsianEngine";}};
template <> class ObjClassName<AnalyticDigitalAmericanEngine*> {public: static void output(std::ostream& os) {os << "AnalyticDigitalAmericanEngine";}};
template <> class ObjClassName<AnalyticDiscreteGeometricAveragePriceAsianEngine*> {public: static void output(std::ostream& os) {os << "AnalyticDiscreteGeometricAveragePriceAsianEngine";}};
template <> class ObjClassName<AnalyticDiscreteGeometricAverageStrikeAsianEngine*> {public: static void output(std::ostream& os) {os << "AnalyticDiscreteGeometricAverageStrikeAsianEngine";}};
template <> class ObjClassName<AnalyticDividendEuropeanEngine*> {public: static void output(std::ostream& os) {os << "AnalyticDividendEuropeanEngine";}};
template <> class ObjClassName<AnalyticEuropeanEngine*> {public: static void output(std::ostream& os) {os << "AnalyticEuropeanEngine";}};
template <> class ObjClassName<AnalyticGJRGARCHEngine*> {public: static void output(std::ostream& os) {os << "AnalyticGJRGARCHEngine";}};
template <> class ObjClassName<AnalyticHestonEngine*> {public: static void output(std::ostream& os) {os << "AnalyticHestonEngine";}};
template <> class ObjClassName<AnalyticHestonHullWhiteEngine*> {public: static void output(std::ostream& os) {os << "AnalyticHestonHullWhiteEngine";}};
template <> class ObjClassName<AnalyticPerformanceEngine*> {public: static void output(std::ostream& os) {os << "AnalyticPerformanceEngine";}};
template <> class ObjClassName<AssetOrNothingPayoff*> {public: static void output(std::ostream& os) {os << "AssetOrNothingPayoff";}};
template <> class ObjClassName<AssetSwap*> {public: static void output(std::ostream& os) {os << "AssetSwap";}};
template <> class ObjClassName<BMAIndex*> {public: static void output(std::ostream& os) {os << "BMAIndex";}};
template <> class ObjClassName<BMASwap*> {public: static void output(std::ostream& os) {os << "BMASwap";}};
template <> class ObjClassName<BMASwapRateHelper*> {public: static void output(std::ostream& os) {os << "BMASwapRateHelper";}};
template <> class ObjClassName<BachelierCalculator*> {public: static void output(std::ostream& os) {os << "BachelierCalculator";}};
template <> class ObjClassName<BaroneAdesiWhaleyApproximationEngine*> {public: static void output(std::ostream& os) {os << "BaroneAdesiWhaleyApproximationEngine";}};
template <> class ObjClassName<BarrierOption*> {public: static void output(std::ostream& os) {os << "BarrierOption";}};
template <> class ObjClassName<DoubleBarrierOption*> {public: static void output(std::ostream& os) {os << "DoubleBarrierOption";}};
template <> class ObjClassName<BasketPayoff*> {public: static void output(std::ostream& os) {os << "BasketPayoff";}};
template <> class ObjClassName<BatesDetJumpEngine*> {public: static void output(std::ostream& os) {os << "BatesDetJumpEngine";}};
template <> class ObjClassName<BatesDetJumpModel*> {public: static void output(std::ostream& os) {os << "BatesDetJumpModel";}};
template <> class ObjClassName<BatesDoubleExpDetJumpEngine*> {public: static void output(std::ostream& os) {os << "BatesDoubleExpDetJumpEngine";}};
template <> class ObjClassName<BatesDoubleExpDetJumpModel*> {public: static void output(std::ostream& os) {os << "BatesDoubleExpDetJumpModel";}};
template <> class ObjClassName<BatesDoubleExpEngine*> {public: static void output(std::ostream& os) {os << "BatesDoubleExpEngine";}};
template <> class ObjClassName<BatesDoubleExpModel*> {public: static void output(std::ostream& os) {os << "BatesDoubleExpModel";}};
template <> class ObjClassName<BatesEngine*> {public: static void output(std::ostream& os) {os << "BatesEngine";}};
template <> class ObjClassName<BatesModel*> {public: static void output(std::ostream& os) {os << "BatesModel";}};
template <> class ObjClassName<BatesProcess*> {public: static void output(std::ostream& os) {os << "BatesProcess";}};
template <> class ObjClassName<BermudanExercise*> {public: static void output(std::ostream& os) {os << "BermudanExercise";}};
template <> class ObjClassName<BespokeCalendar*> {public: static void output(std::ostream& os) {os << "BespokeCalendar";}};
template <> class ObjClassName<BjerksundStenslandApproximationEngine*> {public: static void output(std::ostream& os) {os << "BjerksundStenslandApproximationEngine";}};
template <> class ObjClassName<BlackCalculator*> {public: static void output(std::ostream& os) {os << "BlackCalculator";}};
template <> class ObjClassName<BlackDeltaCalculator*> {public: static void output(std::ostream& os) {os << "BlackDeltaCalculator";}};
template <> class ObjClassName<BlackCalibrationHelper*> {public: static void output(std::ostream& os) {os << "BlackCalibrationHelper";}};
template <> class ObjClassName<BlackCallableFixedRateBondEngine*> {public: static void output(std::ostream& os) {os << "BlackCallableFixedRateBondEngine";}};
template <> class ObjClassName<BlackCallableZeroCouponBondEngine*> {public: static void output(std::ostream& os) {os << "BlackCallableZeroCouponBondEngine";}};
template <> class ObjClassName<BlackCapFloorEngine*> {public: static void output(std::ostream& os) {os << "BlackCapFloorEngine";}};
template <> class ObjClassName<BlackConstantVol*> {public: static void output(std::ostream& os) {os << "BlackConstantVol";}};
template <> class ObjClassName<BlackKarasinski*> {public: static void output(std::ostream& os) {os << "BlackKarasinski";}};
template <> class ObjClassName<BlackProcess*> {public: static void output(std::ostream& os) {os << "BlackProcess";}};
template <> class ObjClassName<BlackScholesCalculator*> {public: static void output(std::ostream& os) {os << "BlackScholesCalculator";}};
template <> class ObjClassName<BlackScholesMertonProcess*> {public: static void output(std::ostream& os) {os << "BlackScholesMertonProcess";}};
template <> class ObjClassName<BlackScholesProcess*> {public: static void output(std::ostream& os) {os << "BlackScholesProcess";}};
template <> class ObjClassName<BlackSwaptionEngine*> {public: static void output(std::ostream& os) {os << "BlackSwaptionEngine";}};
template <> class ObjClassName<BlackVarianceCurve*> {public: static void output(std::ostream& os) {os << "BlackVarianceCurve";}};
template <> class ObjClassName<BlackVolTermStructure*> {public: static void output(std::ostream& os) {os << "BlackVolTermStructure";}};
template <> class ObjClassName<Bond*> {public: static void output(std::ostream& os) {os << "Bond";}};
template <> class ObjClassName<BondForward*> {public: static void output(std::ostream& os) {os << "BondForward";}};
template <> class ObjClassName<BondHelper*> {public: static void output(std::ostream& os) {os << "BondHelper";}};
template <> class ObjClassName<BoundaryConstraint*> {public: static void output(std::ostream& os) {os << "BoundaryConstraint";}};
template <> class ObjClassName<Business252*> {public: static void output(std::ostream& os) {os << "Business252";}};
template <> class ObjClassName<Calendar*> {public: static void output(std::ostream& os) {os << "Calendar";}};
template <> class ObjClassName<CalibratedModel*> {public: static void output(std::ostream& os) {os << "CalibratedModel";}};
template <> class ObjClassName<CalibrationHelper*> {public: static void output(std::ostream& os) {os << "CalibrationHelper";}};
template <> class ObjClassName<Callability*> {public: static void output(std::ostream& os) {os << "Callability";}};
template <> class ObjClassName<CallableBond*> {public: static void output(std::ostream& os) {os << "CallableBond";}};
template <> class ObjClassName<CallableBondVolatilityStructure*> {public: static void output(std::ostream& os) {os << "CallableBondVolatilityStructure";}};
template <> class ObjClassName<CallableFixedRateBond*> {public: static void output(std::ostream& os) {os << "CallableFixedRateBond";}};
template <> class ObjClassName<CallableZeroCouponBond*> {public: static void output(std::ostream& os) {os << "CallableZeroCouponBond";}};
template <> class ObjClassName<CapFloor*> {public: static void output(std::ostream& os) {os << "CapFloor";}};
template <> class ObjClassName<CapFloorTermVolSurface*> {public: static void output(std::ostream& os) {os << "CapFloorTermVolSurface";}};
template <> class ObjClassName<CapHelper*> {public: static void output(std::ostream& os) {os << "CapHelper";}};
template <> class ObjClassName<CashOrNothingPayoff*> {public: static void output(std::ostream& os) {os << "CashOrNothingPayoff";}};
template <> class ObjClassName<CdsOption*> {public: static void output(std::ostream& os) {os << "CdsOption";}};
template <> class ObjClassName<Claim*> {public: static void output(std::ostream& os) {os << "Claim";}};
template <> class ObjClassName<CompositeConstraint*> {public: static void output(std::ostream& os) {os << "CompositeConstraint";}};
template <> class ObjClassName<CompositeInstrument*> {public: static void output(std::ostream& os) {os << "CompositeInstrument";}};
template <> class ObjClassName<Constraint*> {public: static void output(std::ostream& os) {os << "Constraint";}};
template <> class ObjClassName<ConvertibleBond*> {public: static void output(std::ostream& os) {os << "ConvertibleBond";}};
template <> class ObjClassName<ConvertibleFixedCouponBond*> {public: static void output(std::ostream& os) {os << "ConvertibleFixedCouponBond";}};
template <> class ObjClassName<ConvertibleFloatingRateBond*> {public: static void output(std::ostream& os) {os << "ConvertibleFloatingRateBond";}};
template <> class ObjClassName<ConvertibleZeroCouponBond*> {public: static void output(std::ostream& os) {os << "ConvertibleZeroCouponBond";}};
template <> class ObjClassName<CouponLeg*> {public: static void output(std::ostream& os) {os << "CouponLeg";}};
template <> class ObjClassName<CPIBond*> {public: static void output(std::ostream& os) {os << "CPIBond";}};
template <> class ObjClassName<CPISwap*> {public: static void output(std::ostream& os) {os << "CPISwap";}};
template <> class ObjClassName<CreditDefaultSwap*> {public: static void output(std::ostream& os) {os << "CreditDefaultSwap";}};
template <> class ObjClassName<CubicBSplinesFitting*> {public: static void output(std::ostream& os) {os << "CubicBSplinesFitting";}};
template <> class ObjClassName<Currency*> {public: static void output(std::ostream& os) {os << "Currency";}};
template <> class ObjClassName<DayCounter*> {public: static void output(std::ostream& os) {os << "DayCounter";}};
template <> class ObjClassName<DefaultProbabilityTermStructure*> {public: static void output(std::ostream& os) {os << "DefaultProbabilityTermStructure";}};
template <> class ObjClassName<DeltaVolQuote*> {public: static void output(std::ostream& os) {os << "DeltaVolQuote";}};
template <> class ObjClassName<DepositRateHelper*> {public: static void output(std::ostream& os) {os << "DepositRateHelper";}};
template <> class ObjClassName<DiscountingBondEngine*> {public: static void output(std::ostream& os) {os << "DiscountingBondEngine";}};
template <> class ObjClassName<DiscountingFxForwardEngine*> {public: static void output(std::ostream& os) {os << "DiscountingFxForwardEngine";}};
template <> class ObjClassName<DiscountingSwapEngine*> {public: static void output(std::ostream& os) {os << "DiscountingSwapEngine";}};
template <> class ObjClassName<Dividend*> {public: static void output(std::ostream& os) {os << "Dividend";}};
template <> class ObjClassName<EarlyExercise*> {public: static void output(std::ostream& os) {os << "EarlyExercise";}};
template <> class ObjClassName<EndCriteria*> {public: static void output(std::ostream& os) {os << "EndCriteria";}};
template <> class ObjClassName<EquityCashFlow*> {public: static void output(std::ostream& os) {os << "EquityCashFlow";}};
template <> class ObjClassName<EquityCashFlowPricer*> {public: static void output(std::ostream& os) {os << "EquityCashFlowPricer";}};
template <> class ObjClassName<EquityIndex*> {public: static void output(std::ostream& os) {os << "EquityIndex";}};
template <> class ObjClassName<EquityQuantoCashFlowPricer*> {public: static void output(std::ostream& os) {os << "EquityQuantoCashFlowPricer";}};
template <> class ObjClassName<EquityTotalReturnSwap*> {public: static void output(std::ostream& os) {os << "EquityTotalReturnSwap";}};
template <> class ObjClassName<EuropeanExercise*> {public: static void output(std::ostream& os) {os << "EuropeanExercise";}};
template <> class ObjClassName<EuropeanOption*> {public: static void output(std::ostream& os) {os << "EuropeanOption";}};
template <> class ObjClassName<Exercise*> {public: static void output(std::ostream& os) {os << "Exercise";}};
template <> class ObjClassName<ExponentialSplinesFitting*> {public: static void output(std::ostream& os) {os << "ExponentialSplinesFitting";}};
template <> class ObjClassName<ExtOUWithJumpsProcess*> {public: static void output(std::ostream& os) {os << "ExtOUWithJumpsProcess";}};
template <> class ObjClassName<ExtendedBlackScholesMertonProcess*> {public: static void output(std::ostream& os) {os << "ExtendedBlackScholesMertonProcess";}};
template <> class ObjClassName<ExtendedOrnsteinUhlenbeckProcess*> {public: static void output(std::ostream& os) {os << "ExtendedOrnsteinUhlenbeckProcess";}};
template <> class ObjClassName<FdmQuantoHelper*> {public: static void output(std::ostream& os) {os << "FdmQuantoHelper";}};
template <> class ObjClassName<FFTVanillaEngine*> {public: static void output(std::ostream& os) {os << "FFTVanillaEngine";}};
template <> class ObjClassName<FaceValueAccrualClaim*> {public: static void output(std::ostream& os) {os << "FaceValueAccrualClaim";}};
template <> class ObjClassName<FaceValueClaim*> {public: static void output(std::ostream& os) {os << "FaceValueClaim";}};
template <> class ObjClassName<FdG2SwaptionEngine*> {public: static void output(std::ostream& os) {os << "FdG2SwaptionEngine";}};
template <> class ObjClassName<FdHullWhiteSwaptionEngine*> {public: static void output(std::ostream& os) {os << "FdHullWhiteSwaptionEngine";}};
template <> class ObjClassName<FdmSchemeDesc*> {public: static void output(std::ostream& os) {os << "FdmSchemeDesc";}};
template <> class ObjClassName<FittedBondDiscountCurve*> {public: static void output(std::ostream& os) {os << "FittedBondDiscountCurve";}};
template <> class ObjClassName<FixedDividend*> {public: static void output(std::ostream& os) {os << "FixedDividend";}};
template <> class ObjClassName<FixedRateBond*> {public: static void output(std::ostream& os) {os << "FixedRateBond";}};
template <> class ObjClassName<FixedRateBondHelper*> {public: static void output(std::ostream& os) {os << "FixedRateBondHelper";}};
template <> class ObjClassName<FlatForward*> {public: static void output(std::ostream& os) {os << "FlatForward";}};
template <> class ObjClassName<FloatingRateBond*> {public: static void output(std::ostream& os) {os << "FloatingRateBond";}};
template <> class ObjClassName<FloatingRateCouponPricer*> {public: static void output(std::ostream& os) {os << "FloatingRateCouponPricer";}};
template <> class ObjClassName<Forward*> {public: static void output(std::ostream& os) {os << "Forward";}};
template <> class ObjClassName<ForwardRateAgreement*> {public: static void output(std::ostream& os) {os << "ForwardRateAgreement";}};
template <> class ObjClassName<ForwardSpreadedTermStructure*> {public: static void output(std::ostream& os) {os << "ForwardSpreadedTermStructure";}};
template <> class ObjClassName<FraRateHelper*> {public: static void output(std::ostream& os) {os << "FraRateHelper";}};
template <> class ObjClassName<FractionalDividend*> {public: static void output(std::ostream& os) {os << "FractionalDividend";}};
template <> class ObjClassName<FuturesRateHelper*> {public: static void output(std::ostream& os) {os << "FuturesRateHelper";}};
template <> class ObjClassName<FxForward*> {public: static void output(std::ostream& os) {os << "FxForward";}};
template <> class ObjClassName<G2*> {public: static void output(std::ostream& os) {os << "G2";}};
template <> class ObjClassName<G2SwaptionEngine*> {public: static void output(std::ostream& os) {os << "G2SwaptionEngine";}};
template <> class ObjClassName<GJRGARCHModel*> {public: static void output(std::ostream& os) {os << "GJRGARCHModel";}};
template <> class ObjClassName<GJRGARCHProcess*> {public: static void output(std::ostream& os) {os << "GJRGARCHProcess";}};
template <> class ObjClassName<GapPayoff*> {public: static void output(std::ostream& os) {os << "GapPayoff";}};
template <> class ObjClassName<GarmanKohlagenProcess*> {public: static void output(std::ostream& os) {os << "GarmanKohlagenProcess";}};
template <> class ObjClassName<Gaussian1dModel*> {public: static void output(std::ostream& os) {os << "Gaussian1dModel";}};
template <> class ObjClassName<GeneralizedBlackScholesProcess*> {public: static void output(std::ostream& os) {os << "GeneralizedBlackScholesProcess";}};
template <> class ObjClassName<GeneralizedHullWhite*> {public: static void output(std::ostream& os) {os << "GeneralizedHullWhite";}};
template <> class ObjClassName<Gsr*> {public: static void output(std::ostream& os) {os << "Gsr";}};
template <> class ObjClassName<HestonModel*> {public: static void output(std::ostream& os) {os << "HestonModel";}};
template <> class ObjClassName<HestonModelHelper*> {public: static void output(std::ostream& os) {os << "HestonModelHelper";}};
template <> class ObjClassName<HestonProcess*> {public: static void output(std::ostream& os) {os << "HestonProcess";}};
template <> class ObjClassName<HullWhite*> {public: static void output(std::ostream& os) {os << "HullWhite";}};
template <> class ObjClassName<HullWhiteForwardProcess*> {public: static void output(std::ostream& os) {os << "HullWhiteForwardProcess";}};
template <> class ObjClassName<HullWhiteProcess*> {public: static void output(std::ostream& os) {os << "HullWhiteProcess";}};
template <> class ObjClassName<HybridHestonHullWhiteProcess*> {public: static void output(std::ostream& os) {os << "HybridHestonHullWhiteProcess";}};
template <> class ObjClassName<IborIndex*> {public: static void output(std::ostream& os) {os << "IborIndex";}};
template <> class ObjClassName<ImpliedTermStructure*> {public: static void output(std::ostream& os) {os << "ImpliedTermStructure";}};
template <> class ObjClassName<ImpliedVolTermStructure*> {public: static void output(std::ostream& os) {os << "ImpliedVolTermStructure";}};
template <> class ObjClassName<Index*> {public: static void output(std::ostream& os) {os << "Index";}};
template <> class ObjClassName<InflationIndex*> {public: static void output(std::ostream& os) {os << "InflationIndex";}};
template <> class ObjClassName<Instrument*> {public: static void output(std::ostream& os) {os << "Instrument";}};
template <> class ObjClassName<IntegralCdsEngine*> {public: static void output(std::ostream& os) {os << "IntegralCdsEngine";}};
template <> class ObjClassName<IntegralEngine*> {public: static void output(std::ostream& os) {os << "IntegralEngine";}};
template <> class ObjClassName<InterestRate*> {public: static void output(std::ostream& os) {os << "InterestRate";}};
template <> class ObjClassName<InterestRateIndex*> {public: static void output(std::ostream& os) {os << "InterestRateIndex";}};
template <> class ObjClassName<JamshidianSwaptionEngine*> {public: static void output(std::ostream& os) {os << "JamshidianSwaptionEngine";}};
template <> class ObjClassName<JointCalendar*> {public: static void output(std::ostream& os) {os << "JointCalendar";}};
template <> class ObjClassName<JuQuadraticApproximationEngine*> {public: static void output(std::ostream& os) {os << "JuQuadraticApproximationEngine";}};
template <> class ObjClassName<JumpDiffusionEngine*> {public: static void output(std::ostream& os) {os << "JumpDiffusionEngine";}};
template <> class ObjClassName<KirkEngine*> {public: static void output(std::ostream& os) {os << "KirkEngine";}};
template <> class ObjClassName<KlugeExtOUProcess*> {public: static void output(std::ostream& os) {os << "KlugeExtOUProcess";}};
template <> class ObjClassName<LevenbergMarquardt*> {public: static void output(std::ostream& os) {os << "LevenbergMarquardt";}};
template <> class ObjClassName<LfmSwaptionEngine*> {public: static void output(std::ostream& os) {os << "LfmSwaptionEngine";}};
template <> class ObjClassName<LiborForwardModel*> {public: static void output(std::ostream& os) {os << "LiborForwardModel";}};
template <> class ObjClassName<LiborForwardModelProcess*> {public: static void output(std::ostream& os) {os << "LiborForwardModelProcess";}};
template <> class ObjClassName<LmCorrelationModel*> {public: static void output(std::ostream& os) {os << "LmCorrelationModel";}};
template <> class ObjClassName<LmVolatilityModel*> {public: static void output(std::ostream& os) {os << "LmVolatilityModel";}};
template <> class ObjClassName<LocalVolTermStructure*> {public: static void output(std::ostream& os) {os << "LocalVolTermStructure";}};
template <> class ObjClassName<MargrabeOption*> {public: static void output(std::ostream& os) {os << "MargrabeOption";}};
template <> class ObjClassName<MarkovFunctional*> {public: static void output(std::ostream& os) {os << "MarkovFunctional";}};
template <> class ObjClassName<Merton76Process*> {public: static void output(std::ostream& os) {os << "Merton76Process";}};
template <> class ObjClassName<MidPointCdsEngine*> {public: static void output(std::ostream& os) {os << "MidPointCdsEngine";}};
template <> class ObjClassName<MultiAssetOption*> {public: static void output(std::ostream& os) {os << "MultiAssetOption";}};
template <> class ObjClassName<MultiCurve*> {public: static void output(std::ostream& os) {os << "MultiCurve";}};
template <> class ObjClassName<NelsonSiegelFitting*> {public: static void output(std::ostream& os) {os << "NelsonSiegelFitting";}};
template <> class ObjClassName<NoConstraint*> {public: static void output(std::ostream& os) {os << "NoConstraint";}};
template <> class ObjClassName<OISRateHelper*> {public: static void output(std::ostream& os) {os << "OISRateHelper";}};
template <> class ObjClassName<OneAssetOption*> {public: static void output(std::ostream& os) {os << "OneAssetOption";}};
template <> class ObjClassName<OneFactorAffineModel*> {public: static void output(std::ostream& os) {os << "OneFactorAffineModel";}};
template <> class ObjClassName<OptimizationMethod*> {public: static void output(std::ostream& os) {os << "OptimizationMethod";}};
template <> class ObjClassName<Option*> {public: static void output(std::ostream& os) {os << "Option";}};
template <> class ObjClassName<OptionletVolatilityStructure*> {public: static void output(std::ostream& os) {os << "OptionletVolatilityStructure";}};
template <> class ObjClassName<OvernightIndex*> {public: static void output(std::ostream& os) {os << "OvernightIndex";}};
template <> class ObjClassName<OvernightIndexedSwap*> {public: static void output(std::ostream& os) {os << "OvernightIndexedSwap";}};
template <> class ObjClassName<OvernightIndexedSwapIndex*> {public: static void output(std::ostream& os) {os << "OvernightIndexedSwapIndex";}};
template <> class ObjClassName<Payoff*> {public: static void output(std::ostream& os) {os << "Payoff";}};
template <> class ObjClassName<PercentageStrikePayoff*> {public: static void output(std::ostream& os) {os << "PercentageStrikePayoff";}};
template <> class ObjClassName<PiecewiseTimeDependentHestonModel*> {public: static void output(std::ostream& os) {os << "PiecewiseTimeDependentHestonModel";}};
template <> class ObjClassName<PlainVanillaPayoff*> {public: static void output(std::ostream& os) {os << "PlainVanillaPayoff";}};
template <> class ObjClassName<PolymorphicPathGenerator*> {public: static void output(std::ostream& os) {os << "PolymorphicPathGenerator";}};
template <> class ObjClassName<PositiveConstraint*> {public: static void output(std::ostream& os) {os << "PositiveConstraint";}};
template <> class ObjClassName<PricingEngine*> {public: static void output(std::ostream& os) {os << "PricingEngine";}};
template <> class ObjClassName<QlAffineModel*> {public: static void output(std::ostream& os) {os << "QlAffineModel";}};
template <> class ObjClassName<QlAmericanExercise*> {public: static void output(std::ostream& os) {os << "QlAmericanExercise";}};
template <> class ObjClassName<QlAssetSwap*> {public: static void output(std::ostream& os) {os << "QlAssetSwap";}};
template <> class ObjClassName<QlBMAIndex*> {public: static void output(std::ostream& os) {os << "QlBMAIndex";}};
template <> class ObjClassName<QlBMASwap*> {public: static void output(std::ostream& os) {os << "QlBMASwap";}};
template <> class ObjClassName<QlBarrierOption*> {public: static void output(std::ostream& os) {os << "QlBarrierOption";}};
template <> class ObjClassName<QlDoubleBarrierOption*> {public: static void output(std::ostream& os) {os << "QlDoubleBarrierOption";}};
template <> class ObjClassName<QlBachelierCalculator*> {public: static void output(std::ostream& os) {os << "QlBachelierCalculator";}};
template <> class ObjClassName<QlBasketPayoff*> {public: static void output(std::ostream& os) {os << "QlBasketPayoff";}};
template <> class ObjClassName<QlBatesDetJumpModel*> {public: static void output(std::ostream& os) {os << "QlBatesDetJumpModel";}};
template <> class ObjClassName<QlBatesDoubleExpDetJumpModel*> {public: static void output(std::ostream& os) {os << "QlBatesDoubleExpDetJumpModel";}};
template <> class ObjClassName<QlBatesDoubleExpModel*> {public: static void output(std::ostream& os) {os << "QlBatesDoubleExpModel";}};
template <> class ObjClassName<QlBatesModel*> {public: static void output(std::ostream& os) {os << "QlBatesModel";}};
template <> class ObjClassName<QlBatesProcess*> {public: static void output(std::ostream& os) {os << "QlBatesProcess";}};
template <> class ObjClassName<QlBermudanExercise*> {public: static void output(std::ostream& os) {os << "QlBermudanExercise";}};
template <> class ObjClassName<QlBlackCalculator*> {public: static void output(std::ostream& os) {os << "QlBlackCalculator";}};
template <> class ObjClassName<QlBlackCalibrationHelper*> {public: static void output(std::ostream& os) {os << "QlBlackCalibrationHelper";}};
template <> class ObjClassName<QlBlackProcess*> {public: static void output(std::ostream& os) {os << "QlBlackProcess";}};
template <> class ObjClassName<QlBlackScholesCalculator*> {public: static void output(std::ostream& os) {os << "QlBlackScholesCalculator";}};
template <> class ObjClassName<QlBlackVarianceCurve*> {public: static void output(std::ostream& os) {os << "QlBlackVarianceCurve";}};
template <> class ObjClassName<QlBlackVolatilitySurfaceDelta*> {public: static void output(std::ostream& os) {os << "QlBlackVolatilitySurfaceDelta";}};
template <> class ObjClassName<QlBlackVolTermStructure*> {public: static void output(std::ostream& os) {os << "QlBlackVolTermStructure";}};
template <> class ObjClassName<QlBond*> {public: static void output(std::ostream& os) {os << "QlBond";}};
template <> class ObjClassName<QlBondForward*> {public: static void output(std::ostream& os) {os << "QlBondForward";}};
template <> class ObjClassName<QlBondHelper*> {public: static void output(std::ostream& os) {os << "QlBondHelper";}};
template <> class ObjClassName<QlCalibratedModel*> {public: static void output(std::ostream& os) {os << "QlCalibratedModel";}};
template <> class ObjClassName<QlCalibrationHelper*> {public: static void output(std::ostream& os) {os << "QlCalibrationHelper";}};
template <> class ObjClassName<QlCallability*> {public: static void output(std::ostream& os) {os << "QlCallability";}};
template <> class ObjClassName<QlCallableBond*> {public: static void output(std::ostream& os) {os << "QlCallableBond";}};
template <> class ObjClassName<QlCallableBondVolatilityStructure*> {public: static void output(std::ostream& os) {os << "QlCallableBondVolatilityStructure";}};
template <> class ObjClassName<QlCapFloor*> {public: static void output(std::ostream& os) {os << "QlCapFloor";}};
template <> class ObjClassName<QlCapFloorTermVolSurface*> {public: static void output(std::ostream& os) {os << "QlCapFloorTermVolSurface";}};
template <> class ObjClassName<QlCdsOption*> {public: static void output(std::ostream& os) {os << "QlCdsOption";}};
template <> class ObjClassName<QlClaim*> {public: static void output(std::ostream& os) {os << "QlClaim";}};
template <> class ObjClassName<QlConvertibleBond*> {public: static void output(std::ostream& os) {os << "QlConvertibleBond";}};
template <> class ObjClassName<QlCPIBond*> {public: static void output(std::ostream& os) {os << "QlCPIBond";}};
template <> class ObjClassName<QlCPICashFlow*> {public: static void output(std::ostream& os) {os << "QlCPICashFlow";}};
template <> class ObjClassName<QlCPISwap*> {public: static void output(std::ostream& os) {os << "QlCPISwap";}};
template <> class ObjClassName<QlCreditDefaultSwap*> {public: static void output(std::ostream& os) {os << "QlCreditDefaultSwap";}};
template <> class ObjClassName<QlDefaultProbabilityTermStructure*> {public: static void output(std::ostream& os) {os << "QlDefaultProbabilityTermStructure";}};
template <> class ObjClassName<QlDeltaVolQuote*> {public: static void output(std::ostream& os) {os << "QlDeltaVolQuote";}};
template <> class ObjClassName<QlDividend*> {public: static void output(std::ostream& os) {os << "QlDividend";}};
template <> class ObjClassName<QlEquityCashFlow*> {public: static void output(std::ostream& os) {os << "QlEquityCashFlow";}};
template <> class ObjClassName<QlEquityCashFlowPricer*> {public: static void output(std::ostream& os) {os << "QlEquityCashFlowPricer";}};
template <> class ObjClassName<QlEquityIndex*> {public: static void output(std::ostream& os) {os << "QlEquityIndex";}};
template <> class ObjClassName<QlEquityQuantoCashFlowPricer*> {public: static void output(std::ostream& os) {os << "QlEquityQuantoCashFlowPricer";}};
template <> class ObjClassName<QlEquityTotalReturnSwap*> {public: static void output(std::ostream& os) {os << "QlEquityTotalReturnSwap";}};
template <> class ObjClassName<QlEuropeanExercise*> {public: static void output(std::ostream& os) {os << "QlEuropeanExercise";}};
template <> class ObjClassName<QlExercise*> {public: static void output(std::ostream& os) {os << "QlExercise";}};
template <> class ObjClassName<QlExtOUWithJumpsProcess*> {public: static void output(std::ostream& os) {os << "QlExtOUWithJumpsProcess";}};
template <> class ObjClassName<QlExtendedOrnsteinUhlenbeckProcess*> {public: static void output(std::ostream& os) {os << "QlExtendedOrnsteinUhlenbeckProcess";}};
template <> class ObjClassName<QlFdmQuantoHelper*> {public: static void output(std::ostream& os) {os << "QlFdmQuantoHelper";}};
template <> class ObjClassName<QlFittedBondDiscountCurve*> {public: static void output(std::ostream& os) {os << "QlFittedBondDiscountCurve";}};
template <> class ObjClassName<QlFixedRateBond*> {public: static void output(std::ostream& os) {os << "QlFixedRateBond";}};
template <> class ObjClassName<QlFloatingRateCouponPricer*> {public: static void output(std::ostream& os) {os << "QlFloatingRateCouponPricer";}};
template <> class ObjClassName<QlForward*> {public: static void output(std::ostream& os) {os << "QlForward";}};
template <> class ObjClassName<QlForwardRateAgreement*> {public: static void output(std::ostream& os) {os << "QlForwardRateAgreement";}};
template <> class ObjClassName<QlFxForward*> {public: static void output(std::ostream& os) {os << "QlFxForward";}};
template <> class ObjClassName<QlG2*> {public: static void output(std::ostream& os) {os << "QlG2";}};
template <> class ObjClassName<QlGJRGARCHModel*> {public: static void output(std::ostream& os) {os << "QlGJRGARCHModel";}};
template <> class ObjClassName<QlGJRGARCHProcess*> {public: static void output(std::ostream& os) {os << "QlGJRGARCHProcess";}};
template <> class ObjClassName<QlGaussian1dModel*> {public: static void output(std::ostream& os) {os << "QlGaussian1dModel";}};
template <> class ObjClassName<QlGeneralizedBlackScholesProcess*> {public: static void output(std::ostream& os) {os << "QlGeneralizedBlackScholesProcess";}};
template <> class ObjClassName<QlGsr*> {public: static void output(std::ostream& os) {os << "QlGsr";}};
template <> class ObjClassName<QlHestonModel*> {public: static void output(std::ostream& os) {os << "QlHestonModel";}};
template <> class ObjClassName<QlHestonProcess*> {public: static void output(std::ostream& os) {os << "QlHestonProcess";}};
template <> class ObjClassName<QlHullWhite*> {public: static void output(std::ostream& os) {os << "QlHullWhite";}};
template <> class ObjClassName<QlHullWhiteForwardProcess*> {public: static void output(std::ostream& os) {os << "QlHullWhiteForwardProcess";}};
template <> class ObjClassName<QlHullWhiteProcess*> {public: static void output(std::ostream& os) {os << "QlHullWhiteProcess";}};
template <> class ObjClassName<QlHybridHestonHullWhiteProcess*> {public: static void output(std::ostream& os) {os << "QlHybridHestonHullWhiteProcess";}};
template <> class ObjClassName<QlIborIndex*> {public: static void output(std::ostream& os) {os << "QlIborIndex";}};
template <> class ObjClassName<QlIndex*> {public: static void output(std::ostream& os) {os << "QlIndex";}};
template <> class ObjClassName<QlInflationIndex*> {public: static void output(std::ostream& os) {os << "QlInflationIndex";}};
template <> class ObjClassName<QlInstrument*> {public: static void output(std::ostream& os) {os << "QlInstrument";}};
template <> class ObjClassName<QlInterestRateIndex*> {public: static void output(std::ostream& os) {os << "QlInterestRateIndex";}};
template <> class ObjClassName<QlKlugeExtOUProcess*> {public: static void output(std::ostream& os) {os << "QlKlugeExtOUProcess";}};
template <> class ObjClassName<QlLiborForwardModel*> {public: static void output(std::ostream& os) {os << "QlLiborForwardModel";}};
template <> class ObjClassName<QlLiborForwardModelProcess*> {public: static void output(std::ostream& os) {os << "QlLiborForwardModelProcess";}};
template <> class ObjClassName<QlLmCorrelationModel*> {public: static void output(std::ostream& os) {os << "QlLmCorrelationModel";}};
template <> class ObjClassName<QlLmVolatilityModel*> {public: static void output(std::ostream& os) {os << "QlLmVolatilityModel";}};
template <> class ObjClassName<QlLocalVolTermStructure*> {public: static void output(std::ostream& os) {os << "QlLocalVolTermStructure";}};
template <> class ObjClassName<QlMargrabeOption*> {public: static void output(std::ostream& os) {os << "QlMargrabeOption";}};
template <> class ObjClassName<QlMarkovFunctional*> {public: static void output(std::ostream& os) {os << "QlMarkovFunctional";}};
template <> class ObjClassName<QlMerton76Process*> {public: static void output(std::ostream& os) {os << "QlMerton76Process";}};
template <> class ObjClassName<QlMultiAssetOption*> {public: static void output(std::ostream& os) {os << "QlMultiAssetOption";}};
template <> class ObjClassName<QlMultiCurve*> {public: static void output(std::ostream& os) {os << "QlMultiCurve";}};
template <> class ObjClassName<QlOISRateHelper*> {public: static void output(std::ostream& os) {os << "QlOISRateHelper";}};
template <> class ObjClassName<QlOneAssetOption*> {public: static void output(std::ostream& os) {os << "QlOneAssetOption";}};
template <> class ObjClassName<QlOneFactorAffineModel*> {public: static void output(std::ostream& os) {os << "QlOneFactorAffineModel";}};
template <> class ObjClassName<QlOption*> {public: static void output(std::ostream& os) {os << "QlOption";}};
template <> class ObjClassName<QlOptionletVolatilityStructure*> {public: static void output(std::ostream& os) {os << "QlOptionletVolatilityStructure";}};
template <> class ObjClassName<QlOvernightIndex*> {public: static void output(std::ostream& os) {os << "QlOvernightIndex";}};
template <> class ObjClassName<QlOvernightIndexedSwap*> {public: static void output(std::ostream& os) {os << "QlOvernightIndexedSwap";}};
template <> class ObjClassName<QlOvernightIndexedSwapIndex*> {public: static void output(std::ostream& os) {os << "QlOvernightIndexedSwapIndex";}};
template <> class ObjClassName<QlPayoff*> {public: static void output(std::ostream& os) {os << "QlPayoff";}};
template <> class ObjClassName<QlPercentageStrikePayoff*> {public: static void output(std::ostream& os) {os << "QlPercentageStrikePayoff";}};
template <> class ObjClassName<QlPiecewiseTimeDependentHestonModel*> {public: static void output(std::ostream& os) {os << "QlPiecewiseTimeDependentHestonModel";}};
template <> class ObjClassName<QlPlainVanillaPayoff*> {public: static void output(std::ostream& os) {os << "QlPlainVanillaPayoff";}};
template <> class ObjClassName<QlPricingEngine*> {public: static void output(std::ostream& os) {os << "QlPricingEngine";}};
template <> class ObjClassName<QlQuantoBarrierOption*> {public: static void output(std::ostream& os) {os << "QlQuantoBarrierOption";}};
template <> class ObjClassName<QlQuantoForwardVanillaOption*> {public: static void output(std::ostream& os) {os << "QlQuantoForwardVanillaOption";}};
template <> class ObjClassName<QlQuantoVanillaOption*> {public: static void output(std::ostream& os) {os << "QlQuantoVanillaOption";}};
template <> class ObjClassName<QlQuote*> {public: static void output(std::ostream& os) {os << "QlQuote";}};
template <> class ObjClassName<QlSabrInterpolatedSmileSection*> {public: static void output(std::ostream& os) {os << "QlSabrInterpolatedSmileSection";}};
template <> class ObjClassName<QlShortRateModel*> {public: static void output(std::ostream& os) {os << "QlShortRateModel";}};
template <> class ObjClassName<QlSimpleQuote*> {public: static void output(std::ostream& os) {os << "QlSimpleQuote";}};
template <> class ObjClassName<QlSmileSection*> {public: static void output(std::ostream& os) {os << "QlSmileSection";}};
template <> class ObjClassName<QlStochasticProcess*> {public: static void output(std::ostream& os) {os << "QlStochasticProcess";}};
template <> class ObjClassName<QlStochasticProcess1D*> {public: static void output(std::ostream& os) {os << "QlStochasticProcess1D";}};
template <> class ObjClassName<QlStochasticProcessArray*> {public: static void output(std::ostream& os) {os << "QlStochasticProcessArray";}};
template <> class ObjClassName<QlStrikedTypePayoff*> {public: static void output(std::ostream& os) {os << "QlStrikedTypePayoff";}};
template <> class ObjClassName<QlSwap*> {public: static void output(std::ostream& os) {os << "QlSwap";}};
template <> class ObjClassName<QlSwapIndex*> {public: static void output(std::ostream& os) {os << "QlSwapIndex";}};
template <> class ObjClassName<QlSwapRateHelper*> {public: static void output(std::ostream& os) {os << "QlSwapRateHelper";}};
template <> class ObjClassName<QlSwaption*> {public: static void output(std::ostream& os) {os << "QlSwaption";}};
template <> class ObjClassName<QlSwaptionVolatilityStructure*> {public: static void output(std::ostream& os) {os << "QlSwaptionVolatilityStructure";}};
template <> class ObjClassName<QlSabrSwaptionVolatilityCube*> {public: static void output(std::ostream& os) {os << "QlSabrSwaptionVolatilityCube";}};
template <> class ObjClassName<QlInterpolatedSwaptionVolatilityCube*> {public: static void output(std::ostream& os) {os << "QlInterpolatedSwaptionVolatilityCube";}};
template <> class ObjClassName<QlSwingExercise*> {public: static void output(std::ostream& os) {os << "QlSwingExercise";}};
template <> class ObjClassName<QlTermStructure*> {public: static void output(std::ostream& os) {os << "QlTermStructure";}};
template <> class ObjClassName<QlTypePayoff*> {public: static void output(std::ostream& os) {os << "QlTypePayoff";}};
template <> class ObjClassName<QlVanillaOption*> {public: static void output(std::ostream& os) {os << "QlVanillaOption";}};
template <> class ObjClassName<QlVanillaSwap*> {public: static void output(std::ostream& os) {os << "QlVanillaSwap";}};
template <> class ObjClassName<QlVarianceGammaProcess*> {public: static void output(std::ostream& os) {os << "QlVarianceGammaProcess";}};
template <> class ObjClassName<QlVarianceOption*> {public: static void output(std::ostream& os) {os << "QlVarianceOption";}};
template <> class ObjClassName<QlVarianceSwap*> {public: static void output(std::ostream& os) {os << "QlVarianceSwap";}};
template <> class ObjClassName<QlVolatilityTermStructure*> {public: static void output(std::ostream& os) {os << "QlVolatilityTermStructure";}};
template <> class ObjClassName<QlYearOnYearInflationSwap*> {public: static void output(std::ostream& os) {os << "QlYearOnYearInflationSwap";}};
template <> class ObjClassName<QlYearOnYearInflationSwapHelper*> {public: static void output(std::ostream& os) {os << "QlYearOnYearInflationSwapHelper";}};
template <> class ObjClassName<QlYieldTermStructure*> {public: static void output(std::ostream& os) {os << "QlYieldTermStructure";}};
template <> class ObjClassName<QlYoYInflationIndex*> {public: static void output(std::ostream& os) {os << "QlYoYInflationIndex";}};
template <> class ObjClassName<QlYoYInflationTermStructure*> {public: static void output(std::ostream& os) {os << "QlYoYInflationTermStructure";}};
template <> class ObjClassName<QlZeroCouponInflationSwap*> {public: static void output(std::ostream& os) {os << "QlZeroCouponInflationSwap";}};
template <> class ObjClassName<QlZeroCouponSwap*> {public: static void output(std::ostream& os) {os << "QlZeroCouponSwap";}};
template <> class ObjClassName<QlZeroCouponInflationSwapHelper*> {public: static void output(std::ostream& os) {os << "QlZeroCouponInflationSwapHelper";}};
template <> class ObjClassName<QlZeroInflationCashFlow*> {public: static void output(std::ostream& os) {os << "QlZeroInflationCashFlow";}};
template <> class ObjClassName<QlZeroInflationIndex*> {public: static void output(std::ostream& os) {os << "QlZeroInflationIndex";}};
template <> class ObjClassName<QlZeroInflationTermStructure*> {public: static void output(std::ostream& os) {os << "QlZeroInflationTermStructure";}};
template <> class ObjClassName<QuantoBarrierOption*> {public: static void output(std::ostream& os) {os << "QuantoBarrierOption";}};
template <> class ObjClassName<QuantoForwardVanillaOption*> {public: static void output(std::ostream& os) {os << "QuantoForwardVanillaOption";}};
template <> class ObjClassName<QuantoTermStructure*> {public: static void output(std::ostream& os) {os << "QuantoTermStructure";}};
template <> class ObjClassName<QuantoVanillaOption*> {public: static void output(std::ostream& os) {os << "QuantoVanillaOption";}};
template <> class ObjClassName<Quote*> {public: static void output(std::ostream& os) {os << "Quote";}};
template <> class ObjClassName<Region*> {public: static void output(std::ostream& os) {os << "Region";}};
template <> class ObjClassName<ReplicatingVarianceSwapEngine*> {public: static void output(std::ostream& os) {os << "ReplicatingVarianceSwapEngine";}};
template <> class ObjClassName<Rounding*> {public: static void output(std::ostream& os) {os << "Rounding";}};
template <> class ObjClassName<Schedule*> {public: static void output(std::ostream& os) {os << "Schedule";}};
template <> class ObjClassName<ShortRateModel*> {public: static void output(std::ostream& os) {os << "ShortRateModel";}};
template <> class ObjClassName<SimplePolynomialFitting*> {public: static void output(std::ostream& os) {os << "SimplePolynomialFitting";}};
template <> class ObjClassName<SimpleQuote*> {public: static void output(std::ostream& os) {os << "SimpleQuote";}};
template <> class ObjClassName<Simplex*> {public: static void output(std::ostream& os) {os << "Simplex";}};
template <> class ObjClassName<SmileSection*> {public: static void output(std::ostream& os) {os << "SmileSection";}};
template <> class ObjClassName<SoftCallability*> {public: static void output(std::ostream& os) {os << "SoftCallability";}};
template <> class ObjClassName<SpreadCdsHelper*> {public: static void output(std::ostream& os) {os << "SpreadCdsHelper";}};
template <> class ObjClassName<StochasticProcess*> {public: static void output(std::ostream& os) {os << "StochasticProcess";}};
template <> class ObjClassName<StochasticProcess1D*> {public: static void output(std::ostream& os) {os << "StochasticProcess1D";}};
template <> class ObjClassName<StochasticProcessArray*> {public: static void output(std::ostream& os) {os << "StochasticProcessArray";}};
template <> class ObjClassName<StrikedTypePayoff*> {public: static void output(std::ostream& os) {os << "StrikedTypePayoff";}};
template <> class ObjClassName<StulzEngine*> {public: static void output(std::ostream& os) {os << "StulzEngine";}};
template <> class ObjClassName<SuperFundPayoff*> {public: static void output(std::ostream& os) {os << "SuperFundPayoff";}};
template <> class ObjClassName<SuperSharePayoff*> {public: static void output(std::ostream& os) {os << "SuperSharePayoff";}};
template <> class ObjClassName<SvenssonFitting*> {public: static void output(std::ostream& os) {os << "SvenssonFitting";}};
template <> class ObjClassName<Swap*> {public: static void output(std::ostream& os) {os << "Swap";}};
template <> class ObjClassName<SwapIndex*> {public: static void output(std::ostream& os) {os << "SwapIndex";}};
template <> class ObjClassName<SwapRateHelper*> {public: static void output(std::ostream& os) {os << "SwapRateHelper";}};
template <> class ObjClassName<Swaption*> {public: static void output(std::ostream& os) {os << "Swaption";}};
template <> class ObjClassName<SwaptionHelper*> {public: static void output(std::ostream& os) {os << "SwaptionHelper";}};
template <> class ObjClassName<SwaptionVolatilityStructure*> {public: static void output(std::ostream& os) {os << "SwaptionVolatilityStructure";}};
template <> class ObjClassName<SwingExercise*> {public: static void output(std::ostream& os) {os << "SwingExercise";}};
template <> class ObjClassName<TermStructure*> {public: static void output(std::ostream& os) {os << "TermStructure";}};
template <> class ObjClassName<TimeGrid*> {public: static void output(std::ostream& os) {os << "TimeGrid";}};
template <> class ObjClassName<TreeCallableFixedRateBondEngine*> {public: static void output(std::ostream& os) {os << "TreeCallableFixedRateBondEngine";}};
template <> class ObjClassName<TreeCallableZeroCouponBondEngine*> {public: static void output(std::ostream& os) {os << "TreeCallableZeroCouponBondEngine";}};
template <> class ObjClassName<TreeCapFloorEngine*> {public: static void output(std::ostream& os) {os << "TreeCapFloorEngine";}};
template <> class ObjClassName<TreeSwaptionEngine*> {public: static void output(std::ostream& os) {os << "TreeSwaptionEngine";}};
template <> class ObjClassName<TreeVanillaSwapEngine*> {public: static void output(std::ostream& os) {os << "TreeVanillaSwapEngine";}};
template <> class ObjClassName<TypePayoff*> {public: static void output(std::ostream& os) {os << "TypePayoff";}};
template <> class ObjClassName<UpfrontCdsHelper*> {public: static void output(std::ostream& os) {os << "UpfrontCdsHelper";}};
template <> class ObjClassName<VanillaOption*> {public: static void output(std::ostream& os) {os << "VanillaOption";}};
template <> class ObjClassName<VanillaSwap*> {public: static void output(std::ostream& os) {os << "VanillaSwap";}};
template <> class ObjClassName<VarianceGammaEngine*> {public: static void output(std::ostream& os) {os << "VarianceGammaEngine";}};
template <> class ObjClassName<VarianceGammaProcess*> {public: static void output(std::ostream& os) {os << "VarianceGammaProcess";}};
template <> class ObjClassName<VarianceSwap*> {public: static void output(std::ostream& os) {os << "VarianceSwap";}};
template <> class ObjClassName<VegaStressedBlackScholesProcess*> {public: static void output(std::ostream& os) {os << "VegaStressedBlackScholesProcess";}};
template <> class ObjClassName<VolatilityTermStructure*> {public: static void output(std::ostream& os) {os << "VolatilityTermStructure";}};
template <> class ObjClassName<YearOnYearInflationSwap*> {public: static void output(std::ostream& os) {os << "YearOnYearInflationSwap";}};
template <> class ObjClassName<YearOnYearInflationSwapHelper*> {public: static void output(std::ostream& os) {os << "YearOnYearInflationSwapHelper";}};
template <> class ObjClassName<YieldTermStructure*> {public: static void output(std::ostream& os) {os << "YieldTermStructure";}};
template <> class ObjClassName<YoYInflationIndex*> {public: static void output(std::ostream& os) {os << "YoYInflationIndex";}};
template <> class ObjClassName<YoYInflationTermStructure*> {public: static void output(std::ostream& os) {os << "YoYInflationTermStructure";}};
template <> class ObjClassName<ZeroCouponBond*> {public: static void output(std::ostream& os) {os << "ZeroCouponBond";}};
template <> class ObjClassName<ZeroCouponInflationSwap*> {public: static void output(std::ostream& os) {os << "ZeroCouponInflationSwap";}};
template <> class ObjClassName<ZeroCouponSwap*> {public: static void output(std::ostream& os) {os << "ZeroCouponSwap";}};
template <> class ObjClassName<ZeroCouponInflationSwapHelper*> {public: static void output(std::ostream& os) {os << "ZeroCouponInflationSwapHelper";}};
template <> class ObjClassName<ZeroInflationIndex*> {public: static void output(std::ostream& os) {os << "ZeroInflationIndex";}};
template <> class ObjClassName<ZeroInflationTermStructure*> {public: static void output(std::ostream& os) {os << "ZeroInflationTermStructure";}};
template <> class ObjClassName<ZeroSpreadedTermStructure*> {public: static void output(std::ostream& os) {os << "ZeroSpreadedTermStructure";}};
template <> class ObjClassName<void*> {public: static void output(std::ostream& os) {os << "Ptr";}};
extern std::ofstream ofs;
template <class T>
T traceval(const char *text, T val) {
ofs << text << " "; ObjClassName<T>::output(ofs); ofs << ": " << val << std::endl;
return val;
}
#endif
template <class T> T arg(T p) {return TP("arg", p);}
template <class T> void del(T p) {delete TP("deleting", p); TP2("deleted", p);}
template <class T> T alloc(T p) {return TP("allocated", p);}
template <class T> T ret(T p) {return TP("returned", p);}
const Date qlNullableDate(int serialNumber);
int qlNullableDate(const Date &date);
inline std::vector<Date> qlDateVector(int *dates, unsigned len) {
std::vector<Date> d; d.reserve(len);
for (unsigned i = 0; i < len; ++i)
d.push_back(Date(dates[i]));
return d;
}
inline std::vector<Period> qlPeriodVector(int *num, int *unit, unsigned len) {
std::vector<Period> periods; periods.reserve(len);
for (unsigned i = 0; i < len; ++i)
periods.push_back(Period(num[i], (TimeUnit)unit[i]));
return periods;
}
inline Matrix qlMatrix(double *a, unsigned r, unsigned c) {
Matrix m (r, c); std::copy(a, a+r*c, m.begin());
return m;
}
// Some constructors (e.g. SwaptionVolatilityMatrix's Handle<Quote>-vols overload) take a plain
// vector<vector<Real>> rather than a Matrix for a same-shaped Real-only argument (shifts).
inline std::vector<std::vector<double> > qlRealMatrix(double *a, unsigned r, unsigned c) {
std::vector<std::vector<double> > m; m.reserve(r);
for (unsigned i = 0; i < r; ++i)
m.push_back(std::vector<double>(a + i*c, a + (i+1)*c));
return m;
}
optional<bool> qlOptBool(int b);
int qlOptBool(optional<bool> b);
optional<BusinessDayConvention> qlOptBusinessDayConvention(int c);
template <class T> Handle<T> qlNullableHandle(shared_ptr<T> *p) {return p ? Handle<T>(*(arg(p))) : Handle<T>();}
// Handle form: pass the caller's Handle straight through, so a relinkable handle keeps its
// Link (rewrapping it via Handle<T>(shared_ptr) would make a fresh one and silently detach
// relinking). Null means an empty handle, as with the shared_ptr form above.
template <class T> Handle<T> qlNullableHandle(Handle<T> *p) {return p ? *(arg(p)) : Handle<T>();}
// Same as the Handle form above, but null means "construct this default" (via the caller's
// `make`, returning shared_ptr<T>) rather than an empty handle. Still the one accepted shape of
// Handle<T>(shared_ptr<...>) construction: the default branch has no pre-existing Link to
// detach from, since `make` builds the object fresh right here. Named and centralised so a
// call site never has to spell Handle<T>(...) itself -- see qlBlackIborCouponPricer's
// default-correlation SimpleQuote for the motivating case.
template <class T, class F> Handle<T> qlNullableHandleOr(Handle<T> *p, F make) {return p ? *(arg(p)) : Handle<T>(make());}
// Accessors for the QuantLib free functions (BondFunctions::, CashFlows::) that want the
// pointee rather than the handle. Named rather than spelled with stars because *arg(h),
// **arg(h) and ***arg(h) are all well-formed here and differ by a single character inside
// very long argument lists -- and picking the wrong one is the failure mode this whole design
// has to guard against. Both throw on an empty handle, per Handle::operator*. Generic over T
// (not curve-specific) so every Handle-shaped type -- Quote, the vol structures -- reuses these
// rather than growing its own same-shaped spelling.
template <class T> const shared_ptr<T>& handlePtr(Handle<T> *p) {return **arg(p);}
template <class T> const T& handleRef(Handle<T> *p) {return ***arg(p);}
template <class T>
inline std::vector<T> qlVector(T **vals, size_t len) {
std::vector<T> r; r.reserve(len);
for (size_t i = 0; i < len; ++i)
r.push_back(*vals[i]);
return r;
}
// vals elements are already Handle<T>*, since a Quote/vol-structure array is an array of the
// same Handle-backed pointer type used everywhere else -- copying *arg(vals[i]) into the
// vector shares its Link like any other Handle copy, so a relinkable element stays tracked.
template <class T>
inline std::vector<Handle<T> > qlHandleVector(Handle<T> **vals, size_t len) {
std::vector<Handle<T> > r; r.reserve(len);
for (size_t i = 0; i < len; ++i)
r.push_back(*arg(vals[i]));
return r;
}
template <class T>
T *handleException(char **msg, std::exception &e, T *t) {
*msg = DUP(e.what());
if (t)
delete t;
return 0;
}
template <class T>
T handleException(char **msg, std::exception &e) {
*msg = DUP(e.what());
return 0;
}
#define LENGTH(a) (sizeof(a)/sizeof(a[0]))
#define LAST(a) (a + sizeof(a)/sizeof(a[0]))
/* vim: set ft=cpp ff=unix ts=8 sts=2 sw=2 et: */