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 FdmHestonHullWhiteSolver implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwn; 014 015 protected FdmHestonHullWhiteSolver(long cPtr, boolean cMemoryOwn) { 016 swigCMemOwn = cMemoryOwn; 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(FdmHestonHullWhiteSolver obj) { 021 return (obj == null) ? 0 : obj.swigCPtr; 022 } 023 024 protected void swigSetCMemOwn(boolean own) { 025 swigCMemOwn = own; 026 } 027 028 @SuppressWarnings("deprecation") 029 protected void finalize() { 030 delete(); 031 } 032 033 public synchronized void delete() { 034 if (swigCPtr != 0) { 035 if (swigCMemOwn) { 036 swigCMemOwn = false; 037 QuantLibJNI.delete_FdmHestonHullWhiteSolver(swigCPtr); 038 } 039 swigCPtr = 0; 040 } 041 } 042 043 public FdmHestonHullWhiteSolver(HestonProcess hestonProcess, HullWhiteProcess hwProcess, double corrEquityShortRate, FdmSolverDesc solverDesc, FdmSchemeDesc schemeDesc) { 044 this(QuantLibJNI.new_FdmHestonHullWhiteSolver__SWIG_0(HestonProcess.getCPtr(hestonProcess), hestonProcess, HullWhiteProcess.getCPtr(hwProcess), hwProcess, corrEquityShortRate, FdmSolverDesc.getCPtr(solverDesc), solverDesc, FdmSchemeDesc.getCPtr(schemeDesc), schemeDesc), true); 045 } 046 047 public FdmHestonHullWhiteSolver(HestonProcess hestonProcess, HullWhiteProcess hwProcess, double corrEquityShortRate, FdmSolverDesc solverDesc) { 048 this(QuantLibJNI.new_FdmHestonHullWhiteSolver__SWIG_1(HestonProcess.getCPtr(hestonProcess), hestonProcess, HullWhiteProcess.getCPtr(hwProcess), hwProcess, corrEquityShortRate, FdmSolverDesc.getCPtr(solverDesc), solverDesc), true); 049 } 050 051 public double valueAt(double s, double v, double r) { 052 return QuantLibJNI.FdmHestonHullWhiteSolver_valueAt(swigCPtr, this, s, v, r); 053 } 054 055 public double thetaAt(double s, double v, double r) { 056 return QuantLibJNI.FdmHestonHullWhiteSolver_thetaAt(swigCPtr, this, s, v, r); 057 } 058 059 public double deltaAt(double s, double v, double r, double eps) { 060 return QuantLibJNI.FdmHestonHullWhiteSolver_deltaAt(swigCPtr, this, s, v, r, eps); 061 } 062 063 public double gammaAt(double s, double v, double r, double eps) { 064 return QuantLibJNI.FdmHestonHullWhiteSolver_gammaAt(swigCPtr, this, s, v, r, eps); 065 } 066 067}