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 AbcdMathFunction implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected AbcdMathFunction(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(AbcdMathFunction obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(AbcdMathFunction obj) {
025    long ptr = 0;
026    if (obj != null) {
027      if (!obj.swigCMemOwn)
028        throw new RuntimeException("Cannot release ownership as memory is not owned");
029      ptr = obj.swigCPtr;
030      obj.swigCMemOwn = false;
031      obj.delete();
032    }
033    return ptr;
034  }
035
036  @SuppressWarnings("deprecation")
037  protected void finalize() {
038    delete();
039  }
040
041  public synchronized void delete() {
042    if (swigCPtr != 0) {
043      if (swigCMemOwn) {
044        swigCMemOwn = false;
045        QuantLibJNI.delete_AbcdMathFunction(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public AbcdMathFunction(double a, double b, double c, double d) {
052    this(QuantLibJNI.new_AbcdMathFunction__SWIG_0(a, b, c, d), true);
053  }
054
055  public AbcdMathFunction(double a, double b, double c) {
056    this(QuantLibJNI.new_AbcdMathFunction__SWIG_1(a, b, c), true);
057  }
058
059  public AbcdMathFunction(double a, double b) {
060    this(QuantLibJNI.new_AbcdMathFunction__SWIG_2(a, b), true);
061  }
062
063  public AbcdMathFunction(double a) {
064    this(QuantLibJNI.new_AbcdMathFunction__SWIG_3(a), true);
065  }
066
067  public AbcdMathFunction() {
068    this(QuantLibJNI.new_AbcdMathFunction__SWIG_4(), true);
069  }
070
071  public AbcdMathFunction(DoubleVector abcd) {
072    this(QuantLibJNI.new_AbcdMathFunction__SWIG_5(DoubleVector.getCPtr(abcd), abcd), true);
073  }
074
075  public double getValue(double t) {
076    return QuantLibJNI.AbcdMathFunction_getValue(swigCPtr, this, t);
077  }
078
079  public double maximumLocation() {
080    return QuantLibJNI.AbcdMathFunction_maximumLocation(swigCPtr, this);
081  }
082
083  public double maximumValue() {
084    return QuantLibJNI.AbcdMathFunction_maximumValue(swigCPtr, this);
085  }
086
087  public double longTermValue() {
088    return QuantLibJNI.AbcdMathFunction_longTermValue(swigCPtr, this);
089  }
090
091  public double derivative(double t) {
092    return QuantLibJNI.AbcdMathFunction_derivative(swigCPtr, this, t);
093  }
094
095  public double primitive(double t) {
096    return QuantLibJNI.AbcdMathFunction_primitive(swigCPtr, this, t);
097  }
098
099  public double definiteIntegral(double t1, double t2) {
100    return QuantLibJNI.AbcdMathFunction_definiteIntegral(swigCPtr, this, t1, t2);
101  }
102
103  public double a() {
104    return QuantLibJNI.AbcdMathFunction_a(swigCPtr, this);
105  }
106
107  public double b() {
108    return QuantLibJNI.AbcdMathFunction_b(swigCPtr, this);
109  }
110
111  public double c() {
112    return QuantLibJNI.AbcdMathFunction_c(swigCPtr, this);
113  }
114
115  public double d() {
116    return QuantLibJNI.AbcdMathFunction_d(swigCPtr, this);
117  }
118
119  public DoubleVector coefficients() {
120    return new DoubleVector(QuantLibJNI.AbcdMathFunction_coefficients(swigCPtr, this), false);
121  }
122
123  public DoubleVector derivativeCoefficients() {
124    return new DoubleVector(QuantLibJNI.AbcdMathFunction_derivativeCoefficients(swigCPtr, this), false);
125  }
126
127  public DoubleVector definiteIntegralCoefficients(double t, double t2) {
128    return new DoubleVector(QuantLibJNI.AbcdMathFunction_definiteIntegralCoefficients(swigCPtr, this, t, t2), true);
129  }
130
131  public DoubleVector definiteDerivativeCoefficients(double t, double t2) {
132    return new DoubleVector(QuantLibJNI.AbcdMathFunction_definiteDerivativeCoefficients(swigCPtr, this, t, t2), true);
133  }
134
135  public static void validate(double a, double b, double c, double d) {
136    QuantLibJNI.AbcdMathFunction_validate(a, b, c, d);
137  }
138
139}