/* ----------------------------------------------------------------------------
 * 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.
 * ----------------------------------------------------------------------------- */

package org.quantlib;

public class AnalyticPTDHestonEngine extends PricingEngine {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected AnalyticPTDHestonEngine(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.AnalyticPTDHestonEngine_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(AnalyticPTDHestonEngine obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwnDerived = own;
    super.swigSetCMemOwn(own);
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwnDerived) {
        swigCMemOwnDerived = false;
        QuantLibJNI.delete_AnalyticPTDHestonEngine(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public AnalyticPTDHestonEngine(PiecewiseTimeDependentHestonModel model, double relTolerance, long maxEvaluations) {
    this(QuantLibJNI.new_AnalyticPTDHestonEngine__SWIG_0(PiecewiseTimeDependentHestonModel.getCPtr(model), model, relTolerance, maxEvaluations), true);
  }

  public AnalyticPTDHestonEngine(PiecewiseTimeDependentHestonModel model, long integrationOrder) {
    this(QuantLibJNI.new_AnalyticPTDHestonEngine__SWIG_1(PiecewiseTimeDependentHestonModel.getCPtr(model), model, integrationOrder), true);
  }

  public AnalyticPTDHestonEngine(PiecewiseTimeDependentHestonModel model) {
    this(QuantLibJNI.new_AnalyticPTDHestonEngine__SWIG_2(PiecewiseTimeDependentHestonModel.getCPtr(model), model), true);
  }

  public AnalyticPTDHestonEngine(PiecewiseTimeDependentHestonModel model, AnalyticPTDHestonEngine.ComplexLogFormula cpxLog, AnalyticHestonEngine_Integration itg, double andersenPiterbargEpsilon) {
    this(QuantLibJNI.new_AnalyticPTDHestonEngine__SWIG_3(PiecewiseTimeDependentHestonModel.getCPtr(model), model, cpxLog.swigValue(), AnalyticHestonEngine_Integration.getCPtr(itg), itg, andersenPiterbargEpsilon), true);
  }

  public AnalyticPTDHestonEngine(PiecewiseTimeDependentHestonModel model, AnalyticPTDHestonEngine.ComplexLogFormula cpxLog, AnalyticHestonEngine_Integration itg) {
    this(QuantLibJNI.new_AnalyticPTDHestonEngine__SWIG_4(PiecewiseTimeDependentHestonModel.getCPtr(model), model, cpxLog.swigValue(), AnalyticHestonEngine_Integration.getCPtr(itg), itg), true);
  }

  public final static class ComplexLogFormula {
    public final static AnalyticPTDHestonEngine.ComplexLogFormula Gatheral = new AnalyticPTDHestonEngine.ComplexLogFormula("Gatheral");
    public final static AnalyticPTDHestonEngine.ComplexLogFormula AndersenPiterbarg = new AnalyticPTDHestonEngine.ComplexLogFormula("AndersenPiterbarg");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static ComplexLogFormula swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + ComplexLogFormula.class + " with value " + swigValue);
    }

    private ComplexLogFormula(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private ComplexLogFormula(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private ComplexLogFormula(String swigName, ComplexLogFormula swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static ComplexLogFormula[] swigValues = { Gatheral, AndersenPiterbarg };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
