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.

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::LazyObject::calculate(), 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::Forward::forwardValue(), QuantLib::Swaption::impliedVolatility(), QuantLib::CapFloor::impliedVolatility(), QuantLib::CallableBond::impliedVolatility(), QuantLib::Instrument::NPV(), QuantLib::SyntheticCDO::remainingNotional(), QuantLib::Instrument::result(), QuantLib::Bond::settlementValue(), and QuantLib::Instrument::valuationDate().

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

Generated by  Doxygen 1.6.0   Back to index