/* ----------------------------------------------------------------------------
 * 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 Gsr extends Gaussian1dModel {
  private transient long swigCPtr;

  protected Gsr(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.Gsr_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  protected void finalize() {
    delete();
  }

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

  public Gsr(YieldTermStructureHandle termStructure, DateVector volstepdates, QuoteHandleVector volatilities, QuoteHandleVector reversions, double T) {
    this(QuantLibJNI.new_Gsr__SWIG_0(YieldTermStructureHandle.getCPtr(termStructure), termStructure, DateVector.getCPtr(volstepdates), volstepdates, QuoteHandleVector.getCPtr(volatilities), volatilities, QuoteHandleVector.getCPtr(reversions), reversions, T), true);
  }

  public Gsr(YieldTermStructureHandle termStructure, DateVector volstepdates, QuoteHandleVector volatilities, QuoteHandleVector reversions) {
    this(QuantLibJNI.new_Gsr__SWIG_1(YieldTermStructureHandle.getCPtr(termStructure), termStructure, DateVector.getCPtr(volstepdates), volstepdates, QuoteHandleVector.getCPtr(volatilities), volatilities, QuoteHandleVector.getCPtr(reversions), reversions), true);
  }

  public void calibrateVolatilitiesIterative(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint, DoubleVector weights) {
    QuantLibJNI.Gsr_calibrateVolatilitiesIterative__SWIG_0(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights);
  }

  public void calibrateVolatilitiesIterative(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint) {
    QuantLibJNI.Gsr_calibrateVolatilitiesIterative__SWIG_1(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint);
  }

  public void calibrateVolatilitiesIterative(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria) {
    QuantLibJNI.Gsr_calibrateVolatilitiesIterative__SWIG_2(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria);
  }

  public void calibrate(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint, DoubleVector weights, BoolVector fixParameters) {
    QuantLibJNI.Gsr_calibrate__SWIG_0(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights, BoolVector.getCPtr(fixParameters), fixParameters);
  }

  public void calibrate(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint, DoubleVector weights) {
    QuantLibJNI.Gsr_calibrate__SWIG_1(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint, DoubleVector.getCPtr(weights), weights);
  }

  public void calibrate(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria, Constraint constraint) {
    QuantLibJNI.Gsr_calibrate__SWIG_2(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria, Constraint.getCPtr(constraint), constraint);
  }

  public void calibrate(CalibrationHelperVector helpers, OptimizationMethod method, EndCriteria endCriteria) {
    QuantLibJNI.Gsr_calibrate__SWIG_3(swigCPtr, this, CalibrationHelperVector.getCPtr(helpers), helpers, OptimizationMethod.getCPtr(method), method, EndCriteria.getCPtr(endCriteria), endCriteria);
  }

  public Array params() {
    return new Array(QuantLibJNI.Gsr_params(swigCPtr, this), true);
  }

  public double value(Array params, CalibrationHelperVector helpers) {
    return QuantLibJNI.Gsr_value(swigCPtr, this, Array.getCPtr(params), params, CalibrationHelperVector.getCPtr(helpers), helpers);
  }

  public EndCriteria.Type endCriteria() {
    return EndCriteria.Type.swigToEnum(QuantLibJNI.Gsr_endCriteria(swigCPtr, this));
  }

  public void setParams(Array params) {
    QuantLibJNI.Gsr_setParams(swigCPtr, this, Array.getCPtr(params), params);
  }

  public int functionEvaluation() {
    return QuantLibJNI.Gsr_functionEvaluation(swigCPtr, this);
  }

  public Array reversion() {
    return new Array(QuantLibJNI.Gsr_reversion(swigCPtr, this), false);
  }

  public Array volatility() {
    return new Array(QuantLibJNI.Gsr_volatility(swigCPtr, this), false);
  }

}
