|
From: Luigi B. <lui...@gm...> - 2010-12-24 10:01:38
|
On Tue, 2010-12-21 at 08:37 +0100, Andreas Spengler wrote: > 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_). Andreas, I'm not sure, but I think it was a common theme of the market-model implementation that vectors should be initialized at the correct size by the calling code before being passed to methods (efficiency reasons and such.) Adding a resize() shouldn't cost much, but I'd leave the decision to Mark Joshi as he's the main developer of that part of the library (Mark, are you reading this? Any thoughts?) Luigi -- When all else fails, pour a pint of Guinness in the gas tank, advance the spark 20 degrees, cry "God Save the Queen!", and pull the starter knob. -- MG "Series MGA" Workshop Manual |