• Bug#266454: quantlib: FTBFS with gcc-3.4: 'this->' missing (3/7)

    From Andreas Jochens@1:229/2 to All on Wed Aug 18 00:50:05 2004
    [continued from previous message]

    +++ ./ql/PricingEngines/Barrier/mcbarrierengine.hpp 2004-08-17 21:56:04.049592153 +0200
    @@ -174,7 +174,7 @@

    // do this with template parameters?
    if (isBiased_) {
    - return boost::shared_ptr<MCBarrierEngine<RNG,S>::path_pricer_type>(
    + return boost::shared_ptr<typename MCBarrierEngine<RNG,S>::path_pricer_type>(
    new BiasedBarrierPathPricer(
    arguments_.barrierType,
    arguments_.barrier,
    @@ -192,7 +192,7 @@
    RelinkableHandle<TermStructure> dividend(process->dividendYield());
    RelinkableHandle<BlackVolTermStructure> volatility(
    process->blackVolatility()); - return boost::shared_ptr<MCBarrierEngine<RNG,S>::path_pricer_type>(
    + return boost::shared_ptr<typename MCBarrierEngine<RNG,S>::path_pricer_type>(
    new BarrierPathPricer(
    arguments_.barrierType,
    arguments_.barrier,
    @@ -231,16 +231,16 @@
    "not an European Option");

    //! 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 "
    @@ -257,34 +257,34 @@
    controlPE->results());
    Real controlVariateValue = controlResults->value;

    - mcModel_ =
    + this->mcModel_ =
    boost::shared_ptr<MonteCarloModel<SingleAsset<RNG>, S> >(
    new MonteCarloModel<SingleAsset<RNG>, S>(
    pathGenerator(), pathPricer(), stats_type(),
    - antitheticVariate_, controlPP,
    + this->antitheticVariate_, controlPP,
    controlVariateValue));
    */
    } else {
    - mcModel_ =
    + this->mcModel_ =
    boost::shared_ptr<MonteCarloModel<SingleAsset<RNG>, S> >(
    new MonteCarloModel<SingleAsset<RNG>, S>(
    pathGenerator(), pathPricer(), S(),
    - antitheticVariate_));
    + this->antitheticVariate_));
    }

    if (requiredTolerance_ != Null<Real>()) {
    if (maxSamples_ != Null<Size>())
    - value(requiredTolerance_, maxSamples_);
    + this->value(requiredTolerance_, maxSamples_);
    else
    - value(requiredTolerance_);
    + this->value(requiredTolerance_);
    } else {
    - valueWithSamples(requiredSamples_);
    + this->valueWithSamples(requiredSamples_);
    }

    - results_.value = mcModel_->sampleAccumulator().mean();
    + results_.value = this->mcModel_->sampleAccumulator().mean();
    if (RNG::allowsErrorEstimate)
    results_.errorEstimate =
    - mcModel_->sampleAccumulator().errorEstimate();
    + this->mcModel_->sampleAccumulator().errorEstimate();
    }

    }
    diff -urN ../tmp-orig/quantlib-0.3.7/ql/PricingEngines/Basket/mcbasketengine.hpp ./ql/PricingEngines/Basket/mcbasketengine.hpp
    --- ../tmp-orig/quantlib-0.3.7/ql/PricingEngines/Basket/mcbasketengine.hpp 2004-05-13 18:30:08.000000000 +0200
    +++ ./ql/PricingEngines/Basket/mcbasketengine.hpp 2004-08-17 23:27:30.835473913 +0200
    @@ -144,7 +144,7 @@
    ->stateVariable()->value();
    }

    - return boost::shared_ptr<MCBasketEngine<RNG,S>::path_pricer_type>(new + return boost::shared_ptr<typename MCBasketEngine<RNG,S>::path_pricer_type>(new
    EuropeanMultiPathPricer(
    arguments_.basketType,
    payoff->optionType(),
    @@ -179,16 +179,16 @@
    "not an European Option");
    */
    //! Initialize the multi-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 "