CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
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 $
6#include "gsl/gsl_sf_bessel.h"
7#include <signal.h>
8
9namespace Genfun {
10
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
19inline
21 _l(l)
22{
23}
24
25inline
28
29inline
31_l(right._l)
32{
33}
34
35inline
36double 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
50inline
51unsigned int SphericalBessel::l() const {
52 return _l;
53}
54
55} // end namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
unsigned int l() const
virtual double operator()(double argument) const override
SphericalBessel(unsigned int l)
Definition Abs.hh:14