39 std::random_device
rd;
40 std::mt19937
gen(
rd());
41 std::uniform_int_distribution<uint64_t> dis(0, std::numeric_limits<uint64_t>::max());
63 int64_t
rotl(
const uint64_t
x,
int k)
65 return (x << k) | (x >> (64 -
k));
70 const uint64_t s0 =
s[0];
72 const uint64_t result = s0 + s1;
74 s[0] =
rotl(s0, 55) ^ s1 ^ (s1 << 14);
86 U
u = {UINT64_C(0x3FF) << 52 | x >> 12};
110 std::function<double(double, double)>
mFunc;
129 double n = std::max(0.1, 2.856 - 0.655 * log(p));
130 return 1600 * pow(p, 0.279) * pow(cos(theta), n);
134 void SetParameters(
double minP,
double maxP,
double minTheta,
double maxTheta)
136 mRanges.push_back({minP, maxP});
137 mRanges.push_back({minTheta, maxTheta});
143 mRanges.push_back({minP, maxP});
144 mRanges.push_back({minTheta, maxTheta});
146 mRanges.push_back({0, M_PI / 2.});
158 return mFunc(p, theta) * cos(theta) * sin(theta);
164 return mFunc(p, theta) * pow(sin(theta), 2);
170 return mFunc(p, theta) * (sin(theta0) * sin(theta) * cos(phi) + cos(theta0) * cos(theta)) * sin(theta);
186 return HSFunc(v[0], v[1], v[2], v[3]);
214 for (
size_t j = 0;
j <
dim; ++
j)
231 double r1,
r2,
A,
C,
b, l, rw,
p, D_tmp, D_best,
distance;
232 std::vector<double>
tmp;
276 for (
size_t iter = 1; iter <
mNIter; ++iter)
340 std::function<double(double, double)>
mJ;
381 mMaxJ = {-1., -1., -1.};
638 return 1. - 8.534790171171021 / pow(x + 2.68, 87. / 40.);
643 return (2.68 - 2.68 * pow(1. - x, 40. / 87.)) / pow(1. - x, 40. / 87.);
648 return 1600 * pow(
mMaximumMomentum, 0.279) * pow(cos(0.76158), 1.1) * sin(0.76158);
653 return 1600 * pow(
mMaximumMomentum, 0.279) * pow(cos(1.35081), 0.1) * pow(sin(1.35081), 2);
658 return 1600 * pow(
mMaximumMomentum, 0.279) * pow(cos(1.26452), 0.1) * (sin(1.26452) * sin(1.26452) + cos(1.26452) * cos(1.26452)) * sin(1.26452);
731 if (
mN < 0.1)
mN = 0.1;
784 if (
mN < 0.1)
mN = 0.1;