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 FixedLocalVolSurface extends LocalVolTermStructure implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  private transient boolean swigCMemOwnDerived;
014
015  protected FixedLocalVolSurface(long cPtr, boolean cMemoryOwn) {
016    super(QuantLibJNI.FixedLocalVolSurface_SWIGSmartPtrUpcast(cPtr), true);
017    swigCMemOwnDerived = cMemoryOwn;
018    swigCPtr = cPtr;
019  }
020
021  protected static long getCPtr(FixedLocalVolSurface obj) {
022    return (obj == null) ? 0 : obj.swigCPtr;
023  }
024
025  protected void swigSetCMemOwn(boolean own) {
026    swigCMemOwnDerived = own;
027    super.swigSetCMemOwn(own);
028  }
029
030  @SuppressWarnings("deprecation")
031  protected void finalize() {
032    delete();
033  }
034
035  public synchronized void delete() {
036    if (swigCPtr != 0) {
037      if (swigCMemOwnDerived) {
038        swigCMemOwnDerived = false;
039        QuantLibJNI.delete_FixedLocalVolSurface(swigCPtr);
040      }
041      swigCPtr = 0;
042    }
043    super.delete();
044  }
045
046  public FixedLocalVolSurface(Date referenceDate, DateVector dates, DoubleVector strikes, Matrix localVolMatrix, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation, FixedLocalVolSurface.Extrapolation upperExtrapolation) {
047    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_0(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, DoubleVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter, lowerExtrapolation.swigValue(), upperExtrapolation.swigValue()), true);
048  }
049
050  public FixedLocalVolSurface(Date referenceDate, DateVector dates, DoubleVector strikes, Matrix localVolMatrix, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation) {
051    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_1(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, DoubleVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter, lowerExtrapolation.swigValue()), true);
052  }
053
054  public FixedLocalVolSurface(Date referenceDate, DateVector dates, DoubleVector strikes, Matrix localVolMatrix, DayCounter dayCounter) {
055    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_2(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, DoubleVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter), true);
056  }
057
058  public FixedLocalVolSurface(Date referenceDate, DoubleVector times, DoubleVector strikes, Matrix localVolMatrix, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation, FixedLocalVolSurface.Extrapolation upperExtrapolation) {
059    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_3(Date.getCPtr(referenceDate), referenceDate, DoubleVector.getCPtr(times), times, DoubleVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter, lowerExtrapolation.swigValue(), upperExtrapolation.swigValue()), true);
060  }
061
062  public FixedLocalVolSurface(Date referenceDate, DoubleVector times, DoubleVector strikes, Matrix localVolMatrix, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation) {
063    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_4(Date.getCPtr(referenceDate), referenceDate, DoubleVector.getCPtr(times), times, DoubleVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter, lowerExtrapolation.swigValue()), true);
064  }
065
066  public FixedLocalVolSurface(Date referenceDate, DoubleVector times, DoubleVector strikes, Matrix localVolMatrix, DayCounter dayCounter) {
067    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_5(Date.getCPtr(referenceDate), referenceDate, DoubleVector.getCPtr(times), times, DoubleVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter), true);
068  }
069
070  public FixedLocalVolSurface(Date referenceDate, DoubleVector times, DoubleVectorVector strikes, Matrix localVolMatrix, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation, FixedLocalVolSurface.Extrapolation upperExtrapolation) {
071    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_6(Date.getCPtr(referenceDate), referenceDate, DoubleVector.getCPtr(times), times, DoubleVectorVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter, lowerExtrapolation.swigValue(), upperExtrapolation.swigValue()), true);
072  }
073
074  public FixedLocalVolSurface(Date referenceDate, DoubleVector times, DoubleVectorVector strikes, Matrix localVolMatrix, DayCounter dayCounter, FixedLocalVolSurface.Extrapolation lowerExtrapolation) {
075    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_7(Date.getCPtr(referenceDate), referenceDate, DoubleVector.getCPtr(times), times, DoubleVectorVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter, lowerExtrapolation.swigValue()), true);
076  }
077
078  public FixedLocalVolSurface(Date referenceDate, DoubleVector times, DoubleVectorVector strikes, Matrix localVolMatrix, DayCounter dayCounter) {
079    this(QuantLibJNI.new_FixedLocalVolSurface__SWIG_8(Date.getCPtr(referenceDate), referenceDate, DoubleVector.getCPtr(times), times, DoubleVectorVector.getCPtr(strikes), strikes, Matrix.getCPtr(localVolMatrix), localVolMatrix, DayCounter.getCPtr(dayCounter), dayCounter), true);
080  }
081
082  public void setInterpolation(String interpolator) {
083    QuantLibJNI.FixedLocalVolSurface_setInterpolation__SWIG_0(swigCPtr, this, interpolator);
084  }
085
086  public void setInterpolation() {
087    QuantLibJNI.FixedLocalVolSurface_setInterpolation__SWIG_1(swigCPtr, this);
088  }
089
090  public final static class Extrapolation {
091    public final static FixedLocalVolSurface.Extrapolation ConstantExtrapolation = new FixedLocalVolSurface.Extrapolation("ConstantExtrapolation");
092    public final static FixedLocalVolSurface.Extrapolation InterpolatorDefaultExtrapolation = new FixedLocalVolSurface.Extrapolation("InterpolatorDefaultExtrapolation");
093
094    public final int swigValue() {
095      return swigValue;
096    }
097
098    public String toString() {
099      return swigName;
100    }
101
102    public static Extrapolation swigToEnum(int swigValue) {
103      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
104        return swigValues[swigValue];
105      for (int i = 0; i < swigValues.length; i++)
106        if (swigValues[i].swigValue == swigValue)
107          return swigValues[i];
108      throw new IllegalArgumentException("No enum " + Extrapolation.class + " with value " + swigValue);
109    }
110
111    private Extrapolation(String swigName) {
112      this.swigName = swigName;
113      this.swigValue = swigNext++;
114    }
115
116    private Extrapolation(String swigName, int swigValue) {
117      this.swigName = swigName;
118      this.swigValue = swigValue;
119      swigNext = swigValue+1;
120    }
121
122    private Extrapolation(String swigName, Extrapolation swigEnum) {
123      this.swigName = swigName;
124      this.swigValue = swigEnum.swigValue;
125      swigNext = this.swigValue+1;
126    }
127
128    private static Extrapolation[] swigValues = { ConstantExtrapolation, InterpolatorDefaultExtrapolation };
129    private static int swigNext = 0;
130    private final int swigValue;
131    private final String swigName;
132  }
133
134}