25 class LfmCovarianceParameterization::Var_Helper {
27 Var_Helper(
const LfmCovarianceParameterization* param,
Size i,
Size j);
32 const LfmCovarianceParameterization* param_;
35 LfmCovarianceParameterization::Var_Helper::Var_Helper(
36 const LfmCovarianceParameterization* param,
38 : i_(i), j_(j), param_(param) {}
40 Real LfmCovarianceParameterization::Var_Helper::operator()(Real
t)
const {
41 const Matrix m = param_->diffusion(
t);
43 return std::inner_product(m.row_begin(i_), m.row_end(i_),
44 m.row_begin(j_),
Real(0.0));
53 Matrix LfmCovarianceParameterization::integratedCovariance(
Time t,
const Array& x)
const {
63 for (
Size j=0; j<=i;++j) {
64 Var_Helper helper(
this, i, j);
66 for (
Size k=0; k < 64; ++k) {
67 tmp[i][j]+=integrator(helper, k*
t/64.,(k+1)*
t/64.);
1-D array used in linear algebra.
bool empty() const
whether the array is empty
Integral of a 1-dimensional function using the Gauss-Kronrod methods.
Matrix used in linear algebra.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Integral of a 1-dimensional function using the Gauss-Kronrod method.
volatility & correlation function for libor forward model process
Matrix transpose(const Matrix &m)