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 AndreasenHugeVolatilityInterpl extends Observable implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  private transient boolean swigCMemOwnDerived;
014
015  protected AndreasenHugeVolatilityInterpl(long cPtr, boolean cMemoryOwn) {
016    super(QuantLibJNI.AndreasenHugeVolatilityInterpl_SWIGSmartPtrUpcast(cPtr), true);
017    swigCMemOwnDerived = cMemoryOwn;
018    swigCPtr = cPtr;
019  }
020
021  protected static long getCPtr(AndreasenHugeVolatilityInterpl 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_AndreasenHugeVolatilityInterpl(swigCPtr);
040      }
041      swigCPtr = 0;
042    }
043    super.delete();
044  }
045
046  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType, AndreasenHugeVolatilityInterpl.CalibrationType calibrationType, long nGridPoints, double minStrike, double maxStrike, OptimizationMethod optimizationMethod, EndCriteria endCriteria) {
047    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_0(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue(), calibrationType.swigValue(), nGridPoints, minStrike, maxStrike, OptimizationMethod.getCPtr(optimizationMethod), optimizationMethod, EndCriteria.getCPtr(endCriteria), endCriteria), true);
048  }
049
050  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType, AndreasenHugeVolatilityInterpl.CalibrationType calibrationType, long nGridPoints, double minStrike, double maxStrike, OptimizationMethod optimizationMethod) {
051    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_1(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue(), calibrationType.swigValue(), nGridPoints, minStrike, maxStrike, OptimizationMethod.getCPtr(optimizationMethod), optimizationMethod), true);
052  }
053
054  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType, AndreasenHugeVolatilityInterpl.CalibrationType calibrationType, long nGridPoints, double minStrike, double maxStrike) {
055    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_2(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue(), calibrationType.swigValue(), nGridPoints, minStrike, maxStrike), true);
056  }
057
058  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType, AndreasenHugeVolatilityInterpl.CalibrationType calibrationType, long nGridPoints, double minStrike) {
059    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_3(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue(), calibrationType.swigValue(), nGridPoints, minStrike), true);
060  }
061
062  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType, AndreasenHugeVolatilityInterpl.CalibrationType calibrationType, long nGridPoints) {
063    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_4(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue(), calibrationType.swigValue(), nGridPoints), true);
064  }
065
066  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType, AndreasenHugeVolatilityInterpl.CalibrationType calibrationType) {
067    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_5(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue(), calibrationType.swigValue()), true);
068  }
069
070  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS, AndreasenHugeVolatilityInterpl.InterpolationType interpolationType) {
071    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_6(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS, interpolationType.swigValue()), true);
072  }
073
074  public AndreasenHugeVolatilityInterpl(CalibrationSet calibrationSet, QuoteHandle spot, YieldTermStructureHandle rTS, YieldTermStructureHandle qTS) {
075    this(QuantLibJNI.new_AndreasenHugeVolatilityInterpl__SWIG_7(CalibrationSet.getCPtr(calibrationSet), calibrationSet, QuoteHandle.getCPtr(spot), spot, YieldTermStructureHandle.getCPtr(rTS), rTS, YieldTermStructureHandle.getCPtr(qTS), qTS), true);
076  }
077
078  public Date maxDate() {
079    return new Date(QuantLibJNI.AndreasenHugeVolatilityInterpl_maxDate(swigCPtr, this), true);
080  }
081
082  public double minStrike() {
083    return QuantLibJNI.AndreasenHugeVolatilityInterpl_minStrike(swigCPtr, this);
084  }
085
086  public double maxStrike() {
087    return QuantLibJNI.AndreasenHugeVolatilityInterpl_maxStrike(swigCPtr, this);
088  }
089
090  public double fwd(double t) {
091    return QuantLibJNI.AndreasenHugeVolatilityInterpl_fwd(swigCPtr, this, t);
092  }
093
094  public YieldTermStructureHandle riskFreeRate() {
095    return new YieldTermStructureHandle(QuantLibJNI.AndreasenHugeVolatilityInterpl_riskFreeRate(swigCPtr, this), false);
096  }
097
098  public CalibrationErrorTuple calibrationError() {
099    return new CalibrationErrorTuple(QuantLibJNI.AndreasenHugeVolatilityInterpl_calibrationError(swigCPtr, this), true);
100  }
101
102  public double optionPrice(double t, double strike, Option.Type optionType) {
103    return QuantLibJNI.AndreasenHugeVolatilityInterpl_optionPrice(swigCPtr, this, t, strike, optionType.swigValue());
104  }
105
106  public double localVol(double t, double strike) {
107    return QuantLibJNI.AndreasenHugeVolatilityInterpl_localVol(swigCPtr, this, t, strike);
108  }
109
110  public final static class InterpolationType {
111    public final static AndreasenHugeVolatilityInterpl.InterpolationType PiecewiseConstant = new AndreasenHugeVolatilityInterpl.InterpolationType("PiecewiseConstant");
112    public final static AndreasenHugeVolatilityInterpl.InterpolationType Linear = new AndreasenHugeVolatilityInterpl.InterpolationType("Linear");
113    public final static AndreasenHugeVolatilityInterpl.InterpolationType CubicSpline = new AndreasenHugeVolatilityInterpl.InterpolationType("CubicSpline");
114
115    public final int swigValue() {
116      return swigValue;
117    }
118
119    public String toString() {
120      return swigName;
121    }
122
123    public static InterpolationType swigToEnum(int swigValue) {
124      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
125        return swigValues[swigValue];
126      for (int i = 0; i < swigValues.length; i++)
127        if (swigValues[i].swigValue == swigValue)
128          return swigValues[i];
129      throw new IllegalArgumentException("No enum " + InterpolationType.class + " with value " + swigValue);
130    }
131
132    private InterpolationType(String swigName) {
133      this.swigName = swigName;
134      this.swigValue = swigNext++;
135    }
136
137    private InterpolationType(String swigName, int swigValue) {
138      this.swigName = swigName;
139      this.swigValue = swigValue;
140      swigNext = swigValue+1;
141    }
142
143    private InterpolationType(String swigName, InterpolationType swigEnum) {
144      this.swigName = swigName;
145      this.swigValue = swigEnum.swigValue;
146      swigNext = this.swigValue+1;
147    }
148
149    private static InterpolationType[] swigValues = { PiecewiseConstant, Linear, CubicSpline };
150    private static int swigNext = 0;
151    private final int swigValue;
152    private final String swigName;
153  }
154
155  public final static class CalibrationType {
156    public final static AndreasenHugeVolatilityInterpl.CalibrationType Call = new AndreasenHugeVolatilityInterpl.CalibrationType("Call", QuantLibJNI.AndreasenHugeVolatilityInterpl_Call_get());
157    public final static AndreasenHugeVolatilityInterpl.CalibrationType Put = new AndreasenHugeVolatilityInterpl.CalibrationType("Put", QuantLibJNI.AndreasenHugeVolatilityInterpl_Put_get());
158    public final static AndreasenHugeVolatilityInterpl.CalibrationType CallPut = new AndreasenHugeVolatilityInterpl.CalibrationType("CallPut");
159
160    public final int swigValue() {
161      return swigValue;
162    }
163
164    public String toString() {
165      return swigName;
166    }
167
168    public static CalibrationType swigToEnum(int swigValue) {
169      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
170        return swigValues[swigValue];
171      for (int i = 0; i < swigValues.length; i++)
172        if (swigValues[i].swigValue == swigValue)
173          return swigValues[i];
174      throw new IllegalArgumentException("No enum " + CalibrationType.class + " with value " + swigValue);
175    }
176
177    private CalibrationType(String swigName) {
178      this.swigName = swigName;
179      this.swigValue = swigNext++;
180    }
181
182    private CalibrationType(String swigName, int swigValue) {
183      this.swigName = swigName;
184      this.swigValue = swigValue;
185      swigNext = swigValue+1;
186    }
187
188    private CalibrationType(String swigName, CalibrationType swigEnum) {
189      this.swigName = swigName;
190      this.swigValue = swigEnum.swigValue;
191      swigNext = this.swigValue+1;
192    }
193
194    private static CalibrationType[] swigValues = { Call, Put, CallPut };
195    private static int swigNext = 0;
196    private final int swigValue;
197    private final String swigName;
198  }
199
200}