00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <cmath>
00014
00015 #ifndef PI
00016 #define PI 3.14159265358979323846264338328
00017 #endif
00018
00019
00020 #include "gsl/gsl_sf_bessel.h"
00021 #include "gsl/gsl_sf_legendre.h"
00022 #include "gsl/gsl_sf_laguerre.h"
00023 #include "gsl/gsl_sf_hyperg.h"
00024 #include "gsl/gsl_sf_ellint.h"
00025
00026 #include "gsl/gsl_sf_expint.h"
00027 #include "gsl/gsl_sf_zeta.h"
00028 #include "gsl/gsl_sf_airy.h"
00029 #include "gsl/gsl_sf_coupling.h"
00030
00031
00032 namespace ROOT {
00033 namespace Math {
00034
00035
00036
00037
00038
00039
00040
00041 double assoc_laguerre(unsigned n, double m, double x) {
00042
00043 return gsl_sf_laguerre_n(n, m, x);
00044
00045 }
00046
00047
00048
00049
00050
00051
00052 double assoc_legendre(unsigned l, unsigned m, double x) {
00053
00054 return (m%2 == 0) ? gsl_sf_legendre_Plm(l, m, x) : -gsl_sf_legendre_Plm(l, m, x);
00055
00056 }
00057
00058
00059
00060
00061
00062
00063
00064
00065 double comp_ellint_1(double k) {
00066
00067 return gsl_sf_ellint_Kcomp(k, GSL_PREC_DOUBLE);
00068
00069 }
00070
00071
00072
00073
00074
00075
00076 double comp_ellint_2(double k) {
00077
00078 return gsl_sf_ellint_Ecomp(k, GSL_PREC_DOUBLE);
00079
00080 }
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 double comp_ellint_3(double n, double k) {
00124
00125 return gsl_sf_ellint_P(PI/2.0, k, -n, GSL_PREC_DOUBLE);
00126
00127 }
00128
00129
00130
00131
00132
00133
00134 double conf_hyperg(double a, double b, double z) {
00135
00136 return gsl_sf_hyperg_1F1(a, b, z);
00137
00138 }
00139
00140
00141
00142 double conf_hypergU(double a, double b, double z) {
00143
00144 return gsl_sf_hyperg_U(a, b, z);
00145
00146 }
00147
00148
00149
00150
00151
00152
00153 double cyl_bessel_i(double nu, double x) {
00154
00155 return gsl_sf_bessel_Inu(nu, x);
00156
00157 }
00158
00159
00160
00161
00162
00163
00164 double cyl_bessel_j(double nu, double x) {
00165
00166 return gsl_sf_bessel_Jnu(nu, x);
00167
00168 }
00169
00170
00171
00172
00173
00174
00175 double cyl_bessel_k(double nu, double x) {
00176
00177 return gsl_sf_bessel_Knu(nu, x);
00178
00179 }
00180
00181
00182
00183
00184
00185
00186
00187 double cyl_neumann(double nu, double x) {
00188
00189 return gsl_sf_bessel_Ynu(nu, x);
00190
00191 }
00192
00193
00194
00195
00196
00197
00198
00199 double ellint_1(double k, double phi) {
00200
00201 return gsl_sf_ellint_F(phi, k, GSL_PREC_DOUBLE);
00202
00203 }
00204
00205
00206
00207
00208
00209
00210
00211 double ellint_2(double k, double phi) {
00212
00213 return gsl_sf_ellint_E(phi, k, GSL_PREC_DOUBLE);
00214
00215 }
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259 double ellint_3(double n, double k, double phi) {
00260
00261 return gsl_sf_ellint_P(phi, k, -n, GSL_PREC_DOUBLE);
00262
00263 }
00264
00265
00266
00267
00268
00269
00270 double expint(double x) {
00271
00272 return gsl_sf_expint_Ei(x);
00273
00274 }
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 double hyperg(double a, double b, double c, double x) {
00291
00292 return gsl_sf_hyperg_2F1(a, b, c, x);
00293
00294 }
00295
00296
00297
00298
00299
00300
00301 double laguerre(unsigned n, double x) {
00302 return gsl_sf_laguerre_n(n, 0, x);
00303 }
00304
00305
00306
00307
00308
00309
00310
00311 double legendre(unsigned l, double x) {
00312
00313 return gsl_sf_legendre_Pl(l, x);
00314
00315 }
00316
00317
00318
00319
00320
00321
00322 double riemann_zeta(double x) {
00323
00324 return gsl_sf_zeta(x);
00325
00326 }
00327
00328
00329
00330
00331
00332
00333 double sph_bessel(unsigned n, double x) {
00334
00335 return gsl_sf_bessel_jl(n, x);
00336
00337 }
00338
00339
00340
00341
00342
00343
00344 double sph_legendre(unsigned l, unsigned m, double theta) {
00345
00346 return gsl_sf_legendre_sphPlm(l, m, std::cos(theta));
00347
00348 }
00349
00350
00351
00352
00353
00354
00355
00356 double sph_neumann(unsigned n, double x) {
00357
00358 return gsl_sf_bessel_yl(n, x);
00359
00360 }
00361
00362
00363
00364 double airy_Ai(double x) {
00365
00366 return gsl_sf_airy_Ai(x, GSL_PREC_DOUBLE);
00367
00368 }
00369
00370
00371
00372 double airy_Bi(double x) {
00373
00374 return gsl_sf_airy_Bi(x, GSL_PREC_DOUBLE);
00375
00376 }
00377
00378
00379
00380 double airy_Ai_deriv(double x) {
00381
00382 return gsl_sf_airy_Ai_deriv(x, GSL_PREC_DOUBLE);
00383
00384 }
00385
00386
00387
00388 double airy_Bi_deriv(double x) {
00389
00390 return gsl_sf_airy_Bi_deriv(x, GSL_PREC_DOUBLE);
00391
00392 }
00393
00394
00395
00396 double airy_zero_Ai(unsigned int s) {
00397
00398 return gsl_sf_airy_zero_Ai(s);
00399
00400 }
00401
00402
00403
00404 double airy_zero_Bi(unsigned int s) {
00405
00406 return gsl_sf_airy_zero_Bi(s);
00407
00408 }
00409
00410
00411
00412 double airy_zero_Ai_deriv(unsigned int s) {
00413
00414 return gsl_sf_airy_zero_Ai_deriv(s);
00415
00416 }
00417
00418
00419
00420 double airy_zero_Bi_deriv(unsigned int s) {
00421
00422 return gsl_sf_airy_zero_Bi_deriv(s);
00423
00424 }
00425
00426
00427
00428 double wigner_3j(int ja, int jb, int jc, int ma, int mb, int mc) {
00429 return gsl_sf_coupling_3j(ja,jb,jc,ma,mb,mc);
00430 }
00431
00432 double wigner_6j(int ja, int jb, int jc, int jd, int je, int jf) {
00433 return gsl_sf_coupling_6j(ja,jb,jc,jd,je,jf);
00434 }
00435
00436 double wigner_9j(int ja, int jb, int jc, int jd, int je, int jf, int jg, int jh, int ji) {
00437 return gsl_sf_coupling_9j(ja,jb,jc,jd,je,jf,jg,jh,ji);
00438 }
00439
00440 }
00441 }