25#ifndef quantlib_inversecumulative_rsg_h
26#define quantlib_inversecumulative_rsg_h
56 template <
class USG,
class IC>
73 template <
class USG,
class IC>
75 : uniformSequenceGenerator_(
std::move(usg)), dimension_(uniformSequenceGenerator_.dimension()),
78 template <
class USG,
class IC>
80 : uniformSequenceGenerator_(
std::move(usg)), dimension_(uniformSequenceGenerator_.dimension()),
81 x_(
std::vector<
Real>(dimension_), 1.0), ICD_(inverseCum) {}
83 template <
class USG,
class IC>
86 typename USG::sample_type sample =
87 uniformSequenceGenerator_.nextSequence();
88 x_.weight = sample.weight;
89 for (
Size i = 0; i < dimension_; i++) {
90 x_.value[i] = ICD_(sample.value[i]);
Inverse cumulative random sequence generator.
InverseCumulativeRsg(USG uniformSequenceGenerator, const IC &inverseCumulative)
USG uniformSequenceGenerator_
InverseCumulativeRsg(USG uniformSequenceGenerator)
const sample_type & lastSequence() const
const sample_type & nextSequence() const
returns next sample from the inverse cumulative distribution
Sample< std::vector< Real > > sample_type
std::size_t Size
size of a container