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 MultipleIncrementalStatistics implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected MultipleIncrementalStatistics(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(MultipleIncrementalStatistics obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(MultipleIncrementalStatistics 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_MultipleIncrementalStatistics(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public MultipleIncrementalStatistics(long dimension) {
052    this(QuantLibJNI.new_MultipleIncrementalStatistics(dimension), true);
053  }
054
055  public long size() {
056    return QuantLibJNI.MultipleIncrementalStatistics_size(swigCPtr, this);
057  }
058
059  public long samples() {
060    return QuantLibJNI.MultipleIncrementalStatistics_samples(swigCPtr, this);
061  }
062
063  public double weightSum() {
064    return QuantLibJNI.MultipleIncrementalStatistics_weightSum(swigCPtr, this);
065  }
066
067  public DoubleVector mean() {
068    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_mean(swigCPtr, this), true);
069  }
070
071  public DoubleVector variance() {
072    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_variance(swigCPtr, this), true);
073  }
074
075  public DoubleVector standardDeviation() {
076    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_standardDeviation(swigCPtr, this), true);
077  }
078
079  public DoubleVector errorEstimate() {
080    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_errorEstimate(swigCPtr, this), true);
081  }
082
083  public DoubleVector skewness() {
084    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_skewness(swigCPtr, this), true);
085  }
086
087  public DoubleVector kurtosis() {
088    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_kurtosis(swigCPtr, this), true);
089  }
090
091  public DoubleVector min() {
092    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_min(swigCPtr, this), true);
093  }
094
095  public DoubleVector max() {
096    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_max(swigCPtr, this), true);
097  }
098
099  public Matrix covariance() {
100    return new Matrix(QuantLibJNI.MultipleIncrementalStatistics_covariance(swigCPtr, this), true);
101  }
102
103  public Matrix correlation() {
104    return new Matrix(QuantLibJNI.MultipleIncrementalStatistics_correlation(swigCPtr, this), true);
105  }
106
107  public void reset() {
108    QuantLibJNI.MultipleIncrementalStatistics_reset(swigCPtr, this);
109  }
110
111  public void add(DoubleVector value, double weight) {
112    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_0(swigCPtr, this, DoubleVector.getCPtr(value), value, weight);
113  }
114
115  public void add(DoubleVector value) {
116    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_1(swigCPtr, this, DoubleVector.getCPtr(value), value);
117  }
118
119  public void add(Array value, double weight) {
120    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_2(swigCPtr, this, Array.getCPtr(value), value, weight);
121  }
122
123  public void add(Array value) {
124    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_3(swigCPtr, this, Array.getCPtr(value), value);
125  }
126
127}