//------------------------------------------------------------------------------
// <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 SmileSection : Observable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

  internal SmileSection(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NQuantLibcPINVOKE.SmileSection_SWIGSmartPtrUpcast(cPtr), true) {
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SmileSection obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwnDerived) {
          swigCMemOwnDerived = false;
          NQuantLibcPINVOKE.delete_SmileSection(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public double minStrike() {
    double ret = NQuantLibcPINVOKE.SmileSection_minStrike(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double maxStrike() {
    double ret = NQuantLibcPINVOKE.SmileSection_maxStrike(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double atmLevel() {
    double ret = NQuantLibcPINVOKE.SmileSection_atmLevel(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double variance(double strike) {
    double ret = NQuantLibcPINVOKE.SmileSection_variance(swigCPtr, strike);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double volatility(double strike) {
    double ret = NQuantLibcPINVOKE.SmileSection_volatility__SWIG_0(swigCPtr, strike);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual Date exerciseDate() {
    Date ret = new Date(NQuantLibcPINVOKE.SmileSection_exerciseDate(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual VolatilityType volatilityType() {
    VolatilityType ret = (VolatilityType)NQuantLibcPINVOKE.SmileSection_volatilityType(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double shift() {
    double ret = NQuantLibcPINVOKE.SmileSection_shift(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual Date referenceDate() {
    Date ret = new Date(NQuantLibcPINVOKE.SmileSection_referenceDate(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double exerciseTime() {
    double ret = NQuantLibcPINVOKE.SmileSection_exerciseTime(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual DayCounter dayCounter() {
    DayCounter ret = new DayCounter(NQuantLibcPINVOKE.SmileSection_dayCounter(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double optionPrice(double strike, Option.Type type, double discount) {
    double ret = NQuantLibcPINVOKE.SmileSection_optionPrice__SWIG_0(swigCPtr, strike, (int)type, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double optionPrice(double strike, Option.Type type) {
    double ret = NQuantLibcPINVOKE.SmileSection_optionPrice__SWIG_1(swigCPtr, strike, (int)type);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double optionPrice(double strike) {
    double ret = NQuantLibcPINVOKE.SmileSection_optionPrice__SWIG_2(swigCPtr, strike);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double digitalOptionPrice(double strike, Option.Type type, double discount, double gap) {
    double ret = NQuantLibcPINVOKE.SmileSection_digitalOptionPrice__SWIG_0(swigCPtr, strike, (int)type, discount, gap);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double digitalOptionPrice(double strike, Option.Type type, double discount) {
    double ret = NQuantLibcPINVOKE.SmileSection_digitalOptionPrice__SWIG_1(swigCPtr, strike, (int)type, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double digitalOptionPrice(double strike, Option.Type type) {
    double ret = NQuantLibcPINVOKE.SmileSection_digitalOptionPrice__SWIG_2(swigCPtr, strike, (int)type);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double digitalOptionPrice(double strike) {
    double ret = NQuantLibcPINVOKE.SmileSection_digitalOptionPrice__SWIG_3(swigCPtr, strike);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double vega(double strike, double discount) {
    double ret = NQuantLibcPINVOKE.SmileSection_vega__SWIG_0(swigCPtr, strike, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double vega(double strike) {
    double ret = NQuantLibcPINVOKE.SmileSection_vega__SWIG_1(swigCPtr, strike);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double density(double strike, double discount, double gap) {
    double ret = NQuantLibcPINVOKE.SmileSection_density__SWIG_0(swigCPtr, strike, discount, gap);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double density(double strike, double discount) {
    double ret = NQuantLibcPINVOKE.SmileSection_density__SWIG_1(swigCPtr, strike, discount);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double density(double strike) {
    double ret = NQuantLibcPINVOKE.SmileSection_density__SWIG_2(swigCPtr, strike);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double volatility(double strike, VolatilityType type, double shift) {
    double ret = NQuantLibcPINVOKE.SmileSection_volatility__SWIG_1(swigCPtr, strike, (int)type, shift);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double volatility(double strike, VolatilityType type) {
    double ret = NQuantLibcPINVOKE.SmileSection_volatility__SWIG_2(swigCPtr, strike, (int)type);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
