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

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

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

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

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

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

}
