Logo Search packages:      
Sourcecode: quantlib version File versions

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

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

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 138 of file instrument.hpp.

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

Referenced by QuantLib::Bond::dirtyPrice(), QuantLib::Instrument::errorEstimate(), QuantLib::ForwardRateAgreement::forwardRate(), QuantLib::Forward::forwardValue(), QuantLib::Swaption::impliedVolatility(), QuantLib::OneAssetOption::impliedVolatility(), QuantLib::CapFloor::impliedVolatility(), QuantLib::Instrument::NPV(), QuantLib::Instrument::result(), and QuantLib::ForwardRateAgreement::spotValue().

        if (isExpired()) {
            calculated_ = true;
        } else {

Generated by  Doxygen 1.6.0   Back to index