File: BlackCalculator.java

package info (click to toggle)
quantlib-swig 1.15-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 103,484 kB
  • sloc: cpp: 2,029,354; cs: 61,237; java: 45,425; perl: 27,362; python: 22,024; ruby: 989; sh: 741; makefile: 319
file content (114 lines) | stat: -rw-r--r-- 3,335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.quantlib;

public class BlackCalculator {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected BlackCalculator(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(BlackCalculator obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_BlackCalculator(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public BlackCalculator(Payoff payoff, double forward, double stdDev, double discount) {
    this(QuantLibJNI.new_BlackCalculator__SWIG_0(Payoff.getCPtr(payoff), payoff, forward, stdDev, discount), true);
  }

  public BlackCalculator(Payoff payoff, double forward, double stdDev) {
    this(QuantLibJNI.new_BlackCalculator__SWIG_1(Payoff.getCPtr(payoff), payoff, forward, stdDev), true);
  }

  public double value() {
    return QuantLibJNI.BlackCalculator_value(swigCPtr, this);
  }

  public double deltaForward() {
    return QuantLibJNI.BlackCalculator_deltaForward(swigCPtr, this);
  }

  public double delta(double spot) {
    return QuantLibJNI.BlackCalculator_delta(swigCPtr, this, spot);
  }

  public double elasticityForward() {
    return QuantLibJNI.BlackCalculator_elasticityForward(swigCPtr, this);
  }

  public double elasticity(double spot) {
    return QuantLibJNI.BlackCalculator_elasticity(swigCPtr, this, spot);
  }

  public double gammaForward() {
    return QuantLibJNI.BlackCalculator_gammaForward(swigCPtr, this);
  }

  public double gamma(double spot) {
    return QuantLibJNI.BlackCalculator_gamma(swigCPtr, this, spot);
  }

  public double theta(double spot, double maturity) {
    return QuantLibJNI.BlackCalculator_theta(swigCPtr, this, spot, maturity);
  }

  public double thetaPerDay(double spot, double maturity) {
    return QuantLibJNI.BlackCalculator_thetaPerDay(swigCPtr, this, spot, maturity);
  }

  public double vega(double maturity) {
    return QuantLibJNI.BlackCalculator_vega(swigCPtr, this, maturity);
  }

  public double rho(double maturity) {
    return QuantLibJNI.BlackCalculator_rho(swigCPtr, this, maturity);
  }

  public double dividendRho(double maturity) {
    return QuantLibJNI.BlackCalculator_dividendRho(swigCPtr, this, maturity);
  }

  public double itmCashProbability() {
    return QuantLibJNI.BlackCalculator_itmCashProbability(swigCPtr, this);
  }

  public double itmAssetProbability() {
    return QuantLibJNI.BlackCalculator_itmAssetProbability(swigCPtr, this);
  }

  public double strikeSensitivity() {
    return QuantLibJNI.BlackCalculator_strikeSensitivity(swigCPtr, this);
  }

  public double alpha() {
    return QuantLibJNI.BlackCalculator_alpha(swigCPtr, this);
  }

  public double beta() {
    return QuantLibJNI.BlackCalculator_beta(swigCPtr, this);
  }

}