Bug#266454: quantlib: FTBFS with gcc-3.4: 'this->' missing (6/7)
From
Andreas Jochens@1:229/2 to
All on Wed Aug 18 00:50:05 2004
[continued from previous message]
- arguments_.blackScholesProcess->riskFreeRate()->referenceDate(),
- arguments_.exercise->lastDate());
- return TimeGrid(t, Size(QL_MAX<Real>(t * maxTimeStepsPerYear_, 1.0))); + this->arguments_.blackScholesProcess->riskFreeRate()->referenceDate(),
+ this->arguments_.exercise->lastDate());
+ return TimeGrid(t, Size(QL_MAX<Real>(t * this->maxTimeStepsPerYear_, 1.0)));
}
template<class RNG, class S>
void MCDigitalEngine<RNG,S>::calculate() const {
- QL_REQUIRE(requiredTolerance_ != Null<Real>() ||
- requiredSamples_ != Null<Size>(),
+ QL_REQUIRE(this->requiredTolerance_ != Null<Real>() ||
+ this->requiredSamples_ != Null<Size>(),
"neither tolerance nor number of samples set");
//! Initialize the one-factor Monte Carlo
- if (controlVariate_) {
+ if (this->controlVariate_) {
boost::shared_ptr<path_pricer_type> controlPP =
- controlPathPricer();
+ this->controlPathPricer();
QL_REQUIRE(controlPP,
"engine does not provide "
"control variation path pricer");
boost::shared_ptr<PricingEngine> controlPE =
- controlPricingEngine();
+ this->controlPricingEngine();
QL_REQUIRE(controlPE,
"engine does not provide "
"control variation pricing engine");
} else {
- mcModel_ =
+ this->mcModel_ =
boost::shared_ptr<MonteCarloModel<SingleAsset<RNG>, S> >(
new MonteCarloModel<SingleAsset<RNG>, S>(
- pathGenerator(), pathPricer(), S(),
- antitheticVariate_));
+ this->pathGenerator(), this->pathPricer(), S(),
+ this->antitheticVariate_));
}
- if (requiredTolerance_ != Null<Real>()) {
- if (maxSamples_ != Null<Size>())
- value(requiredTolerance_, maxSamples_);
+ if (this->requiredTolerance_ != Null<Real>()) {
+ if (this->maxSamples_ != Null<Size>())
+ this->value(this->requiredTolerance_, this->maxSamples_);
else
- value(requiredTolerance_);
+ this->value(this->requiredTolerance_);
} else {
- valueWithSamples(requiredSamples_);
+ this->valueWithSamples(this->requiredSamples_);
}
- results_.value = mcModel_->sampleAccumulator().mean();
+ this->results_.value = this->mcModel_->sampleAccumulator().mean();
if (RNG::allowsErrorEstimate)
- results_.errorEstimate =
- mcModel_->sampleAccumulator().errorEstimate();
+ this->results_.errorEstimate =
+ this->mcModel_->sampleAccumulator().errorEstimate();
}
}
diff -urN ../tmp-orig/quantlib-0.3.7/ql/PricingEngines/Vanilla/mceuropeanengine.hpp ./ql/PricingEngines/Vanilla/mceuropeanengine.hpp
--- ../tmp-orig/quantlib-0.3.7/ql/PricingEngines/Vanilla/mceuropeanengine.hpp 2004-06-08 15:50:41.000000000 +0200
+++ ./ql/PricingEngines/Vanilla/mceuropeanengine.hpp 2004-08-18 00:05:09.944037209 +0200
@@ -113,16 +113,16 @@
MCEuropeanEngine<RNG,S>::pathPricer() const {
boost::shared_ptr<PlainVanillaPayoff> payoff =
- boost::dynamic_pointer_cast<PlainVanillaPayoff>(arguments_.payoff);
+ boost::dynamic_pointer_cast<PlainVanillaPayoff>(this->arguments_.payoff);
QL_REQUIRE(payoff, "non-plain payoff given");
- return boost::shared_ptr<MCEuropeanEngine<RNG,S>::path_pricer_type>(
+ return boost::shared_ptr<typename MCEuropeanEngine<RNG,S>::path_pricer_type>(
new EuropeanPathPricer(
payoff->optionType(),
- arguments_.blackScholesProcess->stateVariable()->value(),
+ this->arguments_.blackScholesProcess->stateVariable()->value(),
payoff->strike(),
R