/* ----------------------------------------------------------------------------
 * 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 MultipleIncrementalStatistics {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

  public MultipleIncrementalStatistics(long dimension) {
    this(QuantLibJNI.new_MultipleIncrementalStatistics(dimension), true);
  }

  public long size() {
    return QuantLibJNI.MultipleIncrementalStatistics_size(swigCPtr, this);
  }

  public long samples() {
    return QuantLibJNI.MultipleIncrementalStatistics_samples(swigCPtr, this);
  }

  public double weightSum() {
    return QuantLibJNI.MultipleIncrementalStatistics_weightSum(swigCPtr, this);
  }

  public DoubleVector mean() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_mean(swigCPtr, this), true);
  }

  public DoubleVector variance() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_variance(swigCPtr, this), true);
  }

  public DoubleVector standardDeviation() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_standardDeviation(swigCPtr, this), true);
  }

  public DoubleVector errorEstimate() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_errorEstimate(swigCPtr, this), true);
  }

  public DoubleVector skewness() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_skewness(swigCPtr, this), true);
  }

  public DoubleVector kurtosis() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_kurtosis(swigCPtr, this), true);
  }

  public DoubleVector min() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_min(swigCPtr, this), true);
  }

  public DoubleVector max() {
    return new DoubleVector(QuantLibJNI.MultipleIncrementalStatistics_max(swigCPtr, this), true);
  }

  public Matrix covariance() {
    return new Matrix(QuantLibJNI.MultipleIncrementalStatistics_covariance(swigCPtr, this), true);
  }

  public Matrix correlation() {
    return new Matrix(QuantLibJNI.MultipleIncrementalStatistics_correlation(swigCPtr, this), true);
  }

  public void reset() {
    QuantLibJNI.MultipleIncrementalStatistics_reset(swigCPtr, this);
  }

  public void add(DoubleVector value, double weight) {
    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_0(swigCPtr, this, DoubleVector.getCPtr(value), value, weight);
  }

  public void add(DoubleVector value) {
    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_1(swigCPtr, this, DoubleVector.getCPtr(value), value);
  }

  public void add(Array value, double weight) {
    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_2(swigCPtr, this, Array.getCPtr(value), value, weight);
  }

  public void add(Array value) {
    QuantLibJNI.MultipleIncrementalStatistics_add__SWIG_3(swigCPtr, this, Array.getCPtr(value), value);
  }

}
