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 HestonModelHandle implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected HestonModelHandle(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(HestonModelHandle obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(HestonModelHandle obj) {
025    long ptr = 0;
026    if (obj != null) {
027      if (!obj.swigCMemOwn)
028        throw new RuntimeException("Cannot release ownership as memory is not owned");
029      ptr = obj.swigCPtr;
030      obj.swigCMemOwn = false;
031      obj.delete();
032    }
033    return ptr;
034  }
035
036  @SuppressWarnings("deprecation")
037  protected void finalize() {
038    delete();
039  }
040
041  public synchronized void delete() {
042    if (swigCPtr != 0) {
043      if (swigCMemOwn) {
044        swigCMemOwn = false;
045        QuantLibJNI.delete_HestonModelHandle(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public HestonModelHandle(HestonModel arg0) {
052    this(QuantLibJNI.new_HestonModelHandle__SWIG_0(HestonModel.getCPtr(arg0), arg0), true);
053  }
054
055  public HestonModelHandle() {
056    this(QuantLibJNI.new_HestonModelHandle__SWIG_1(), true);
057  }
058
059  public HestonModel __deref__() {
060    long cPtr = QuantLibJNI.HestonModelHandle___deref__(swigCPtr, this);
061    return (cPtr == 0) ? null : new HestonModel(cPtr, true);
062  }
063
064  public HestonModel currentLink() {
065    long cPtr = QuantLibJNI.HestonModelHandle_currentLink(swigCPtr, this);
066    return (cPtr == 0) ? null : new HestonModel(cPtr, true);
067  }
068
069  public boolean empty() {
070    return QuantLibJNI.HestonModelHandle_empty(swigCPtr, this);
071  }
072
073  public Observable asObservable() {
074    long cPtr = QuantLibJNI.HestonModelHandle_asObservable(swigCPtr, this);
075    return (cPtr == 0) ? null : new Observable(cPtr, true);
076  }
077
078  public double theta() {
079    return QuantLibJNI.HestonModelHandle_theta(swigCPtr, this);
080  }
081
082  public double kappa() {
083    return QuantLibJNI.HestonModelHandle_kappa(swigCPtr, this);
084  }
085
086  public double sigma() {
087    return QuantLibJNI.HestonModelHandle_sigma(swigCPtr, this);
088  }
089
090  public double rho() {
091    return QuantLibJNI.HestonModelHandle_rho(swigCPtr, this);
092  }
093
094  public double v0() {
095    return QuantLibJNI.HestonModelHandle_v0(swigCPtr, this);
096  }
097
098  public Array params() {
099    return new Array(QuantLibJNI.HestonModelHandle_params(swigCPtr, this), true);
100  }
101
102  public void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2, Constraint constraint, DoubleVector weights, BoolVector fixParameters) {
103    QuantLibJNI.HestonModelHandle_calibrate__SWIG_0(swigCPtr, this, CalibrationHelperVector.getCPtr(arg0), arg0, OptimizationMethod.getCPtr(arg1), arg1, EndCriteria.getCPtr(arg2), arg2, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights, BoolVector.getCPtr(fixParameters), fixParameters);
104  }
105
106  public void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2, Constraint constraint, DoubleVector weights) {
107    QuantLibJNI.HestonModelHandle_calibrate__SWIG_1(swigCPtr, this, CalibrationHelperVector.getCPtr(arg0), arg0, OptimizationMethod.getCPtr(arg1), arg1, EndCriteria.getCPtr(arg2), arg2, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights);
108  }
109
110  public void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2, Constraint constraint) {
111    QuantLibJNI.HestonModelHandle_calibrate__SWIG_2(swigCPtr, this, CalibrationHelperVector.getCPtr(arg0), arg0, OptimizationMethod.getCPtr(arg1), arg1, EndCriteria.getCPtr(arg2), arg2, Constraint.getCPtr(constraint), constraint);
112  }
113
114  public void calibrate(CalibrationHelperVector arg0, OptimizationMethod arg1, EndCriteria arg2) {
115    QuantLibJNI.HestonModelHandle_calibrate__SWIG_3(swigCPtr, this, CalibrationHelperVector.getCPtr(arg0), arg0, OptimizationMethod.getCPtr(arg1), arg1, EndCriteria.getCPtr(arg2), arg2);
116  }
117
118  public void setParams(Array params) {
119    QuantLibJNI.HestonModelHandle_setParams(swigCPtr, this, Array.getCPtr(params), params);
120  }
121
122  public double value(Array params, CalibrationHelperVector arg1) {
123    return QuantLibJNI.HestonModelHandle_value(swigCPtr, this, Array.getCPtr(params), params, CalibrationHelperVector.getCPtr(arg1), arg1);
124  }
125
126  public Constraint constraint() {
127    long cPtr = QuantLibJNI.HestonModelHandle_constraint(swigCPtr, this);
128    return (cPtr == 0) ? null : new Constraint(cPtr, true);
129  }
130
131  public EndCriteria.Type endCriteria() {
132    return EndCriteria.Type.swigToEnum(QuantLibJNI.HestonModelHandle_endCriteria(swigCPtr, this));
133  }
134
135  public Array problemValues() {
136    return new Array(QuantLibJNI.HestonModelHandle_problemValues(swigCPtr, this), false);
137  }
138
139  public int functionEvaluation() {
140    return QuantLibJNI.HestonModelHandle_functionEvaluation(swigCPtr, this);
141  }
142
143}