25#ifndef quantlib_farlie_gumbel_morgenstern_copula_rng_hpp
26#define quantlib_farlie_gumbel_morgenstern_copula_rng_hpp
50 const RNG& ug,
Real th)
51 : uniformGenerator_(ug),
theta_(th) {
53 "theta (" << th <<
") must be in [-1,1]");
59 typename RNG::sample_type v1 = uniformGenerator_.next();
60 typename RNG::sample_type v2 = uniformGenerator_.next();
64 Real u2 = (2.0*v2.value)/(sqrt(
b)-a);
Farlie-Gumbel-Morgenstern copula random-number generator.
FarlieGumbelMorgensternCopulaRng(const RNG &uniformGenerator, Real theta)
Sample< std::vector< Real > > sample_type
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b