22 "CJacobiEllipticFunctions::ellipKKp(): \
23 Parameter L should be non-negative\n");
24 #if defined HAVE_ARPREC && defined USE_GPL_SHOGUN
25 const Real eps=Real(std::numeric_limits<float64_t>::epsilon());
26 const Real pi=mp_real::_pi;
28 const Real eps=std::numeric_limits<Real>::epsilon();
30 #endif //(HAVE_ARPREC && USE_GPL_SHOGUN)
38 Real m=exp(-2.0*pi*L);
42 K=compute_quarter_period(sqrt(mp));
48 Kp=compute_quarter_period(sqrt(m));
52 K=compute_quarter_period(sqrt(mp));
53 Kp=compute_quarter_period(sqrt(m));
59 ::ellipJC(Complex u, Real m, Complex &sn, Complex &cn, Complex &dn)
62 "CJacobiEllipticFunctions::ellipJC(): \
63 Parameter m should be >=0 and <=1\n");
65 #if defined HAVE_ARPREC && defined USE_GPL_SHOGUN
66 const Real eps=sqrt(mp_real::_eps);
68 const Real eps=sqrt(std::numeric_limits<Real>::epsilon());
69 #endif //(HAVE_ARPREC && USE_GPL_SHOGUN)
72 #if defined HAVE_ARPREC && defined USE_GPL_SHOGUN
82 sn=mp_complex(_sn.real(),_sn.imag());
83 cn=mp_complex(_cn.real(),_cn.imag());
84 dn=mp_complex(_dn.real(),_dn.imag());
88 Complex ai=0.25*(1.0-m);
90 sn=t+ai*(twon-u)/(b*b);
91 Complex phi=Real(1.0)/b;
95 #endif //(HAVE_ARPREC && USE_GPL_SHOGUN)
99 const Real prec=4.0*eps;
102 Real kappa[MAX_ITER];
104 while (i<MAX_ITER && m>prec)
118 Complex sin_u=sin(u);
119 Complex cos_u=cos(u);
120 Complex t=Real(0.25*m)*(u-sin_u*cos_u);
123 dn=Real(1.0)+Real(0.5*m)*(cos_u*cos_u);
129 Complex ksn2=k*(sn*sn);
130 Complex d=Real(1.0)+ksn2;
133 dn=(Real(1.0)-ksn2)/d;
std::complex< float64_t > complex128_t
static float64_t cosh(float64_t x)
acos(x), x being a complex128_t not implemented
static void ellipKKp(Real L, Real &K, Real &Kp)
static void ellipJC(Complex u, Real m, Complex &sn, Complex &cn, Complex &dn)
#define M_PI
workaround for log2 being a define on cygwin
static float64_t sinh(float64_t x)
asin(x), x being a complex128_t not implemented
all of classes and functions are contained in the shogun namespace
static float64_t tanh(float64_t x)
atan2(x), x being a complex128_t not implemented
Matrix::Scalar max(Matrix m)