18 std::vector<double>
a,
y,
z, xnew;
29 for (
int i = 1;
i <
n; ++
i)
33 for (
int it = 0; it <
iter; ++it) {
35 for (
int i = 0;
i <
n; ++
i)
39 for (
int i = 0;
i <
m; ++
i)
44 for (
int i = 1;
i <
n; ++
i)
45 y[
i] =
y[
i - 1] +
a[
i - 1];
50 for (
int i = 1;
i <
n; ++
i)
58 for (
int i = 1;
i <
m; ++
i) {
59 while (
y[
k + 1] <
z[
i])
61 double r = (
z[
i] -
y[
k]) / (
y[
k + 1] -
y[
k]);
65 for (
int i = 0;
i <
n; ++
i)
78 double s =
r - (double)
i;
93 double u = (umax - umin) * random->
flatShoot() + umin;
108 double u = (umax - umin) * random->
flatShoot() + umin;
114 if (x1 < xmin || x2 >
xmax)
123 for (; ibin < (unsigned)n && x1 >
sampling[ibin]; ++ibin)
125 unsigned ibin1 = ibin;
126 for (; ibin < (unsigned)n && x2 >
sampling[ibin]; ++ibin)
128 unsigned ibin2 = ibin;
double generateLin(RandomEngineAndDistribution const *) const
BaseNumericalRandomGenerator(double xmin=0., double xmax=1., int n=1000, int iter=6)
void initialize()
The initialization (numerical integarion, inversion)
std::vector< double > sampling
double generateExp(RandomEngineAndDistribution const *) const
double flatShoot(double xmin=0.0, double xmax=1.0) const
bool setSubInterval(double x1, double x2)
To shoot in a given interval.
double generate(RandomEngineAndDistribution const *) const
The random generation according to function()