Пример #1
0
        // Coupon interface
        public override double rate()
        {
            Utils.QL_REQUIRE(underlying_.pricer() != null, () => "pricer not set");

            double swapletRate  = underlying_.rate();
            double floorletRate = 0.0;

            if (isFloored_)
            {
                floorletRate = underlying_.pricer().floorletRate(effectiveFloor().Value);
            }
            double capletRate = 0.0;

            if (isCapped_)
            {
                capletRate = underlying_.pricer().capletRate(effectiveCap().Value);
            }
            return(swapletRate + floorletRate - capletRate);
        }
        //! \name Coupon interface
        //@{
        public override double rate()
        {
            if (underlying_.pricer() == null)
            {
                throw new ApplicationException("pricer not set");
            }

            double swapletRate  = underlying_.rate();
            double floorletRate = 0.0;

            if (isFloored_)
            {
                floorletRate = underlying_.pricer().floorletRate(effectiveFloor().Value);
            }
            double capletRate = 0.0;

            if (isCapped_)
            {
                capletRate = underlying_.pricer().capletRate(effectiveCap().Value);
            }
            return(swapletRate + floorletRate - capletRate);
        }