26 const std::vector<Time>& taus,
29 : numberOfRates_(taus.size()), numberOfFactors_(pseudo.columns()),
30 isFullFactor_(numberOfFactors_ == numberOfRates_), numeraire_(numeraire), alive_(alive),
31 oneOverTaus_(taus.size()), pseudo_(pseudo), tmp_(taus.size(), 0.0),
32 e_(pseudo_.columns(), pseudo_.rows(), 0.0), downs_(taus.size()), ups_(taus.size()) {
37 "pseudo.rows() not consistent with dim");
39 "pseudo.rows() not consistent with pseudo.columns()");
45 for (
Size i=0; i<taus.size(); ++i)
60 std::vector<Real>& drifts)
const {
65 std::vector<Real>& drifts)
const {
66 #if defined(QL_EXTRA_SAFETY_CHECKS)
78 std::vector<Real>& drifts)
const {
83 std::vector<Real>& drifts)
const {
95 drifts[i] = std::inner_product(
tmp_.begin()+
downs_[i],
99 drifts[i] = -drifts[i];
104 std::vector<Real>& drifts)
const {
109 std::vector<Real>& drifts)
const {
Curve state for Libor market models
const std::vector< Rate > & forwardRates() const override
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
LMMNormalDriftCalculator(const Matrix &pseudo, const std::vector< Time > &taus, Size numeraire, Size alive)
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 normal Libor market model.
Matrix transpose(const Matrix &m)
ext::shared_ptr< YieldTermStructure > r