Re: [QuantLib-svn] SF.net SVN: quantlib:[16775] trunk/QuantLib/ql/experimental/amortizingbonds /amortizingfixedratebond.cpp

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[16775] trunk/QuantLib/ql/experimental/amortizingbonds /amortizingfixedratebond.cpp

Ferdinando M. Ametrano-3
Hi Simon

does it make sense that sinkingRedemptions was not used (see my commit below) ?

ciao -- Nando

On Mon, Nov 23, 2009 at 5:18 PM,  <[hidden email]> wrote:

> Revision: 16775
>          http://quantlib.svn.sourceforge.net/quantlib/?rev=16775&view=rev
> Author:   nando
> Date:     2009-11-23 16:18:36 +0000 (Mon, 23 Nov 2009)
>
> Log Message:
> -----------
> in anonymous namespace
> - removed unreferenced formal parameter startDate
> - renamed function to start with lower capital letter
> - commented out unused function sinkingRedemptions
>
> Modified Paths:
> --------------
>    trunk/QuantLib/ql/experimental/amortizingbonds/amortizingfixedratebond.cpp
>
> Modified: trunk/QuantLib/ql/experimental/amortizingbonds/amortizingfixedratebond.cpp
> ===================================================================
> --- trunk/QuantLib/ql/experimental/amortizingbonds/amortizingfixedratebond.cpp  2009-11-23 14:10:27 UTC (rev 16774)
> +++ trunk/QuantLib/ql/experimental/amortizingbonds/amortizingfixedratebond.cpp  2009-11-23 16:18:36 UTC (rev 16775)
> @@ -104,7 +104,7 @@
>             return false;
>         }
>
> -        Schedule SinkingSchedule(const Date& startDate,
> +        Schedule sinkingSchedule(const Date& startDate,
>                                  const Period& maturityTenor,
>                                  const Frequency& sinkingFrequency,
>                                  const Calendar& paymentCalendar) {
> @@ -116,8 +116,7 @@
>             return retVal;
>         }
>
> -        std::vector<Real> SinkingNotionals(const Date& startDate,
> -                                           const Period& maturityTenor,
> +        std::vector<Real> sinkingNotionals(const Period& maturityTenor,
>                                            const Frequency& sinkingFrequency,
>                                            Rate couponRate,
>                                            Real initialNotional) {
> @@ -141,24 +140,23 @@
>             return notionals;
>         }
>
> -        std::vector<Real> SinkingRedemptions(const Date& startDate,
> -                                             const Period& maturityTenor,
> -                                             const Frequency& sinkingFrequency,
> -                                             Rate couponRate,
> -                                             Real initialNotional) {
> +        //std::vector<Real> sinkingRedemptions(const Period& maturityTenor,
> +        //                                     const Frequency& sinkingFrequency,
> +        //                                     Rate couponRate,
> +        //                                     Real initialNotional) {
>
> -            std::vector<Real> notionals =
> -                SinkingNotionals(startDate, maturityTenor, sinkingFrequency,
> -                                 couponRate, initialNotional);
> -            Size nPeriods = notionals.size()-1;
> -            std::vector<Real> redemptions(nPeriods);
> +        //    std::vector<Real> notionals =
> +        //        sinkingNotionals(maturityTenor, sinkingFrequency,
> +        //                         couponRate, initialNotional);
> +        //    Size nPeriods = notionals.size()-1;
> +        //    std::vector<Real> redemptions(nPeriods);
>
> -            for(Size i = 0; i < nPeriods; ++i) {
> -                redemptions[i] =
> -                    (notionals[i] - notionals[i+1]) / initialNotional * 100;
> -            }
> -            return redemptions;
> -        }
> +        //    for(Size i = 0; i < nPeriods; ++i) {
> +        //        redemptions[i] =
> +        //            (notionals[i] - notionals[i+1]) / initialNotional * 100;
> +        //    }
> +        //    return redemptions;
> +        //}
>
>     }
>
> @@ -181,9 +179,9 @@
>         maturityDate_ = startDate + bondTenor;
>
>         cashflows_ =
> -            FixedRateLeg(SinkingSchedule(startDate, bondTenor,
> +            FixedRateLeg(sinkingSchedule(startDate, bondTenor,
>                                          sinkingFrequency, calendar))
> -            .withNotionals(SinkingNotionals(startDate, bondTenor,
> +            .withNotionals(sinkingNotionals(bondTenor,
>                                             sinkingFrequency, coupon,
>                                             initialFaceAmount))
>             .withCouponRates(coupon, accrualDayCounter)
>
>
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> QuantLib-cvs mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-cvs
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev