001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (https://www.swig.org).
003 * Version 4.1.1
004 *
005 * Do not make changes to this file unless you know what you are doing - modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.quantlib;
010
011public class FdmLinearOpLayout implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  private transient boolean swigCMemOwn;
014
015  protected FdmLinearOpLayout(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(FdmLinearOpLayout obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected void swigSetCMemOwn(boolean own) {
025    swigCMemOwn = own;
026  }
027
028  @SuppressWarnings("deprecation")
029  protected void finalize() {
030    delete();
031  }
032
033  public synchronized void delete() {
034    if (swigCPtr != 0) {
035      if (swigCMemOwn) {
036        swigCMemOwn = false;
037        QuantLibJNI.delete_FdmLinearOpLayout(swigCPtr);
038      }
039      swigCPtr = 0;
040    }
041  }
042
043  public FdmLinearOpLayout(UnsignedIntVector dim) {
044    this(QuantLibJNI.new_FdmLinearOpLayout(UnsignedIntVector.getCPtr(dim), dim), true);
045  }
046
047  public UnsignedIntVector spacing() {
048    return new UnsignedIntVector(QuantLibJNI.FdmLinearOpLayout_spacing(swigCPtr, this), true);
049  }
050
051  public UnsignedIntVector dim() {
052    return new UnsignedIntVector(QuantLibJNI.FdmLinearOpLayout_dim(swigCPtr, this), true);
053  }
054
055  public long index(UnsignedIntVector coordinates) {
056    return QuantLibJNI.FdmLinearOpLayout_index(swigCPtr, this, UnsignedIntVector.getCPtr(coordinates), coordinates);
057  }
058
059  public FdmLinearOpIterator begin() {
060    return new FdmLinearOpIterator(QuantLibJNI.FdmLinearOpLayout_begin(swigCPtr, this), true);
061  }
062
063  public FdmLinearOpIterator end() {
064    return new FdmLinearOpIterator(QuantLibJNI.FdmLinearOpLayout_end(swigCPtr, this), true);
065  }
066
067  public long size() {
068    return QuantLibJNI.FdmLinearOpLayout_size(swigCPtr, this);
069  }
070
071  public long neighbourhood(FdmLinearOpIterator iterator, long i, int offset) {
072    return QuantLibJNI.FdmLinearOpLayout_neighbourhood__SWIG_0(swigCPtr, this, FdmLinearOpIterator.getCPtr(iterator), iterator, i, offset);
073  }
074
075  public long neighbourhood(FdmLinearOpIterator iterator, long i1, int offset1, long i2, int offset2) {
076    return QuantLibJNI.FdmLinearOpLayout_neighbourhood__SWIG_1(swigCPtr, this, FdmLinearOpIterator.getCPtr(iterator), iterator, i1, offset1, i2, offset2);
077  }
078
079  public FdmLinearOpIterator iter_neighbourhood(FdmLinearOpIterator iterator, long i, int offset) {
080    return new FdmLinearOpIterator(QuantLibJNI.FdmLinearOpLayout_iter_neighbourhood(swigCPtr, this, FdmLinearOpIterator.getCPtr(iterator), iterator, i, offset), true);
081  }
082
083}