Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

void QuantLib::Instrument::calculate (  ) const [inline, protected, virtual, inherited]

This method performs all needed calculations by calling the performCalculations method.

Warning:
Objects cache the results of the previous calculation. Such results will be returned upon later invocations of calculate. When the results depend on arguments which could change between invocations, the lazy object must register itself as observer of such objects for the calculations to be performed again when they change.
Should this method be redefined in derived classes, LazyObject::calculate() should be called in the overriding method.

Reimplemented from QuantLib::LazyObject.

Definition at line 148 of file instrument.hpp.

References QuantLib::Instrument::isExpired(), and QuantLib::Instrument::setupExpired().

Referenced by QuantLib::CreditDefaultSwap::couponLegBPS(), QuantLib::Instrument::errorEstimate(), QuantLib::SyntheticCDO::expectedTrancheLoss(), QuantLib::CreditDefaultSwap::fairSpread(), QuantLib::CreditDefaultSwap::fairUpfront(), QuantLib::ForwardRateAgreement::forwardRate(), QuantLib::Forward::forwardValue(), QuantLib::BarrierOption::impliedVolatility(), QuantLib::CallableBond::impliedVolatility(), QuantLib::Instrument::NPV(), QuantLib::SyntheticCDO::remainingNotional(), QuantLib::Instrument::result(), QuantLib::Bond::settlementValue(), QuantLib::ForwardRateAgreement::spotValue(), and QuantLib::Instrument::valuationDate().

                                            {
        if (isExpired()) {
            setupExpired();
            calculated_ = true;
        } else {
            LazyObject::calculate();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index