CLHEP
2.4.7.1
C++ Class Library for High Energy Physics
CLHEP
GenericFunctions
SphericalBessel.icc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: SphericalBessel.icc,v 1.4 2010/06/16 18:22:01 garren Exp $
3
#include "
CLHEP/GenericFunctions/Sin.hh
"
4
#include "
CLHEP/GenericFunctions/Cos.hh
"
5
#include "
CLHEP/GenericFunctions/Variable.hh
"
6
#include "gsl/gsl_sf_bessel.h"
7
#include <signal.h>
8
9
namespace
Genfun
{
10
11
FUNCTION_OBJECT_IMP
(
SphericalBessel
)
12
13
//---------------------------------------------------------------------------------//
14
// Implementation notes: The Spherical Bessel function is implemented in terms of //
15
// lower order spherical bessel functions. This is possible thanks to a recursion //
16
// relation. //
17
//---------------------------------------------------------------------------------//
18
19
inline
20
SphericalBessel::SphericalBessel
(
unsigned
int
l
):
21
_l(
l
)
22
{
23
}
24
25
inline
26
SphericalBessel::~SphericalBessel
() {
27
}
28
29
inline
30
SphericalBessel::SphericalBessel
(
const
SphericalBessel
& right):
31
_l(right._l)
32
{
33
}
34
35
inline
36
double
SphericalBessel::operator()
(
double
x)
const
{
37
//
38
// First try the GSL implementation:
39
//
40
gsl_sf_result result;
41
int
status =gsl_sf_bessel_jl_e(_l, x,&result);
42
if
(status!=0) {
43
std::cerr <<
"Warning, GSL function gsl_sf_bessel_jl_impl"
44
<<
" return code"
<< status << std::endl;
45
raise(SIGFPE);
46
}
47
return
result.val;
48
}
49
50
inline
51
unsigned
int
SphericalBessel::l
()
const
{
52
return
_l;
53
}
54
55
}
// end namespace Genfun
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition
AbsFunction.hh:149
Cos.hh
Sin.hh
Variable.hh
Genfun::SphericalBessel
Definition
SphericalBessel.hh:19
Genfun::SphericalBessel::l
unsigned int l() const
Definition
SphericalBessel.icc:51
Genfun::SphericalBessel::~SphericalBessel
virtual ~SphericalBessel()
Definition
SphericalBessel.icc:26
Genfun::SphericalBessel::operator()
virtual double operator()(double argument) const override
Definition
SphericalBessel.icc:36
Genfun::SphericalBessel::SphericalBessel
SphericalBessel(unsigned int l)
Definition
SphericalBessel.icc:20
Genfun
Definition
Abs.hh:14
Generated by
1.13.1