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 SwaptionVolatilityMatrix extends SwaptionVolatilityDiscrete implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwnDerived; 014 015 protected SwaptionVolatilityMatrix(long cPtr, boolean cMemoryOwn) { 016 super(QuantLibJNI.SwaptionVolatilityMatrix_SWIGSmartPtrUpcast(cPtr), true); 017 swigCMemOwnDerived = cMemoryOwn; 018 swigCPtr = cPtr; 019 } 020 021 protected static long getCPtr(SwaptionVolatilityMatrix obj) { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected void swigSetCMemOwn(boolean own) { 026 swigCMemOwnDerived = own; 027 super.swigSetCMemOwn(own); 028 } 029 030 @SuppressWarnings("deprecation") 031 protected void finalize() { 032 delete(); 033 } 034 035 public synchronized void delete() { 036 if (swigCPtr != 0) { 037 if (swigCMemOwnDerived) { 038 swigCMemOwnDerived = false; 039 QuantLibJNI.delete_SwaptionVolatilityMatrix(swigCPtr); 040 } 041 swigCPtr = 0; 042 } 043 super.delete(); 044 } 045 046 public SwaptionVolatilityMatrix(Date referenceDate, Calendar calendar, BusinessDayConvention bdc, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type, Matrix shifts) { 047 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_0(Date.getCPtr(referenceDate), referenceDate, Calendar.getCPtr(calendar), calendar, bdc.swigValue(), DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue(), Matrix.getCPtr(shifts), shifts), true); 048 } 049 050 public SwaptionVolatilityMatrix(Date referenceDate, Calendar calendar, BusinessDayConvention bdc, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type) { 051 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_1(Date.getCPtr(referenceDate), referenceDate, Calendar.getCPtr(calendar), calendar, bdc.swigValue(), DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue()), true); 052 } 053 054 public SwaptionVolatilityMatrix(Date referenceDate, Calendar calendar, BusinessDayConvention bdc, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation) { 055 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_2(Date.getCPtr(referenceDate), referenceDate, Calendar.getCPtr(calendar), calendar, bdc.swigValue(), DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation), true); 056 } 057 058 public SwaptionVolatilityMatrix(Date referenceDate, Calendar calendar, BusinessDayConvention bdc, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter) { 059 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_3(Date.getCPtr(referenceDate), referenceDate, Calendar.getCPtr(calendar), calendar, bdc.swigValue(), DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter), true); 060 } 061 062 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, QuoteHandleVectorVector vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type, DoubleVectorVector shifts) { 063 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_4(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, QuoteHandleVectorVector.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue(), DoubleVectorVector.getCPtr(shifts), shifts), true); 064 } 065 066 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, QuoteHandleVectorVector vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type) { 067 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_5(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, QuoteHandleVectorVector.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue()), true); 068 } 069 070 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, QuoteHandleVectorVector vols, DayCounter dayCounter, boolean flatExtrapolation) { 071 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_6(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, QuoteHandleVectorVector.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation), true); 072 } 073 074 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, QuoteHandleVectorVector vols, DayCounter dayCounter) { 075 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_7(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, QuoteHandleVectorVector.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter), true); 076 } 077 078 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type, Matrix shifts) { 079 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_8(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue(), Matrix.getCPtr(shifts), shifts), true); 080 } 081 082 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type) { 083 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_9(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue()), true); 084 } 085 086 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation) { 087 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_10(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation), true); 088 } 089 090 public SwaptionVolatilityMatrix(Calendar calendar, BusinessDayConvention bdc, PeriodVector optionTenors, PeriodVector swapTenors, Matrix vols, DayCounter dayCounter) { 091 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_11(Calendar.getCPtr(calendar), calendar, bdc.swigValue(), PeriodVector.getCPtr(optionTenors), optionTenors, PeriodVector.getCPtr(swapTenors), swapTenors, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter), true); 092 } 093 094 public SwaptionVolatilityMatrix(Date referenceDate, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type, Matrix shifts) { 095 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_12(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue(), Matrix.getCPtr(shifts), shifts), true); 096 } 097 098 public SwaptionVolatilityMatrix(Date referenceDate, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation, VolatilityType type) { 099 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_13(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation, type.swigValue()), true); 100 } 101 102 public SwaptionVolatilityMatrix(Date referenceDate, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter, boolean flatExtrapolation) { 103 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_14(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter, flatExtrapolation), true); 104 } 105 106 public SwaptionVolatilityMatrix(Date referenceDate, DateVector dates, PeriodVector lengths, Matrix vols, DayCounter dayCounter) { 107 this(QuantLibJNI.new_SwaptionVolatilityMatrix__SWIG_15(Date.getCPtr(referenceDate), referenceDate, DateVector.getCPtr(dates), dates, PeriodVector.getCPtr(lengths), lengths, Matrix.getCPtr(vols), vols, DayCounter.getCPtr(dayCounter), dayCounter), true); 108 } 109 110 public UnsignedIntPair locate(Date optionDate, Period swapTenor) { 111 return new UnsignedIntPair(QuantLibJNI.SwaptionVolatilityMatrix_locate__SWIG_0(swigCPtr, this, Date.getCPtr(optionDate), optionDate, Period.getCPtr(swapTenor), swapTenor), true); 112 } 113 114 public UnsignedIntPair locate(double optionTime, double swapLength) { 115 return new UnsignedIntPair(QuantLibJNI.SwaptionVolatilityMatrix_locate__SWIG_1(swigCPtr, this, optionTime, swapLength), true); 116 } 117 118 public VolatilityType volatilityType() { 119 return VolatilityType.swigToEnum(QuantLibJNI.SwaptionVolatilityMatrix_volatilityType(swigCPtr, this)); 120 } 121 122}