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

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

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

  public ExplicitEulerScheme(FdmLinearOpComposite map, FdmBoundaryConditionSet bcSet) {
    this(QuantLibJNI.new_ExplicitEulerScheme__SWIG_0(FdmLinearOpComposite.getCPtr(map), map, FdmBoundaryConditionSet.getCPtr(bcSet), bcSet), true);
  }

  public ExplicitEulerScheme(FdmLinearOpComposite map) {
    this(QuantLibJNI.new_ExplicitEulerScheme__SWIG_1(FdmLinearOpComposite.getCPtr(map), map), true);
  }

  public void step(Array a, double t) {
    QuantLibJNI.ExplicitEulerScheme_step(swigCPtr, this, Array.getCPtr(a), a, t);
  }

  public void setStep(double dt) {
    QuantLibJNI.ExplicitEulerScheme_setStep(swigCPtr, this, dt);
  }

}
