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 BrownianBridge implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected BrownianBridge(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(BrownianBridge obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(BrownianBridge 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_BrownianBridge(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public BrownianBridge(long steps) {
052    this(QuantLibJNI.new_BrownianBridge__SWIG_0(steps), true);
053  }
054
055  public BrownianBridge(DoubleVector times) {
056    this(QuantLibJNI.new_BrownianBridge__SWIG_1(DoubleVector.getCPtr(times), times), true);
057  }
058
059  public BrownianBridge(TimeGrid timeGrid) {
060    this(QuantLibJNI.new_BrownianBridge__SWIG_2(TimeGrid.getCPtr(timeGrid), timeGrid), true);
061  }
062
063  public long size() {
064    return QuantLibJNI.BrownianBridge_size(swigCPtr, this);
065  }
066
067  public DoubleVector times() {
068    return new DoubleVector(QuantLibJNI.BrownianBridge_times(swigCPtr, this), true);
069  }
070
071  public DoubleVector leftWeight() {
072    return new DoubleVector(QuantLibJNI.BrownianBridge_leftWeight(swigCPtr, this), true);
073  }
074
075  public DoubleVector rightWeight() {
076    return new DoubleVector(QuantLibJNI.BrownianBridge_rightWeight(swigCPtr, this), true);
077  }
078
079  public DoubleVector stdDeviation() {
080    return new DoubleVector(QuantLibJNI.BrownianBridge_stdDeviation(swigCPtr, this), true);
081  }
082
083  public DoubleVector transform(DoubleVector input) {
084    return new DoubleVector(QuantLibJNI.BrownianBridge_transform(swigCPtr, this, DoubleVector.getCPtr(input), input), true);
085  }
086
087  public UnsignedIntVector bridgeIndex() {
088    return new UnsignedIntVector(QuantLibJNI.BrownianBridge_bridgeIndex(swigCPtr, this), true);
089  }
090
091  public UnsignedIntVector leftIndex() {
092    return new UnsignedIntVector(QuantLibJNI.BrownianBridge_leftIndex(swigCPtr, this), true);
093  }
094
095  public UnsignedIntVector rightIndex() {
096    return new UnsignedIntVector(QuantLibJNI.BrownianBridge_rightIndex(swigCPtr, this), true);
097  }
098
099}