Generate the sum of two densities. More...
#include <RandomHelpers.h>
Public Member Functions | |
Generator (const Generator< Density1 > &firstGen, const Generator< Density2 > &secondGen) | |
Construct from generators. | |
const Generator< Density1 > & | firstGenerator () const |
Return the first generator. | |
const Generator< Density2 > & | secondGenerator () const |
Return the second generator. | |
double | lower () const |
Return the lower bound of the density generated. | |
double | upper () const |
Return the upper bound of the density generated. | |
double | fraction () const |
Return the fraction of the unit interval considered for the first generator. | |
double | value (double x) const |
Return the density's value. | |
double | normalization () const |
Return the density's normalization. | |
double | operator() (double r) const |
Generate the return value according to the implemented density, given a flat random number on the unit interval. | |
Private Attributes | |
Generator< Density1 > | theFirstGenerator |
The first generator. | |
Generator< Density2 > | theSecondGenerator |
The second generator. | |
double | theLower |
The lower boundary. | |
double | theUpper |
The upper boundary. | |
double | theFraction |
The fraction of the unit interval considered for the first generator. | |
Generate the sum of two densities.
Definition at line 428 of file RandomHelpers.h.