//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace QuantLib {

public class StochasticProcess : Observable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

  internal StochasticProcess(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NQuantLibcPINVOKE.StochasticProcess_SWIGSmartPtrUpcast(cPtr), true) {
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(StochasticProcess obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwnDerived) {
          swigCMemOwnDerived = false;
          NQuantLibcPINVOKE.delete_StochasticProcess(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public uint size() {
    uint ret = NQuantLibcPINVOKE.StochasticProcess_size(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint factors() {
    uint ret = NQuantLibcPINVOKE.StochasticProcess_factors(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public QlArray initialValues() {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.StochasticProcess_initialValues(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public QlArray drift(double t, QlArray x) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.StochasticProcess_drift(swigCPtr, t, QlArray.getCPtr(x)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Matrix diffusion(double t, QlArray x) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.StochasticProcess_diffusion(swigCPtr, t, QlArray.getCPtr(x)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public QlArray expectation(double t0, QlArray x0, double dt) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.StochasticProcess_expectation(swigCPtr, t0, QlArray.getCPtr(x0), dt), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Matrix stdDeviation(double t0, QlArray x0, double dt) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.StochasticProcess_stdDeviation(swigCPtr, t0, QlArray.getCPtr(x0), dt), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Matrix covariance(double t0, QlArray x0, double dt) {
    Matrix ret = new Matrix(NQuantLibcPINVOKE.StochasticProcess_covariance(swigCPtr, t0, QlArray.getCPtr(x0), dt), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public QlArray evolve(double t0, QlArray x0, double dt, QlArray dw) {
    QlArray ret = new QlArray(NQuantLibcPINVOKE.StochasticProcess_evolve(swigCPtr, t0, QlArray.getCPtr(x0), dt, QlArray.getCPtr(dw)), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
