/* ----------------------------------------------------------------------------
 * 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 Fdm2DimSolver {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

  protected Fdm2DimSolver(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwn = own;
  }

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_Fdm2DimSolver(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public Fdm2DimSolver(FdmSolverDesc solverDesc, FdmSchemeDesc schemeDesc, FdmLinearOpComposite op) {
    this(QuantLibJNI.new_Fdm2DimSolver(FdmSolverDesc.getCPtr(solverDesc), solverDesc, FdmSchemeDesc.getCPtr(schemeDesc), schemeDesc, FdmLinearOpComposite.getCPtr(op), op), true);
  }

  public double interpolateAt(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_interpolateAt(swigCPtr, this, x, y);
  }

  public double thetaAt(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_thetaAt(swigCPtr, this, x, y);
  }

  public double derivativeX(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_derivativeX(swigCPtr, this, x, y);
  }

  public double derivativeY(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_derivativeY(swigCPtr, this, x, y);
  }

  public double derivativeXX(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_derivativeXX(swigCPtr, this, x, y);
  }

  public double derivativeYY(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_derivativeYY(swigCPtr, this, x, y);
  }

  public double derivativeXY(double x, double y) {
    return QuantLibJNI.Fdm2DimSolver_derivativeXY(swigCPtr, this, x, y);
  }

}
