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

namespace QuantLib {

public class GridModelLocalVolSurface : LocalVolTermStructure {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

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

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GridModelLocalVolSurface 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_GridModelLocalVolSurface(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public GridModelLocalVolSurface(Date referenceDate, DateVector dates, DoubleVectorVector strikes, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation, FixedLocalVolSurface.Extrapolation upperExtrapolation) : this(NQuantLibcPINVOKE.new_GridModelLocalVolSurface__SWIG_0(Date.getCPtr(referenceDate), DateVector.getCPtr(dates), DoubleVectorVector.getCPtr(strikes), DayCounter.getCPtr(dayCounter), (int)lowerExtrapolation, (int)upperExtrapolation), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public GridModelLocalVolSurface(Date referenceDate, DateVector dates, DoubleVectorVector strikes, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation) : this(NQuantLibcPINVOKE.new_GridModelLocalVolSurface__SWIG_1(Date.getCPtr(referenceDate), DateVector.getCPtr(dates), DoubleVectorVector.getCPtr(strikes), DayCounter.getCPtr(dayCounter), (int)lowerExtrapolation), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public GridModelLocalVolSurface(Date referenceDate, DateVector dates, DoubleVectorVector strikes, DayCounter dayCounter) : this(NQuantLibcPINVOKE.new_GridModelLocalVolSurface__SWIG_2(Date.getCPtr(referenceDate), DateVector.getCPtr(dates), DoubleVectorVector.getCPtr(strikes), DayCounter.getCPtr(dayCounter)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public QlArray parameters() {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.GridModelLocalVolSurface_parameters(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2, Constraint constraint, DoubleVector weights, BoolVector fixParameters) {
    NQuantLibcPINVOKE.GridModelLocalVolSurface_calibrate__SWIG_0(swigCPtr, CalibrationHelperVector.getCPtr(arg0), OptimizationMethod.getCPtr(arg1), EndCriteria.getCPtr(arg2), Constraint.getCPtr(constraint), DoubleVector.getCPtr(weights), BoolVector.getCPtr(fixParameters));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2, Constraint constraint, DoubleVector weights) {
    NQuantLibcPINVOKE.GridModelLocalVolSurface_calibrate__SWIG_1(swigCPtr, CalibrationHelperVector.getCPtr(arg0), OptimizationMethod.getCPtr(arg1), EndCriteria.getCPtr(arg2), Constraint.getCPtr(constraint), DoubleVector.getCPtr(weights));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2, Constraint constraint) {
    NQuantLibcPINVOKE.GridModelLocalVolSurface_calibrate__SWIG_2(swigCPtr, CalibrationHelperVector.getCPtr(arg0), OptimizationMethod.getCPtr(arg1), EndCriteria.getCPtr(arg2), Constraint.getCPtr(constraint));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2) {
    NQuantLibcPINVOKE.GridModelLocalVolSurface_calibrate__SWIG_3(swigCPtr, CalibrationHelperVector.getCPtr(arg0), OptimizationMethod.getCPtr(arg1), EndCriteria.getCPtr(arg2));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public EndCriteria.Type endCriteria() {
    EndCriteria.Type ret = (EndCriteria.Type)NQuantLibcPINVOKE.GridModelLocalVolSurface_endCriteria(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
