28 const std::vector<Spread>& displacements,
29 const std::vector<Time>& taus,
32 : numberOfRates_(taus.size()), numberOfFactors_(pseudo.columns()),
33 numeraire_(numeraire), alive_(alive),
34 displacements_(displacements), oneOverTaus_(taus.size()),
36 tmp_(taus.size(), 0.0),
38 wkaj_(pseudo_.columns(), pseudo_.rows(), 0.0),
39 wkpj_(pseudo_.columns(), pseudo_.rows()+1, 0.0),
40 wkajshifted_(pseudo_.columns(), pseudo_.rows(), 0.0)
47 "Displacements out of range");
49 "pseudo.rows() not consistent with dim");
51 "pseudo.rows() not consistent with pseudo.columns()");
57 for (
Size i=0; i<taus.size(); ++i)
72 std::vector<Real>& drifts)
const {
73 #if defined(QL_EXTRA_SAFETY_CHECKS)
75 "drifts.size() <> numberOfRates");
85 const std::vector<Time>& taus=cs.
rateTaus();
98 Real annuity = annuities[j+1];
99 wkpj_[k][j+1]= SR[j+1] *
Curve state for coterminal-swap market models
Real discountRatio(Size i, Size j) const override
Rate coterminalSwapAnnuity(Size numeraire, Size i) const override
const std::vector< Rate > & coterminalSwapRates() const override
Size numberOfRates() const
const std::vector< Time > & rateTaus() const
Matrix used in linear algebra.
std::vector< Spread > displacements_
SMMDriftCalculator(const Matrix &pseudo, const std::vector< Spread > &displacements, const std::vector< Time > &taus, Size numeraire, Size alive)
std::vector< Real > oneOverTaus_
void compute(const CoterminalSwapCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
QL_INTEGER Integer
integer number
std::size_t Size
size of a container
Matrix transpose(const Matrix &m)
Drift computation for coterminal-swap market model.