CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
EllipticIntegral.icc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id:
3#include "gsl/gsl_sf_ellint.h"
4#include <cmath>
5#include <signal.h>
6#include <assert.h>
7
8
9namespace Genfun {
10namespace EllipticIntegral {
11
12//-----------------------------------------------------------------------------//
13// FIRST KIND //
14//-----------------------------------------------------------------------------//
15
16FUNCTION_OBJECT_IMP(FirstKind)
17
18inline
20 _k("K", 1.0,0.0,1.0)
21{
22}
23
24inline
27
28inline
30 _k(right._k)
31{
32}
33
34
35inline
37 return _k;
38}
39
40inline
41const Parameter & FirstKind::k() const {
42 return _k;
43}
44
45
46inline
47double FirstKind::operator() (double x) const {
48 gsl_sf_result result;
49 int status = gsl_sf_ellint_F_e(x,_k.getValue(), GSL_PREC_DOUBLE, &result);
50 if (status!=0) {
51 std::cerr << "Warning, GSL function gsl_sf_ellint_F_impl"
52 << " return code" << status << std::endl;
53 raise(SIGFPE);
54 }
55 return result.val;
56}
57//-----------------------------------------------------------------------------//
58// SECOND KIND //
59//-----------------------------------------------------------------------------//
60
62
63inline
65 _k("K", 1.0,0.0,1.0)
66{
67}
68
69inline
72
73inline
75 _k(right._k)
76{
77}
78
79
80inline
82 return _k;
83}
84
85inline
86const Parameter & SecondKind::k() const {
87 return _k;
88}
89
90
91inline
92double SecondKind::operator() (double x) const {
93 gsl_sf_result result;
94 int status = gsl_sf_ellint_E_e(x,_k.getValue(), GSL_PREC_DOUBLE, &result);
95 if (status!=0) {
96 std::cerr << "Warning, GSL function gsl_sf_ellint_E_impl"
97 << " return code" << status << std::endl;
98 raise(SIGFPE);
99 }
100 return result.val;
101}
102//-----------------------------------------------------------------------------//
103// THIRD KIND //
104//-----------------------------------------------------------------------------//
106
107inline
109 _k("K", 1.0,0.0, 1.0),
110 _n("N", 1.0,0.0,10.0)
111{
112}
113
114inline
117
118inline
120 _k(right._k),
121 _n(right._n)
122{
123}
124
125
126inline
128 return _k;
129}
130
131inline
132const Parameter & ThirdKind::k() const {
133 return _k;
134}
135
136
137inline
139 return _n;
140}
141
142inline
143const Parameter & ThirdKind::n() const {
144 return _n;
145}
146
147
148inline
149double ThirdKind::operator() (double x) const {
150 gsl_sf_result result;
151 int status = gsl_sf_ellint_P_e(x,_k.getValue(),_n.getValue(), GSL_PREC_DOUBLE, &result);
152 if (status!=0) {
153 std::cerr << "Warning, GSL function gsl_ellint_P_impl"
154 << " return code" << status << std::endl;
155 raise(SIGFPE);
156 }
157 return result.val;
158}
159} // end namespace EllipticIntegral
160} // end namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
virtual double operator()(double argument) const override
virtual double operator()(double argument) const override
virtual double operator()(double argument) const override
virtual double getValue() const
Definition Abs.hh:14