//-------------------------------------------------------------------------
        /// <summary>
        /// Calculates the present value rates sensitivity of the Ibor cap/floor product.
        /// <para>
        /// The present value rates sensitivity of the product is the sensitivity
        /// of the present value to the underlying curves.
        ///
        /// </para>
        /// </summary>
        /// <param name="capFloor">  the Ibor cap/floor product </param>
        /// <param name="ratesProvider">  the rates provider </param>
        /// <param name="volatilities">  the volatilities </param>
        /// <returns> the present value sensitivity </returns>
        public virtual PointSensitivityBuilder presentValueSensitivityRates(ResolvedIborCapFloor capFloor, RatesProvider ratesProvider, IborCapletFloorletVolatilities volatilities)
        {
            PointSensitivityBuilder pvSensiCapFloorLeg = capFloorLegPricer.presentValueSensitivityRates(capFloor.CapFloorLeg, ratesProvider, volatilities);

            if (!capFloor.PayLeg.Present)
            {
                return(pvSensiCapFloorLeg);
            }
            PointSensitivityBuilder pvSensiPayLeg = payLegPricer.presentValueSensitivity(capFloor.PayLeg.get(), ratesProvider);

            return(pvSensiCapFloorLeg.combinedWith(pvSensiPayLeg));
        }
        //-------------------------------------------------------------------------
        /// <summary>
        /// Calculates the present value of the Ibor cap/floor product.
        /// <para>
        /// The present value of the product is the value on the valuation date.
        /// </para>
        /// <para>
        /// The cap/floor leg and pay leg are typically in the same currency, thus the
        /// present value gamma is expressed as a single currency amount in most cases.
        ///
        /// </para>
        /// </summary>
        /// <param name="capFloor">  the Ibor cap/floor product </param>
        /// <param name="ratesProvider">  the rates provider </param>
        /// <param name="volatilities">  the volatilities </param>
        /// <returns> the present value </returns>
        public virtual MultiCurrencyAmount presentValue(ResolvedIborCapFloor capFloor, RatesProvider ratesProvider, IborCapletFloorletVolatilities volatilities)
        {
            CurrencyAmount pvCapFloorLeg = capFloorLegPricer.presentValue(capFloor.CapFloorLeg, ratesProvider, volatilities);

            if (!capFloor.PayLeg.Present)
            {
                return(MultiCurrencyAmount.of(pvCapFloorLeg));
            }
            CurrencyAmount pvPayLeg = payLegPricer.presentValue(capFloor.PayLeg.get(), ratesProvider);

            return(MultiCurrencyAmount.of(pvCapFloorLeg).plus(pvPayLeg));
        }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates the present value volatility sensitivity of the Ibor cap/floor product.
 /// <para>
 /// The sensitivity of the present value to the SABR model parameters, alpha, beta, rho and nu.
 ///
 /// </para>
 /// </summary>
 /// <param name="capFloor">  the Ibor cap/floor product </param>
 /// <param name="ratesProvider">  the rates provider </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual PointSensitivityBuilder presentValueSensitivityModelParamsSabr(ResolvedIborCapFloor capFloor, RatesProvider ratesProvider, SabrIborCapletFloorletVolatilities volatilities)
 {
     return(capFloorLegPricer.presentValueSensitivityModelParamsSabr(capFloor.CapFloorLeg, ratesProvider, volatilities));
 }
        //-------------------------------------------------------------------------
        /// <summary>
        /// Calculates the present value theta of the Ibor cap/floor product.
        /// <para>
        /// The present value of the product is the sensitivity value on the valuation date.
        /// </para>
        /// <para>
        /// The cap/floor leg and pay leg are typically in the same currency, thus the
        /// present value gamma is expressed as a single currency amount in most cases.
        ///
        /// </para>
        /// </summary>
        /// <param name="capFloor">  the Ibor cap/floor product </param>
        /// <param name="ratesProvider">  the rates provider </param>
        /// <param name="volatilities">  the volatilities </param>
        /// <returns> the present value theta </returns>
        public virtual MultiCurrencyAmount presentValueTheta(ResolvedIborCapFloor capFloor, RatesProvider ratesProvider, IborCapletFloorletVolatilities volatilities)
        {
            CurrencyAmount pvCapFloorLeg = capFloorLegPricer.presentValueTheta(capFloor.CapFloorLeg, ratesProvider, volatilities);

            return(MultiCurrencyAmount.of(pvCapFloorLeg));
        }