31 : ranf_arr_buf(QUALITY), ran_u(QUALITY) {
38 std::vector<double> u(
KK+
KK-1),ul(
KK+
KK-1);
39 double ulp=(1.0/(1L<<30))/(1L<<22);
40 double ss=2.0*ulp*((seed&0x3fffffff)+2);
44 ss+=ss;
if (ss>=1.0) ss-=1.0-2*ulp;
46 for (;j<
KK+
KK-1;j++) u[j]=ul[j]=0.0;
51 for (j=
KK-1;j>0;--j) ul[j+j]=ul[j],u[j+j]=u[j];
53 ul[
KK+
KK-1-j]=0.0,u[
KK+
KK-1-j]=u[j]-ul[j];
56 ul[j - (
KK -
LL)] = ulp - ul[j - (
KK -
LL)],
61 for (j=
KK;j>0;--j) ul[j]=ul[j-1],u[j]=u[j-1];
62 ul[0]=ul[
KK],u[0]=u[
KK];
78 for (j=0;j<
KK;j++) aa[j]=
ran_u[j];
static SeedGenerator & instance()
access to the unique instance