/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.1
 *
 * 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 MarketModel {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

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

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwn = own;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

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

  public DoubleVector initialRates() {
    return new DoubleVector(QuantLibJNI.MarketModel_initialRates(swigCPtr, this), false);
  }

  public DoubleVector displacements() {
    return new DoubleVector(QuantLibJNI.MarketModel_displacements(swigCPtr, this), false);
  }

  public EvolutionDescription evolution() {
    return new EvolutionDescription(QuantLibJNI.MarketModel_evolution(swigCPtr, this), false);
  }

  public long numberOfRates() {
    return QuantLibJNI.MarketModel_numberOfRates(swigCPtr, this);
  }

  public long numberOfFactors() {
    return QuantLibJNI.MarketModel_numberOfFactors(swigCPtr, this);
  }

  public long numberOfSteps() {
    return QuantLibJNI.MarketModel_numberOfSteps(swigCPtr, this);
  }

  public Matrix pseudoRoot(long i) {
    return new Matrix(QuantLibJNI.MarketModel_pseudoRoot(swigCPtr, this, i), false);
  }

  public Matrix covariance(long i) {
    return new Matrix(QuantLibJNI.MarketModel_covariance(swigCPtr, this, i), false);
  }

  public Matrix totalCovariance(long endIndex) {
    return new Matrix(QuantLibJNI.MarketModel_totalCovariance(swigCPtr, this, endIndex), false);
  }

  public DoubleVector timeDependentVolatility(long i) {
    return new DoubleVector(QuantLibJNI.MarketModel_timeDependentVolatility(swigCPtr, this, i), true);
  }

}
