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 ExtendedOrnsteinUhlenbeckProcess extends StochasticProcess1D implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwnDerived; 014 015 protected ExtendedOrnsteinUhlenbeckProcess(long cPtr, boolean cMemoryOwn) { 016 super(QuantLibJNI.ExtendedOrnsteinUhlenbeckProcess_SWIGSmartPtrUpcast(cPtr), true); 017 swigCMemOwnDerived = cMemoryOwn; 018 swigCPtr = cPtr; 019 } 020 021 protected static long getCPtr(ExtendedOrnsteinUhlenbeckProcess 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_ExtendedOrnsteinUhlenbeckProcess(swigCPtr); 040 } 041 swigCPtr = 0; 042 } 043 super.delete(); 044 } 045 046 public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t b, ExtendedOrnsteinUhlenbeckProcess.Discretization discretization, double intEps) { 047 this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_0(speed, sigma, x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t.getCPtr(b), discretization.swigValue(), intEps), true); 048 } 049 050 public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t b, ExtendedOrnsteinUhlenbeckProcess.Discretization discretization) { 051 this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_1(speed, sigma, x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t.getCPtr(b), discretization.swigValue()), true); 052 } 053 054 public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t b) { 055 this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_2(speed, sigma, x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t.getCPtr(b)), true); 056 } 057 058 public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, UnaryFunctionDelegate function, double intEps) { 059 this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_3(speed, sigma, x0, UnaryFunctionDelegate.getCPtr(function), function, intEps), true); 060 } 061 062 public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, UnaryFunctionDelegate function) { 063 this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_4(speed, sigma, x0, UnaryFunctionDelegate.getCPtr(function), function), true); 064 } 065 066 public final static class Discretization { 067 public final static ExtendedOrnsteinUhlenbeckProcess.Discretization MidPoint = new ExtendedOrnsteinUhlenbeckProcess.Discretization("MidPoint"); 068 public final static ExtendedOrnsteinUhlenbeckProcess.Discretization Trapezodial = new ExtendedOrnsteinUhlenbeckProcess.Discretization("Trapezodial"); 069 public final static ExtendedOrnsteinUhlenbeckProcess.Discretization GaussLobatto = new ExtendedOrnsteinUhlenbeckProcess.Discretization("GaussLobatto"); 070 071 public final int swigValue() { 072 return swigValue; 073 } 074 075 public String toString() { 076 return swigName; 077 } 078 079 public static Discretization swigToEnum(int swigValue) { 080 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 081 return swigValues[swigValue]; 082 for (int i = 0; i < swigValues.length; i++) 083 if (swigValues[i].swigValue == swigValue) 084 return swigValues[i]; 085 throw new IllegalArgumentException("No enum " + Discretization.class + " with value " + swigValue); 086 } 087 088 private Discretization(String swigName) { 089 this.swigName = swigName; 090 this.swigValue = swigNext++; 091 } 092 093 private Discretization(String swigName, int swigValue) { 094 this.swigName = swigName; 095 this.swigValue = swigValue; 096 swigNext = swigValue+1; 097 } 098 099 private Discretization(String swigName, Discretization swigEnum) { 100 this.swigName = swigName; 101 this.swigValue = swigEnum.swigValue; 102 swigNext = this.swigValue+1; 103 } 104 105 private static Discretization[] swigValues = { MidPoint, Trapezodial, GaussLobatto }; 106 private static int swigNext = 0; 107 private final int swigValue; 108 private final String swigName; 109 } 110 111}