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

namespace QuantLib {

public class FdmLinearOpLayout : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnBase;

  internal FdmLinearOpLayout(global::System.IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwnBase = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

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

  ~FdmLinearOpLayout() {
    Dispose(false);
  }

  public void Dispose() {
    Dispose(true);
    global::System.GC.SuppressFinalize(this);
  }

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

  public FdmLinearOpLayout(UnsignedIntVector dim) : this(NQuantLibcPINVOKE.new_FdmLinearOpLayout(UnsignedIntVector.getCPtr(dim)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public UnsignedIntVector spacing() {
    UnsignedIntVector ret = new UnsignedIntVector(NQuantLibcPINVOKE.FdmLinearOpLayout_spacing(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public UnsignedIntVector dim() {
    UnsignedIntVector ret = new UnsignedIntVector(NQuantLibcPINVOKE.FdmLinearOpLayout_dim(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint index(UnsignedIntVector coordinates) {
    uint ret = NQuantLibcPINVOKE.FdmLinearOpLayout_index(swigCPtr, UnsignedIntVector.getCPtr(coordinates));
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public FdmLinearOpIterator begin() {
    FdmLinearOpIterator ret = new FdmLinearOpIterator(NQuantLibcPINVOKE.FdmLinearOpLayout_begin(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public FdmLinearOpIterator end() {
    FdmLinearOpIterator ret = new FdmLinearOpIterator(NQuantLibcPINVOKE.FdmLinearOpLayout_end(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public uint neighbourhood(FdmLinearOpIterator iterator, uint i, int offset) {
    uint ret = NQuantLibcPINVOKE.FdmLinearOpLayout_neighbourhood__SWIG_0(swigCPtr, FdmLinearOpIterator.getCPtr(iterator), i, offset);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint neighbourhood(FdmLinearOpIterator iterator, uint i1, int offset1, uint i2, int offset2) {
    uint ret = NQuantLibcPINVOKE.FdmLinearOpLayout_neighbourhood__SWIG_1(swigCPtr, FdmLinearOpIterator.getCPtr(iterator), i1, offset1, i2, offset2);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public FdmLinearOpIterator iter_neighbourhood(FdmLinearOpIterator iterator, uint i, int offset) {
    FdmLinearOpIterator ret = new FdmLinearOpIterator(NQuantLibcPINVOKE.FdmLinearOpLayout_iter_neighbourhood(swigCPtr, FdmLinearOpIterator.getCPtr(iterator), i, offset), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
