Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/MarketModelPathwiseDiscounter-getFactors-does-not-resize-factors-vector-tp9362p9365.html
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
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev