9 double xmin,
double xmax,
int n,
int iter ) :
11 xmin(xmin), xmax(xmax), n(n), iter(iter)
24 std::vector<double>
a,
y,
z,xnew;
35 for (
int i=1;
i<
n; ++
i)
39 for (
int it=0; it<
iter; ++it) {
42 for (
int i=0;
i<
n; ++
i )
46 for (
int i=0; i<
m; ++
i )
51 for (
int i=1; i<
n; ++
i )
52 y[i] = y[i-1] + a[i-1];
55 double dz = y[n-1]/(float)m;
57 for (
int i=1; i<
n; ++
i )
65 for (
int i=1; i<
m; ++
i ) {
66 while ( y[k+1] < z[i] ) ++
k;
67 double r = (z[
i]-y[
k]) / (y[k+1]-y[k]);
71 for (
int i=0; i<
n; ++
i )
122 double umin = a*sampling[
i]*sampling[
i]/2. + b*sampling[
i];
123 double umax = a*sampling[i+1]*sampling[i+1]/2. + b*sampling[i+1];
132 if(x1<xmin||x2>
xmax)
return false;
141 for(;ibin<(unsigned)n&&x1>
sampling[ibin];++ibin);
143 for(;ibin<(unsigned)n&&x2>sampling[ibin];++ibin);
149 rmin = ibin1+(x1-sampling[ibin1])/(sampling[ibin1]-sampling[ibin1-1]);
150 deltar= ibin2+(x2-sampling[ibin2])/(sampling[ibin2]-sampling[ibin2-1]) -
rmin;
Exp< T >::type exp(const T &t)
void initialize()
The initialization (numerical integarion, inversion)
const RandomEngine * random
double generateLin() const
double generate() const
The random generation according to function()
std::vector< double > sampling
double generateExp() const
BaseNumericalRandomGenerator(const RandomEngine *engine, double xmin=0., double xmax=1., int n=1000, int iter=6)
Log< T >::type log(const T &t)
double flatShoot(double xmin=0.0, double xmax=1.0) const
std::vector< std::vector< double > > tmp
bool setSubInterval(double x1, double x2)
To shoot in a given interval.