Constructor.
Constructor Set Vavilov parameters kappa and beta2 and define whether to calculate density fcn or distribution fcn
47 const float xp[9] = { 9.29,2.47,.89,.36,.15,.07,.03,.02,0.0 };
48 const float xq[7] = { .012,.03,.08,.26,.87,3.83,11.0 };
50 float q, u,
x,
c1, c2, c3, c4, d1, h4, h5, h6,
q2, x1, d, ll, ul, xf1, xf2, rv;
55 if(kappa < 0.01
f) kappa = 0.01f;
56 if(kappa > 10.
f) kappa = 10.f;
57 if(beta2 < 0.
f) beta2 = 0.f;
58 if(beta2 > 1.
f) beta2 = 1.f;
60 float invKappa = 1.f/kappa;
61 h_[4] = 1.f - beta2*0.42278433999999998f + (7.6f*invKappa);
64 h4 = - (7.6f*invKappa) - (beta2 * .57721566
f + 1.
f);
65 h5 = vdt::fast_logf(kappa);
67 t0_ = (h4 - h_[4]*h5 - (h_[4] + beta2)*(vdt::fast_logf(h_[4]) +
VVIObjFDetails::expint(h_[4])) + vdt::fast_expf(-h_[4]))/h_[4];
71 for (lp = 0; lp < 9; ++lp) {
72 if (kappa >= xp[lp])
break;
74 ll = -float(lp) - 1.5f;
75 for (lq = 0; lq < 7; ++lq) {
76 if (kappa <= xq[lq])
break;
85 h_[0] = kappa * (beta2 * .57721566f + 2.f) + 9.9166128600000008
f;
86 if (kappa >= .07) {h_[0] += 6.90775527f;}
87 h_[1] = beta2 * kappa;
89 h_[3] = omega_ * 1.5707963250000001f;
90 auto f1 = [h_](
float x){
return h_[0]+h_[1]*vdt::fast_logf(h_[2]*x)-h_[3]*
x;};
93 d = vdt::fast_expf(kappa * (beta2 * (.57721566
f - h5) + 1.
f)) * .31830988654751274f;
96 a_[n - 1] = omega_ * .31830988654751274f;
100 for (k = 1; k <
n; ++
k) {
105 c1 = vdt::fast_logf(x) -
c1;
106 vdt::fast_sincosf(x1,c3,c4);
107 xf1 = kappa * (beta2 * c1 - c4) - x * c2;
108 xf2 = x * c1 + kappa * (c3 + beta2 * c2) + t0_ * x;
109 float s,
c; vdt::fast_sincosf(xf2,s,c);
111 d1 = q * d * omega_ * vdt::fast_expf(xf1);
115 d1 = q * d * vdt::fast_expf(xf1)/
k;
118 a_[n - 1] += q2 *
a_[l - 1];
const int mode_
returns the limits on the non-zero (mode=0) or normalized region (mode=1)
void sincosint(float x, float &sint, float &cint)
int dzero(float a, float b, float &x0, float &rv, float eps, int mxf, F func)
Private version of the exponential integral.
float expint(float x)
Private version of the cosine and sine integral.