//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace QuantLib {

public class NQuantLibc {
  public static double daysBetween(Date arg0, Date arg1) {
    double ret = NQuantLibcPINVOKE.daysBetween(Date.getCPtr(arg0), Date.getCPtr(arg1));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Matrix inverse(Matrix m) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.inverse(Matrix.getCPtr(m)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Matrix transpose(Matrix m) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.transpose(Matrix.getCPtr(m)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Matrix outerProduct(QlArray v1, QlArray v2) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.outerProduct(QlArray.getCPtr(v1), QlArray.getCPtr(v2)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Matrix pseudoSqrt(Matrix m, SalvagingAlgorithm.Type a) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.pseudoSqrt(Matrix.getCPtr(m), (int)a), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static bool close(double x, double y) {
    bool ret = NQuantLibcPINVOKE.close__SWIG_0(x, y);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static bool close(double x, double y, uint n) {
    bool ret = NQuantLibcPINVOKE.close__SWIG_1(x, y, n);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static bool close_enough(double x, double y) {
    bool ret = NQuantLibcPINVOKE.close_enough__SWIG_0(x, y);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static bool close_enough(double x, double y, uint n) {
    bool ret = NQuantLibcPINVOKE.close_enough__SWIG_1(x, y, n);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static int nullInt() {
    int ret = NQuantLibcPINVOKE.nullInt();
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double nullDouble() {
    double ret = NQuantLibcPINVOKE.nullDouble();
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static IborIndex as_iborindex(InterestRateIndex index) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_iborindex(InterestRateIndex.getCPtr(index));
    IborIndex ret = (cPtr == global::System.IntPtr.Zero) ? null : new IborIndex(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static SwapIndex as_swap_index(InterestRateIndex index) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_swap_index(InterestRateIndex.getCPtr(index));
    SwapIndex ret = (cPtr == global::System.IntPtr.Zero) ? null : new SwapIndex(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double sabrVolatility(double strike, double forward, double expiryTime, double alpha, double beta, double nu, double rho) {
    double ret = NQuantLibcPINVOKE.sabrVolatility(strike, forward, expiryTime, alpha, beta, nu, rho);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double shiftedSabrVolatility(double strike, double forward, double expiryTime, double alpha, double beta, double nu, double rho, double shift) {
    double ret = NQuantLibcPINVOKE.shiftedSabrVolatility(strike, forward, expiryTime, alpha, beta, nu, rho, shift);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double sabrFlochKennedyVolatility(double strike, double forward, double expiryTime, double alpha, double beta, double nu, double rho) {
    double ret = NQuantLibcPINVOKE.sabrFlochKennedyVolatility(strike, forward, expiryTime, alpha, beta, nu, rho);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static GsrProcess as_gsr_process(StochasticProcess proc) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_gsr_process(StochasticProcess.getCPtr(proc));
    GsrProcess ret = (cPtr == global::System.IntPtr.Zero) ? null : new GsrProcess(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static IndexedCashFlow as_indexed_cashflow(CashFlow cf) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_indexed_cashflow(CashFlow.getCPtr(cf));
    IndexedCashFlow ret = (cPtr == global::System.IntPtr.Zero) ? null : new IndexedCashFlow(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Coupon as_coupon(CashFlow cf) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_coupon(CashFlow.getCPtr(cf));
    Coupon ret = (cPtr == global::System.IntPtr.Zero) ? null : new Coupon(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static FixedRateCoupon as_fixed_rate_coupon(CashFlow cf) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_fixed_rate_coupon(CashFlow.getCPtr(cf));
    FixedRateCoupon ret = (cPtr == global::System.IntPtr.Zero) ? null : new FixedRateCoupon(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void setCouponPricer(Leg arg0, FloatingRateCouponPricer arg1) {
    NQuantLibcPINVOKE.setCouponPricer(Leg.getCPtr(arg0), FloatingRateCouponPricer.getCPtr(arg1));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public static FloatingRateCoupon as_floating_rate_coupon(CashFlow cf) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_floating_rate_coupon(CashFlow.getCPtr(cf));
    FloatingRateCoupon ret = (cPtr == global::System.IntPtr.Zero) ? null : new FloatingRateCoupon(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates, BusinessDayConvention paymentAdjustment, DayCounter firstPeriodDayCount, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention, bool exCouponEndOfMonth) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_0(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates), (int)paymentAdjustment, DayCounter.getCPtr(firstPeriodDayCount), Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention, exCouponEndOfMonth), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates, BusinessDayConvention paymentAdjustment, DayCounter firstPeriodDayCount, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_1(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates), (int)paymentAdjustment, DayCounter.getCPtr(firstPeriodDayCount), Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates, BusinessDayConvention paymentAdjustment, DayCounter firstPeriodDayCount, Period exCouponPeriod, Calendar exCouponCalendar) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_2(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates), (int)paymentAdjustment, DayCounter.getCPtr(firstPeriodDayCount), Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates, BusinessDayConvention paymentAdjustment, DayCounter firstPeriodDayCount, Period exCouponPeriod) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_3(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates), (int)paymentAdjustment, DayCounter.getCPtr(firstPeriodDayCount), Period.getCPtr(exCouponPeriod)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates, BusinessDayConvention paymentAdjustment, DayCounter firstPeriodDayCount) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_4(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates), (int)paymentAdjustment, DayCounter.getCPtr(firstPeriodDayCount)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates, BusinessDayConvention paymentAdjustment) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_5(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates), (int)paymentAdjustment), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg FixedRateLeg(Schedule schedule, DayCounter dayCount, DoubleVector nominals, DoubleVector couponRates) {
    Leg ret = new Leg(NQuantLibcPINVOKE.FixedRateLeg__SWIG_6(Schedule.getCPtr(schedule), DayCounter.getCPtr(dayCount), DoubleVector.getCPtr(nominals), DoubleVector.getCPtr(couponRates)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention, bool exCouponEndOfMonth) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_0(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention, exCouponEndOfMonth), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_1(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod, Calendar exCouponCalendar) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_2(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_3(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_4(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_5(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_6(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_7(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_8(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_9(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_10(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index, DayCounter paymentDayCounter) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_11(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg IborLeg(DoubleVector nominals, Schedule schedule, IborIndex index) {
    Leg ret = new Leg(NQuantLibcPINVOKE.IborLeg__SWIG_12(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), IborIndex.getCPtr(index)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg OvernightLeg(DoubleVector nominals, Schedule schedule, OvernightIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, DoubleVector gearings, DoubleVector spreads, bool telescopicValueDates) {
    Leg ret = new Leg(NQuantLibcPINVOKE.OvernightLeg__SWIG_0(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), OvernightIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), telescopicValueDates), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg OvernightLeg(DoubleVector nominals, Schedule schedule, OvernightIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, DoubleVector gearings, DoubleVector spreads) {
    Leg ret = new Leg(NQuantLibcPINVOKE.OvernightLeg__SWIG_1(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), OvernightIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg OvernightLeg(DoubleVector nominals, Schedule schedule, OvernightIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, DoubleVector gearings) {
    Leg ret = new Leg(NQuantLibcPINVOKE.OvernightLeg__SWIG_2(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), OvernightIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, DoubleVector.getCPtr(gearings)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg OvernightLeg(DoubleVector nominals, Schedule schedule, OvernightIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.OvernightLeg__SWIG_3(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), OvernightIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg OvernightLeg(DoubleVector nominals, Schedule schedule, OvernightIndex index, DayCounter paymentDayCounter) {
    Leg ret = new Leg(NQuantLibcPINVOKE.OvernightLeg__SWIG_4(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), OvernightIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg OvernightLeg(DoubleVector nominals, Schedule schedule, OvernightIndex index) {
    Leg ret = new Leg(NQuantLibcPINVOKE.OvernightLeg__SWIG_5(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), OvernightIndex.getCPtr(index)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention, bool exCouponEndOfMonth) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_0(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention, exCouponEndOfMonth), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_1(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod, Calendar exCouponCalendar) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_2(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears, Period exCouponPeriod) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_3(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears, Period.getCPtr(exCouponPeriod)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_4(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_5(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_6(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_7(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_8(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_9(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_10(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_11(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsLeg(DoubleVector nominals, Schedule schedule, SwapIndex index) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsLeg__SWIG_12(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention, bool exCouponEndOfMonth) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_0(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention, exCouponEndOfMonth), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, Period exCouponPeriod, Calendar exCouponCalendar, BusinessDayConvention exCouponConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_1(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar), (int)exCouponConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, Period exCouponPeriod, Calendar exCouponCalendar) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_2(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), Period.getCPtr(exCouponPeriod), Calendar.getCPtr(exCouponCalendar)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, Period exCouponPeriod) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_3(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), Period.getCPtr(exCouponPeriod)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_4(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_5(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_6(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_7(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_8(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_9(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index, DayCounter paymentDayCounter) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_10(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsZeroLeg(DoubleVector nominals, Schedule schedule, SwapIndex index) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsZeroLeg__SWIG_11(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapIndex.getCPtr(index)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors, bool isInArrears) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_0(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors), isInArrears), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_1(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_2(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings, DoubleVector spreads) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_3(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays, DoubleVector gearings) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_4(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays), DoubleVector.getCPtr(gearings)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, UnsignedIntVector fixingDays) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_5(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention, UnsignedIntVector.getCPtr(fixingDays)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter, BusinessDayConvention paymentConvention) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_6(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter), (int)paymentConvention), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index, DayCounter paymentDayCounter) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_7(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index), DayCounter.getCPtr(paymentDayCounter)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg CmsSpreadLeg(DoubleVector nominals, Schedule schedule, SwapSpreadIndex index) {
    Leg ret = new Leg(NQuantLibcPINVOKE.CmsSpreadLeg__SWIG_8(DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), SwapSpreadIndex.getCPtr(index)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static BlackCalibrationHelper as_black_helper(CalibrationHelper h) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_black_helper(CalibrationHelper.getCPtr(h));
    BlackCalibrationHelper ret = (cPtr == global::System.IntPtr.Zero) ? null : new BlackCalibrationHelper(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static SWIGTYPE_p_ext__shared_ptrT_SwaptionHelper_t as_swaption_helper(BlackCalibrationHelper h) {
    SWIGTYPE_p_ext__shared_ptrT_SwaptionHelper_t ret = new SWIGTYPE_p_ext__shared_ptrT_SwaptionHelper_t(NQuantLibcPINVOKE.as_swaption_helper(BlackCalibrationHelper.getCPtr(h)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static PlainVanillaPayoff as_plain_vanilla_payoff(Payoff payoff) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_plain_vanilla_payoff(Payoff.getCPtr(payoff));
    PlainVanillaPayoff ret = (cPtr == global::System.IntPtr.Zero) ? null : new PlainVanillaPayoff(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormula(Option.Type optionType, double strike, double forward, double stdDev, double discount, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormula__SWIG_0((int)optionType, strike, forward, stdDev, discount, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormula(Option.Type optionType, double strike, double forward, double stdDev, double discount) {
    double ret = NQuantLibcPINVOKE.blackFormula__SWIG_1((int)optionType, strike, forward, stdDev, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormula(Option.Type optionType, double strike, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.blackFormula__SWIG_2((int)optionType, strike, forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDev(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess, double accuracy, uint maxIterations) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDev__SWIG_0((int)optionType, strike, forward, blackPrice, discount, displacement, guess, accuracy, maxIterations);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDev(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess, double accuracy) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDev__SWIG_1((int)optionType, strike, forward, blackPrice, discount, displacement, guess, accuracy);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDev(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDev__SWIG_2((int)optionType, strike, forward, blackPrice, discount, displacement, guess);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDev(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDev__SWIG_3((int)optionType, strike, forward, blackPrice, discount, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDev(Option.Type optionType, double strike, double forward, double blackPrice, double discount) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDev__SWIG_4((int)optionType, strike, forward, blackPrice, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDev(Option.Type optionType, double strike, double forward, double blackPrice) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDev__SWIG_5((int)optionType, strike, forward, blackPrice);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess, double omega, double accuracy, uint maxIterations) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_0((int)optionType, strike, forward, blackPrice, discount, displacement, guess, omega, accuracy, maxIterations);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess, double omega, double accuracy) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_1((int)optionType, strike, forward, blackPrice, discount, displacement, guess, omega, accuracy);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess, double omega) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_2((int)optionType, strike, forward, blackPrice, discount, displacement, guess, omega);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement, double guess) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_3((int)optionType, strike, forward, blackPrice, discount, displacement, guess);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice, double discount, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_4((int)optionType, strike, forward, blackPrice, discount, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice, double discount) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_5((int)optionType, strike, forward, blackPrice, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(Option.Type optionType, double strike, double forward, double blackPrice) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_6((int)optionType, strike, forward, blackPrice);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice, double discount, double displacement, double guess, double omega, double accuracy, uint maxIterations) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_7(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice, discount, displacement, guess, omega, accuracy, maxIterations);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice, double discount, double displacement, double guess, double omega, double accuracy) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_8(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice, discount, displacement, guess, omega, accuracy);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice, double discount, double displacement, double guess, double omega) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_9(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice, discount, displacement, guess, omega);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice, double discount, double displacement, double guess) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_10(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice, discount, displacement, guess);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice, double discount, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_11(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice, discount, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice, double discount) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_12(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaImpliedStdDevLiRS(PlainVanillaPayoff payoff, double forward, double blackPrice) {
    double ret = NQuantLibcPINVOKE.blackFormulaImpliedStdDevLiRS__SWIG_13(PlainVanillaPayoff.getCPtr(payoff), forward, blackPrice);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaCashItmProbability(Option.Type optionType, double strike, double forward, double stdDev, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaCashItmProbability__SWIG_0((int)optionType, strike, forward, stdDev, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaCashItmProbability(Option.Type optionType, double strike, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.blackFormulaCashItmProbability__SWIG_1((int)optionType, strike, forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaCashItmProbability(PlainVanillaPayoff payoff, double forward, double stdDev, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaCashItmProbability__SWIG_2(PlainVanillaPayoff.getCPtr(payoff), forward, stdDev, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaCashItmProbability(PlainVanillaPayoff payoff, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.blackFormulaCashItmProbability__SWIG_3(PlainVanillaPayoff.getCPtr(payoff), forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaAssetItmProbability(Option.Type optionType, double strike, double forward, double stdDev, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaAssetItmProbability__SWIG_0((int)optionType, strike, forward, stdDev, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaAssetItmProbability(Option.Type optionType, double strike, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.blackFormulaAssetItmProbability__SWIG_1((int)optionType, strike, forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaAssetItmProbability(PlainVanillaPayoff payoff, double forward, double stdDev, double displacement) {
    double ret = NQuantLibcPINVOKE.blackFormulaAssetItmProbability__SWIG_2(PlainVanillaPayoff.getCPtr(payoff), forward, stdDev, displacement);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double blackFormulaAssetItmProbability(PlainVanillaPayoff payoff, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.blackFormulaAssetItmProbability__SWIG_3(PlainVanillaPayoff.getCPtr(payoff), forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double bachelierBlackFormula(Option.Type optionType, double strike, double forward, double stdDev, double discount) {
    double ret = NQuantLibcPINVOKE.bachelierBlackFormula__SWIG_0((int)optionType, strike, forward, stdDev, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double bachelierBlackFormula(Option.Type optionType, double strike, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.bachelierBlackFormula__SWIG_1((int)optionType, strike, forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double bachelierBlackFormulaImpliedVol(Option.Type optionType, double strike, double forward, double tte, double bachelierPrice, double discount) {
    double ret = NQuantLibcPINVOKE.bachelierBlackFormulaImpliedVol__SWIG_0((int)optionType, strike, forward, tte, bachelierPrice, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double bachelierBlackFormulaImpliedVol(Option.Type optionType, double strike, double forward, double tte, double bachelierPrice) {
    double ret = NQuantLibcPINVOKE.bachelierBlackFormulaImpliedVol__SWIG_1((int)optionType, strike, forward, tte, bachelierPrice);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double bachelierBlackFormulaAssetItmProbability(Option.Type optionType, double strike, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.bachelierBlackFormulaAssetItmProbability__SWIG_0((int)optionType, strike, forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double bachelierBlackFormulaAssetItmProbability(PlainVanillaPayoff payoff, double forward, double stdDev) {
    double ret = NQuantLibcPINVOKE.bachelierBlackFormulaAssetItmProbability__SWIG_1(PlainVanillaPayoff.getCPtr(payoff), forward, stdDev);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static OvernightIndexedSwap as_overnight_swap_index(InterestRateIndex index) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_overnight_swap_index(InterestRateIndex.getCPtr(index));
    OvernightIndexedSwap ret = (cPtr == global::System.IntPtr.Zero) ? null : new OvernightIndexedSwap(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static InflationCoupon as_inflation_coupon(CashFlow cf) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_inflation_coupon(CashFlow.getCPtr(cf));
    InflationCoupon ret = (cPtr == global::System.IntPtr.Zero) ? null : new InflationCoupon(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static CPICoupon as_cpi_coupon(CashFlow cf) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_cpi_coupon(CashFlow.getCPtr(cf));
    CPICoupon ret = (cPtr == global::System.IntPtr.Zero) ? null : new CPICoupon(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Date inflationBaseDate(Date referenceDate, Period observationLag, Frequency frequency, bool indexIsInterpolated) {
    Date ret = new Date(NQuantLibcPINVOKE.inflationBaseDate(Date.getCPtr(referenceDate), Period.getCPtr(observationLag), (int)frequency, indexIsInterpolated), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter, BusinessDayConvention paymentAdjustment, uint fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps, DoubleVector floors) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_0(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter), (int)paymentAdjustment, fixingDays, DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps), DoubleVector.getCPtr(floors)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter, BusinessDayConvention paymentAdjustment, uint fixingDays, DoubleVector gearings, DoubleVector spreads, DoubleVector caps) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_1(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter), (int)paymentAdjustment, fixingDays, DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads), DoubleVector.getCPtr(caps)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter, BusinessDayConvention paymentAdjustment, uint fixingDays, DoubleVector gearings, DoubleVector spreads) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_2(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter), (int)paymentAdjustment, fixingDays, DoubleVector.getCPtr(gearings), DoubleVector.getCPtr(spreads)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter, BusinessDayConvention paymentAdjustment, uint fixingDays, DoubleVector gearings) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_3(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter), (int)paymentAdjustment, fixingDays, DoubleVector.getCPtr(gearings)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter, BusinessDayConvention paymentAdjustment, uint fixingDays) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_4(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter), (int)paymentAdjustment, fixingDays), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter, BusinessDayConvention paymentAdjustment) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_5(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter), (int)paymentAdjustment), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Leg yoyInflationLeg(Schedule schedule, Calendar calendar, YoYInflationIndex index, Period observationLag, DoubleVector notionals, DayCounter paymentDayCounter) {
    Leg ret = new Leg(NQuantLibcPINVOKE.yoyInflationLeg__SWIG_6(Schedule.getCPtr(schedule), Calendar.getCPtr(calendar), YoYInflationIndex.getCPtr(index), Period.getCPtr(observationLag), DoubleVector.getCPtr(notionals), DayCounter.getCPtr(paymentDayCounter)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double cleanPriceFromZSpread(Bond bond, YieldTermStructure discountCurve, double zSpread, DayCounter dc, Compounding compounding, Frequency freq, Date settlementDate) {
    double ret = NQuantLibcPINVOKE.cleanPriceFromZSpread__SWIG_0(Bond.getCPtr(bond), YieldTermStructure.getCPtr(discountCurve), zSpread, DayCounter.getCPtr(dc), (int)compounding, (int)freq, Date.getCPtr(settlementDate));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double cleanPriceFromZSpread(Bond bond, YieldTermStructure discountCurve, double zSpread, DayCounter dc, Compounding compounding, Frequency freq) {
    double ret = NQuantLibcPINVOKE.cleanPriceFromZSpread__SWIG_1(Bond.getCPtr(bond), YieldTermStructure.getCPtr(discountCurve), zSpread, DayCounter.getCPtr(dc), (int)compounding, (int)freq);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static DepositRateHelper as_depositratehelper(RateHelper helper) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_depositratehelper(RateHelper.getCPtr(helper));
    DepositRateHelper ret = (cPtr == global::System.IntPtr.Zero) ? null : new DepositRateHelper(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static FraRateHelper as_fraratehelper(RateHelper helper) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_fraratehelper(RateHelper.getCPtr(helper));
    FraRateHelper ret = (cPtr == global::System.IntPtr.Zero) ? null : new FraRateHelper(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static SwapRateHelper as_swapratehelper(RateHelper helper) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_swapratehelper(RateHelper.getCPtr(helper));
    SwapRateHelper ret = (cPtr == global::System.IntPtr.Zero) ? null : new SwapRateHelper(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static OISRateHelper as_oisratehelper(RateHelper helper) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.as_oisratehelper(RateHelper.getCPtr(helper));
    OISRateHelper ret = (cPtr == global::System.IntPtr.Zero) ? null : new OISRateHelper(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Matrix getCovariance(QlArray volatilities, Matrix correlations) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.getCovariance(QlArray.getCPtr(volatilities), Matrix.getCPtr(correlations)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void enableTracing() {
    NQuantLibcPINVOKE.enableTracing();
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void disableTracing() {
    NQuantLibcPINVOKE.disableTracing();
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
