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 Fdm2dBlackScholesSolver implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwn; 014 015 protected Fdm2dBlackScholesSolver(long cPtr, boolean cMemoryOwn) { 016 swigCMemOwn = cMemoryOwn; 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(Fdm2dBlackScholesSolver 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_Fdm2dBlackScholesSolver(swigCPtr); 038 } 039 swigCPtr = 0; 040 } 041 } 042 043 public Fdm2dBlackScholesSolver(GeneralizedBlackScholesProcess p1, GeneralizedBlackScholesProcess p2, double correlation, FdmSolverDesc solverDesc, FdmSchemeDesc schemeDesc, boolean localVol, double illegalLocalVolOverwrite) { 044 this(QuantLibJNI.new_Fdm2dBlackScholesSolver__SWIG_0(GeneralizedBlackScholesProcess.getCPtr(p1), p1, GeneralizedBlackScholesProcess.getCPtr(p2), p2, correlation, FdmSolverDesc.getCPtr(solverDesc), solverDesc, FdmSchemeDesc.getCPtr(schemeDesc), schemeDesc, localVol, illegalLocalVolOverwrite), true); 045 } 046 047 public Fdm2dBlackScholesSolver(GeneralizedBlackScholesProcess p1, GeneralizedBlackScholesProcess p2, double correlation, FdmSolverDesc solverDesc, FdmSchemeDesc schemeDesc, boolean localVol) { 048 this(QuantLibJNI.new_Fdm2dBlackScholesSolver__SWIG_1(GeneralizedBlackScholesProcess.getCPtr(p1), p1, GeneralizedBlackScholesProcess.getCPtr(p2), p2, correlation, FdmSolverDesc.getCPtr(solverDesc), solverDesc, FdmSchemeDesc.getCPtr(schemeDesc), schemeDesc, localVol), true); 049 } 050 051 public Fdm2dBlackScholesSolver(GeneralizedBlackScholesProcess p1, GeneralizedBlackScholesProcess p2, double correlation, FdmSolverDesc solverDesc, FdmSchemeDesc schemeDesc) { 052 this(QuantLibJNI.new_Fdm2dBlackScholesSolver__SWIG_2(GeneralizedBlackScholesProcess.getCPtr(p1), p1, GeneralizedBlackScholesProcess.getCPtr(p2), p2, correlation, FdmSolverDesc.getCPtr(solverDesc), solverDesc, FdmSchemeDesc.getCPtr(schemeDesc), schemeDesc), true); 053 } 054 055 public Fdm2dBlackScholesSolver(GeneralizedBlackScholesProcess p1, GeneralizedBlackScholesProcess p2, double correlation, FdmSolverDesc solverDesc) { 056 this(QuantLibJNI.new_Fdm2dBlackScholesSolver__SWIG_3(GeneralizedBlackScholesProcess.getCPtr(p1), p1, GeneralizedBlackScholesProcess.getCPtr(p2), p2, correlation, FdmSolverDesc.getCPtr(solverDesc), solverDesc), true); 057 } 058 059 public double valueAt(double x, double y) { 060 return QuantLibJNI.Fdm2dBlackScholesSolver_valueAt(swigCPtr, this, x, y); 061 } 062 063 public double thetaAt(double x, double y) { 064 return QuantLibJNI.Fdm2dBlackScholesSolver_thetaAt(swigCPtr, this, x, y); 065 } 066 067 public double deltaXat(double x, double y) { 068 return QuantLibJNI.Fdm2dBlackScholesSolver_deltaXat(swigCPtr, this, x, y); 069 } 070 071 public double deltaYat(double x, double y) { 072 return QuantLibJNI.Fdm2dBlackScholesSolver_deltaYat(swigCPtr, this, x, y); 073 } 074 075 public double gammaXat(double x, double y) { 076 return QuantLibJNI.Fdm2dBlackScholesSolver_gammaXat(swigCPtr, this, x, y); 077 } 078 079 public double gammaYat(double x, double y) { 080 return QuantLibJNI.Fdm2dBlackScholesSolver_gammaYat(swigCPtr, this, x, y); 081 } 082 083 public double gammaXYat(double x, double y) { 084 return QuantLibJNI.Fdm2dBlackScholesSolver_gammaXYat(swigCPtr, this, x, y); 085 } 086 087}