28 : TermStructure(referenceDate, cal, dc) {}
31 : TermStructure(settlementDays, cal, dc) {}
39 "Correlation returned from CorrelationTermStructure must be between -1 and 1 (" <<
correlation <<
")");
45 return correlation(timeFromReference(d), strike, extrapolate);
55 "time (" << t <<
") is before min curve time (" <<
minTime() <<
")");
58 TermStructure::checkRange(t, extrapolate);
67 return -
c_->correlation(t, strike);
71 : correlation_(correlation), t_(t), strike_(strike) {
76 QL_REQUIRE(!
correlation_.empty(),
"no source correlation term structure given");
Correlation term structure.
virtual Time minTime() const
The minimum time for which the curve can return values.
virtual Real correlationImpl(Time t, Real strike) const =0
Correlation calculation.
Real correlation(Time t, Real strike=Null< Real >(), bool extrapolate=false) const
virtual void checkRange(Time t, Real strike, bool extrapolate) const
Extra time range check for minimum time, then calls TermStructure::checkRange.
CorrelationTermStructure(const DayCounter &dc=DayCounter())
Real value() const override
Handle< CorrelationTermStructure > correlation_
CorrelationValue(const Handle< CorrelationTermStructure > &correlation, const Time t, const Real strike=Null< Real >())
bool isValid() const override
virtual Real correlationImpl(Time t, Real strike) const override
Correlation calculation.
NegativeCorrelationTermStructure(const Handle< CorrelationTermStructure > &c)
Handle< CorrelationTermStructure > c_
Term structure of correlations.
Filter close_enough(const RandomVariable &x, const RandomVariable &y)