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 CmsMarket implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwn; 014 015 protected CmsMarket(long cPtr, boolean cMemoryOwn) { 016 swigCMemOwn = cMemoryOwn; 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(CmsMarket obj) { 021 return (obj == null) ? 0 : obj.swigCPtr; 022 } 023 024 protected void swigSetCMemOwn(boolean own) { 025 swigCMemOwn = own; 026 } 027 028 @SuppressWarnings("deprecation") 029 protected void finalize() { 030 delete(); 031 } 032 033 public synchronized void delete() { 034 if (swigCPtr != 0) { 035 if (swigCMemOwn) { 036 swigCMemOwn = false; 037 QuantLibJNI.delete_CmsMarket(swigCPtr); 038 } 039 swigCPtr = 0; 040 } 041 } 042 043 public CmsMarket(PeriodVector swapLengths, SwapIndexVector swapIndexes, IborIndex iborIndex, QuoteHandleVectorVector bidAskSpreads, CmsCouponPricerVector pricers, YieldTermStructureHandle discountingTS) { 044 this(QuantLibJNI.new_CmsMarket(PeriodVector.getCPtr(swapLengths), swapLengths, SwapIndexVector.getCPtr(swapIndexes), swapIndexes, IborIndex.getCPtr(iborIndex), iborIndex, QuoteHandleVectorVector.getCPtr(bidAskSpreads), bidAskSpreads, CmsCouponPricerVector.getCPtr(pricers), pricers, YieldTermStructureHandle.getCPtr(discountingTS), discountingTS), true); 045 } 046 047 public void reprice(SwaptionVolatilityStructureHandle volStructure, double meanReversion) { 048 QuantLibJNI.CmsMarket_reprice(swigCPtr, this, SwaptionVolatilityStructureHandle.getCPtr(volStructure), volStructure, meanReversion); 049 } 050 051 public PeriodVector swapTenors() { 052 return new PeriodVector(QuantLibJNI.CmsMarket_swapTenors(swigCPtr, this), false); 053 } 054 055 public PeriodVector swapLengths() { 056 return new PeriodVector(QuantLibJNI.CmsMarket_swapLengths(swigCPtr, this), false); 057 } 058 059 public Matrix impliedCmsSpreads() { 060 return new Matrix(QuantLibJNI.CmsMarket_impliedCmsSpreads(swigCPtr, this), false); 061 } 062 063 public Matrix spreadErrors() { 064 return new Matrix(QuantLibJNI.CmsMarket_spreadErrors(swigCPtr, this), false); 065 } 066 067 public Matrix browse() { 068 return new Matrix(QuantLibJNI.CmsMarket_browse(swigCPtr, this), true); 069 } 070 071 public double weightedSpreadError(Matrix weights) { 072 return QuantLibJNI.CmsMarket_weightedSpreadError(swigCPtr, this, Matrix.getCPtr(weights), weights); 073 } 074 075 public double weightedSpotNpvError(Matrix weights) { 076 return QuantLibJNI.CmsMarket_weightedSpotNpvError(swigCPtr, this, Matrix.getCPtr(weights), weights); 077 } 078 079 public double weightedFwdNpvError(Matrix weights) { 080 return QuantLibJNI.CmsMarket_weightedFwdNpvError(swigCPtr, this, Matrix.getCPtr(weights), weights); 081 } 082 083 public Array weightedSpreadErrors(Matrix weights) { 084 return new Array(QuantLibJNI.CmsMarket_weightedSpreadErrors(swigCPtr, this, Matrix.getCPtr(weights), weights), true); 085 } 086 087 public Array weightedSpotNpvErrors(Matrix weights) { 088 return new Array(QuantLibJNI.CmsMarket_weightedSpotNpvErrors(swigCPtr, this, Matrix.getCPtr(weights), weights), true); 089 } 090 091 public Array weightedFwdNpvErrors(Matrix weights) { 092 return new Array(QuantLibJNI.CmsMarket_weightedFwdNpvErrors(swigCPtr, this, Matrix.getCPtr(weights), weights), true); 093 } 094 095}