/* ----------------------------------------------------------------------------
 * 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 TripleBandLinearOp extends FdmLinearOp {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected TripleBandLinearOp(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.TripleBandLinearOp_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwnDerived = own;
    super.swigSetCMemOwn(own);
  }

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwnDerived) {
        swigCMemOwnDerived = false;
        QuantLibJNI.delete_TripleBandLinearOp(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public TripleBandLinearOp(long direction, FdmMesher mesher) {
    this(QuantLibJNI.new_TripleBandLinearOp(direction, FdmMesher.getCPtr(mesher), mesher), true);
  }

  public Array apply(Array r) {
    return new Array(QuantLibJNI.TripleBandLinearOp_apply(swigCPtr, this, Array.getCPtr(r), r), true);
  }

  public Array solve_splitting(Array r, double a, double b) {
    return new Array(QuantLibJNI.TripleBandLinearOp_solve_splitting__SWIG_0(swigCPtr, this, Array.getCPtr(r), r, a, b), true);
  }

  public Array solve_splitting(Array r, double a) {
    return new Array(QuantLibJNI.TripleBandLinearOp_solve_splitting__SWIG_1(swigCPtr, this, Array.getCPtr(r), r, a), true);
  }

  public TripleBandLinearOp mult(Array u) {
    return new TripleBandLinearOp(QuantLibJNI.TripleBandLinearOp_mult(swigCPtr, this, Array.getCPtr(u), u), true);
  }

  public TripleBandLinearOp multR(Array u) {
    return new TripleBandLinearOp(QuantLibJNI.TripleBandLinearOp_multR(swigCPtr, this, Array.getCPtr(u), u), true);
  }

  public TripleBandLinearOp add(TripleBandLinearOp m) {
    return new TripleBandLinearOp(QuantLibJNI.TripleBandLinearOp_add__SWIG_0(swigCPtr, this, TripleBandLinearOp.getCPtr(m), m), true);
  }

  public TripleBandLinearOp add(Array u) {
    return new TripleBandLinearOp(QuantLibJNI.TripleBandLinearOp_add__SWIG_1(swigCPtr, this, Array.getCPtr(u), u), true);
  }

  public void axpyb(Array a, TripleBandLinearOp x, TripleBandLinearOp y, Array b) {
    QuantLibJNI.TripleBandLinearOp_axpyb(swigCPtr, this, Array.getCPtr(a), a, TripleBandLinearOp.getCPtr(x), x, TripleBandLinearOp.getCPtr(y), y, Array.getCPtr(b), b);
  }

  public void swap(TripleBandLinearOp m) {
    QuantLibJNI.TripleBandLinearOp_swap(swigCPtr, this, TripleBandLinearOp.getCPtr(m), m);
  }

}
