|
From: Andrea <mar...@go...> - 2009-08-30 17:37:00
|
This code in the constructor of AmericanBasketPathPricer in
ql/pricingengines/basket/mcamericanbasketengine.cpp
is a little misleading.
const boost::shared_ptr<BasketPayoff> basketPayoff
= boost::dynamic_pointer_cast<BasketPayoff>(payoff_);
QL_REQUIRE(basketPayoff, "payoff not a basket payoff");
const boost::shared_ptr<StrikedTypePayoff> strikePayoff
= boost::dynamic_pointer_cast<StrikedTypePayoff>(basketPayoff->basePayoff());
QL_REQUIRE(basketPayoff, "payoff not a basket strike payoff");
^^^^^^^^^^^^
///////////// we have already checked that basketPayoff is non null a few lines above
///////////// should it be strikePayoff????
if (strikePayoff) {
^^^^^^^^^^^^
///////////// and in that case, why is there an if?
scalingValue_/=strikePayoff->strike();
}
Cheers
|