34 class MatrixVectorProductFct {
36 explicit MatrixVectorProductFct(Matrix m) :
m_(
std::move(m)) {}
39 std::vector<Real> operator()(
Real t,
const std::vector<Real>&
y) {
41 std::vector<Real> result(
m_.rows());
42 for (
Size i=0; i < result.size(); i++) {
43 result[i] = std::inner_product(
y.begin(),
y.end(),
44 m_.row_begin(i),
Real(0.0));
61 for (
Size i=0; i <
n; ++i) {
62 std::vector<Real> x0(
n, 0.0);
65 const std::vector<Real>
r = rk(odeFct, x0, 0.0,
t);
Runge-Kutta ODE integration.
ext::function< std::vector< T >(const Real, const std::vector< T > &)> OdeFct
Matrix used in linear algebra.
const_column_iterator column_begin(Size i) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
Matrix Expm(const Matrix &M, Real t, Real tol)
matrix exponential based on the ordinary differential equations method
ext::shared_ptr< YieldTermStructure > r