30 const std::vector<Spread>& displacements,
31 const std::vector<Time>& taus,
34 : numberOfRates_(taus.size()), numberOfFactors_(pseudo.columns()),
35 isFullFactor_(numberOfFactors_ == numberOfRates_), numeraire_(numeraire), alive_(alive),
36 displacements_(displacements), oneOverTaus_(taus.size()), pseudo_(pseudo),
37 tmp_(taus.size(), 0.0), e_(pseudo_.columns(), pseudo_.rows(), 0.0), downs_(taus.size()),
43 "Displacements out of range");
45 "pseudo.rows() not consistent with dim");
47 "pseudo.rows() not consistent with pseudo.columns()");
53 for (
Size i=0; i<taus.size(); ++i)
68 std::vector<Real>& drifts)
const {
73 std::vector<Real>& drifts)
const {
74 #if defined(QL_EXTRA_SAFETY_CHECKS)
86 std::vector<Real>& drifts)
const {
91 std::vector<Real>& drifts)
const {
104 drifts[i] = std::inner_product(
tmp_.begin()+
downs_[i],
108 drifts[i] = -drifts[i];
113 std::vector<Real>& drifts)
const {
118 std::vector<Real>& drifts)
const {
Curve state for Libor market models
const std::vector< Rate > & forwardRates() const override
std::vector< Spread > displacements_
LMMDriftCalculator(const Matrix &pseudo, const std::vector< Spread > &displacements, const std::vector< Time > &taus, Size numeraire, Size alive)
void computePlain(const LMMCurveState &cs, std::vector< Real > &drifts) const
void compute(const LMMCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
std::vector< Real > oneOverTaus_
void computeReduced(const LMMCurveState &cs, std::vector< Real > &drifts) const
std::vector< Size > downs_
Matrix used in linear algebra.
const_row_iterator row_begin(Size i) const
#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
Drift computation for Libor market model.
Matrix transpose(const Matrix &m)
ext::shared_ptr< YieldTermStructure > r