Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Re-QuantLib-svn-SF-net-SVN-quantlib-17128-trunk-QuantLib-ql-cashflows-cashflows-cpp-tp12515p12517.html
On Mon, 2010-02-22 at 20:05 +0100, Ferdinando Ametrano wrote:
> On Mon, Feb 22, 2010 at 9:36 AM, Luigi Ballabio
> <
[hidden email]> wrote:
> > Try using reverse iterators.
>
> following your suggestion I found out a bug in the previousAmount and
> previousRate functions, which was easily fixed switching to reverse
> iterator (please find the patch below).
>
> Unfortunately the fix is not backward compatible as it requires
> CashFlows::previousCashFlow and BondFunctions::previousCashFlow to
> return a Leg::const_reverse_iterator instead of Leg::const_iterator.
Well, it doesn't strictly require it---you could retrieve the iterator
from the reverse iterator. But I see that the common use case would be
to turn it into a reverse itereator again, so it makes more sense to
change the signature.
<sigh> Ok, I'm applying it. Commit the thing on the trunk asap.
Luigi
--
Do the right thing. It will gratify some people and astonish the rest.
-- Mark Twain
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev