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

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

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

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

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

  protected void swigDirectorDisconnect() {
    swigCMemOwn = false;
    delete();
  }

  public void swigReleaseOwnership() {
    swigCMemOwn = false;
    QuantLibJNI.FdmLinearOpCompositeDelegate_change_ownership(this, swigCPtr, false);
  }

  public void swigTakeOwnership() {
    swigCMemOwn = true;
    QuantLibJNI.FdmLinearOpCompositeDelegate_change_ownership(this, swigCPtr, true);
  }

  public long size() {
    return (getClass() == FdmLinearOpCompositeDelegate.class) ? QuantLibJNI.FdmLinearOpCompositeDelegate_size(swigCPtr, this) : QuantLibJNI.FdmLinearOpCompositeDelegate_sizeSwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this);
  }

  public void setTime(double t1, double t2) {
    if (getClass() == FdmLinearOpCompositeDelegate.class) QuantLibJNI.FdmLinearOpCompositeDelegate_setTime(swigCPtr, this, t1, t2); else QuantLibJNI.FdmLinearOpCompositeDelegate_setTimeSwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this, t1, t2);
  }

  public Array apply(Array r) {
    return new Array((getClass() == FdmLinearOpCompositeDelegate.class) ? QuantLibJNI.FdmLinearOpCompositeDelegate_apply(swigCPtr, this, Array.getCPtr(r), r) : QuantLibJNI.FdmLinearOpCompositeDelegate_applySwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this, Array.getCPtr(r), r), true);
  }

  public Array apply_mixed(Array r) {
    return new Array((getClass() == FdmLinearOpCompositeDelegate.class) ? QuantLibJNI.FdmLinearOpCompositeDelegate_apply_mixed(swigCPtr, this, Array.getCPtr(r), r) : QuantLibJNI.FdmLinearOpCompositeDelegate_apply_mixedSwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this, Array.getCPtr(r), r), true);
  }

  public Array apply_direction(long direction, Array r) {
    return new Array((getClass() == FdmLinearOpCompositeDelegate.class) ? QuantLibJNI.FdmLinearOpCompositeDelegate_apply_direction(swigCPtr, this, direction, Array.getCPtr(r), r) : QuantLibJNI.FdmLinearOpCompositeDelegate_apply_directionSwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this, direction, Array.getCPtr(r), r), true);
  }

  public Array solve_splitting(long direction, Array r, double s) {
    return new Array((getClass() == FdmLinearOpCompositeDelegate.class) ? QuantLibJNI.FdmLinearOpCompositeDelegate_solve_splitting(swigCPtr, this, direction, Array.getCPtr(r), r, s) : QuantLibJNI.FdmLinearOpCompositeDelegate_solve_splittingSwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this, direction, Array.getCPtr(r), r, s), true);
  }

  public Array preconditioner(Array r, double dt) {
    return new Array((getClass() == FdmLinearOpCompositeDelegate.class) ? QuantLibJNI.FdmLinearOpCompositeDelegate_preconditioner(swigCPtr, this, Array.getCPtr(r), r, dt) : QuantLibJNI.FdmLinearOpCompositeDelegate_preconditionerSwigExplicitFdmLinearOpCompositeDelegate(swigCPtr, this, Array.getCPtr(r), r, dt), true);
  }

  public FdmLinearOpCompositeDelegate() {
    this(QuantLibJNI.new_FdmLinearOpCompositeDelegate(), true);
    QuantLibJNI.FdmLinearOpCompositeDelegate_director_connect(this, swigCPtr, true, true);
  }

}
