//------------------------------------------------------------------------------
// <auto-generated />
//
// 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.
//------------------------------------------------------------------------------

namespace QuantLib {

public class FdmLinearOpComposite : FdmLinearOp {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

  internal FdmLinearOpComposite(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NQuantLibcPINVOKE.FdmLinearOpComposite_SWIGSmartPtrUpcast(cPtr), true) {
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FdmLinearOpComposite obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwnDerived) {
          swigCMemOwnDerived = false;
          NQuantLibcPINVOKE.delete_FdmLinearOpComposite(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public virtual uint size() {
    uint ret = NQuantLibcPINVOKE.FdmLinearOpComposite_size(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual void setTime(double t1, double t2) {
    NQuantLibcPINVOKE.FdmLinearOpComposite_setTime(swigCPtr, t1, t2);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual QlArray apply_mixed(QlArray r) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.FdmLinearOpComposite_apply_mixed(swigCPtr, QlArray.getCPtr(r)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual QlArray apply_direction(uint direction, QlArray r) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.FdmLinearOpComposite_apply_direction(swigCPtr, direction, QlArray.getCPtr(r)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual QlArray solve_splitting(uint direction, QlArray r, double s) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.FdmLinearOpComposite_solve_splitting(swigCPtr, direction, QlArray.getCPtr(r), s), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual QlArray preconditioner(QlArray r, double s) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.FdmLinearOpComposite_preconditioner(swigCPtr, QlArray.getCPtr(r), s), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public SparseMatrix to_sparse_matrix() {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.FdmLinearOpComposite_to_sparse_matrix(swigCPtr);
    SparseMatrix ret = (cPtr == global::System.IntPtr.Zero) ? null : new SparseMatrix(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
