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 MarkovFunctional extends Gaussian1dModel implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwnDerived; 014 015 protected MarkovFunctional(long cPtr, boolean cMemoryOwn) { 016 super(QuantLibJNI.MarkovFunctional_SWIGSmartPtrUpcast(cPtr), true); 017 swigCMemOwnDerived = cMemoryOwn; 018 swigCPtr = cPtr; 019 } 020 021 protected static long getCPtr(MarkovFunctional 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_MarkovFunctional(swigCPtr); 040 } 041 swigCPtr = 0; 042 } 043 super.delete(); 044 } 045 046 public MarkovFunctional(YieldTermStructureHandle termStructure, double reversion, DateVector volstepdates, DoubleVector volatilities, SwaptionVolatilityStructureHandle swaptionVol, DateVector swaptionExpiries, PeriodVector swaptionTenors, SwapIndex swapIndexBase, MarkovFunctionalSettings modelSettings) { 047 this(QuantLibJNI.new_MarkovFunctional__SWIG_0(YieldTermStructureHandle.getCPtr(termStructure), termStructure, reversion, DateVector.getCPtr(volstepdates), volstepdates, DoubleVector.getCPtr(volatilities), volatilities, SwaptionVolatilityStructureHandle.getCPtr(swaptionVol), swaptionVol, DateVector.getCPtr(swaptionExpiries), swaptionExpiries, PeriodVector.getCPtr(swaptionTenors), swaptionTenors, SwapIndex.getCPtr(swapIndexBase), swapIndexBase, MarkovFunctionalSettings.getCPtr(modelSettings), modelSettings), true); 048 } 049 050 public MarkovFunctional(YieldTermStructureHandle termStructure, double reversion, DateVector volstepdates, DoubleVector volatilities, SwaptionVolatilityStructureHandle swaptionVol, DateVector swaptionExpiries, PeriodVector swaptionTenors, SwapIndex swapIndexBase) { 051 this(QuantLibJNI.new_MarkovFunctional__SWIG_1(YieldTermStructureHandle.getCPtr(termStructure), termStructure, reversion, DateVector.getCPtr(volstepdates), volstepdates, DoubleVector.getCPtr(volatilities), volatilities, SwaptionVolatilityStructureHandle.getCPtr(swaptionVol), swaptionVol, DateVector.getCPtr(swaptionExpiries), swaptionExpiries, PeriodVector.getCPtr(swaptionTenors), swaptionTenors, SwapIndex.getCPtr(swapIndexBase), swapIndexBase), true); 052 } 053 054 public MarkovFunctional(YieldTermStructureHandle termStructure, double reversion, DateVector volstepdates, DoubleVector volatilities, OptionletVolatilityStructureHandle capletVol, DateVector capletExpiries, IborIndex iborIndex, MarkovFunctionalSettings modelSettings) { 055 this(QuantLibJNI.new_MarkovFunctional__SWIG_2(YieldTermStructureHandle.getCPtr(termStructure), termStructure, reversion, DateVector.getCPtr(volstepdates), volstepdates, DoubleVector.getCPtr(volatilities), volatilities, OptionletVolatilityStructureHandle.getCPtr(capletVol), capletVol, DateVector.getCPtr(capletExpiries), capletExpiries, IborIndex.getCPtr(iborIndex), iborIndex, MarkovFunctionalSettings.getCPtr(modelSettings), modelSettings), true); 056 } 057 058 public MarkovFunctional(YieldTermStructureHandle termStructure, double reversion, DateVector volstepdates, DoubleVector volatilities, OptionletVolatilityStructureHandle capletVol, DateVector capletExpiries, IborIndex iborIndex) { 059 this(QuantLibJNI.new_MarkovFunctional__SWIG_3(YieldTermStructureHandle.getCPtr(termStructure), termStructure, reversion, DateVector.getCPtr(volstepdates), volstepdates, DoubleVector.getCPtr(volatilities), volatilities, OptionletVolatilityStructureHandle.getCPtr(capletVol), capletVol, DateVector.getCPtr(capletExpiries), capletExpiries, IborIndex.getCPtr(iborIndex), iborIndex), true); 060 } 061 062 public Array volatility() { 063 return new Array(QuantLibJNI.MarkovFunctional_volatility(swigCPtr, this), false); 064 } 065 066 public void calibrate(CalibrationHelperVector helper, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint, DoubleVector weights, BoolVector fixParameters) { 067 QuantLibJNI.MarkovFunctional_calibrate__SWIG_0(swigCPtr, this, CalibrationHelperVector.getCPtr(helper), helper, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights, BoolVector.getCPtr(fixParameters), fixParameters); 068 } 069 070 public void calibrate(CalibrationHelperVector helper, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint, DoubleVector weights) { 071 QuantLibJNI.MarkovFunctional_calibrate__SWIG_1(swigCPtr, this, CalibrationHelperVector.getCPtr(helper), helper, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights); 072 } 073 074 public void calibrate(CalibrationHelperVector helper, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint) { 075 QuantLibJNI.MarkovFunctional_calibrate__SWIG_2(swigCPtr, this, CalibrationHelperVector.getCPtr(helper), helper, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint); 076 } 077 078 public void calibrate(CalibrationHelperVector helper, OptimizationMethod method, EndCriteria endCriteria) { 079 QuantLibJNI.MarkovFunctional_calibrate__SWIG_3(swigCPtr, this, CalibrationHelperVector.getCPtr(helper), helper, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria); 080 } 081 082 public Array params() { 083 return new Array(QuantLibJNI.MarkovFunctional_params(swigCPtr, this), true); 084 } 085 086 public void setParams(Array params) { 087 QuantLibJNI.MarkovFunctional_setParams(swigCPtr, this, Array.getCPtr(params), params); 088 } 089 090 public double value(Array params, CalibrationHelperVector instruments) { 091 return QuantLibJNI.MarkovFunctional_value(swigCPtr, this, Array.getCPtr(params), params, CalibrationHelperVector.getCPtr(instruments), instruments); 092 } 093 094 public Constraint constraint() { 095 long cPtr = QuantLibJNI.MarkovFunctional_constraint(swigCPtr, this); 096 return (cPtr == 0) ? null : new Constraint(cPtr, true); 097 } 098 099 public EndCriteria.Type endCriteria() { 100 return EndCriteria.Type.swigToEnum(QuantLibJNI.MarkovFunctional_endCriteria(swigCPtr, this)); 101 } 102 103 public Array problemValues() { 104 return new Array(QuantLibJNI.MarkovFunctional_problemValues(swigCPtr, this), false); 105 } 106 107 public int functionEvaluation() { 108 return QuantLibJNI.MarkovFunctional_functionEvaluation(swigCPtr, this); 109 } 110 111}