|
From: Andreas S. <an...@sp...> - 2010-12-21 07:37:54
|
Hi,
in trying to use QLs MarketModel classes for implementing a Target
Redemption Note, I found that MarketModelPathwiseDiscounter::getFactors()
does not resize the "factors" parameter properly before writing into it,
thereby overwriting members of the calling object in my environment (i.e.
PathwiseAccountingEngine::numberCashFlowsThisIndex_).
With the following change, the error is avoided:
*** pathwisediscounter.cpp 2010-12-21 08:28:38.000000000 +0100
--- pathwisediscounter.cpp.orig 2010-12-21 08:30:11.000000000 +0100
***************
*** 59,66 ****
Real preDF = Discounts[currentStep][before_];
Real postDF = Discounts[currentStep][before_+1];
- factors.resize(numberRates_ + 1);
-
for (Size i=before_+1; i<numberRates_; ++i)
factors[i+1] =0.0;
--- 59,64 ----
Rgds,
Andreas
|