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

package org.quantlib;

public class Fdm4dimSolver {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

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

  protected static long getCPtr(Fdm4dimSolver 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_Fdm4dimSolver(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

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

  public double interpolateAt(DoubleVector x) {
    return QuantLibJNI.Fdm4dimSolver_interpolateAt(swigCPtr, this, DoubleVector.getCPtr(x), x);
  }

  public double thetaAt(DoubleVector x) {
    return QuantLibJNI.Fdm4dimSolver_thetaAt(swigCPtr, this, DoubleVector.getCPtr(x), x);
  }

}
