CLHEP  2.4.7.2
C++ Class Library for High Energy Physics
Airy.icc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id:
3 #include "gsl/gsl_sf_airy.h"
4 #include <cmath>
5 #include <signal.h>
6 #include <assert.h>
7 
8 
9 namespace Genfun {
10 
11  FUNCTION_OBJECT_IMP(Airy)
12  inline
13  Airy::Airy(Type type):
14  _type(type)
15  {
16  }
17 
18  inline
19  Airy::~Airy() {
20  }
21 
22  inline
23  Airy::Airy(const Airy & right):
24  _type(right._type)
25  {
26  }
27 
28 
29 
30  inline
31  double Airy::operator() (double x) const {
32  gsl_sf_result result;
33  if (_type==Ai) {
34  int status = gsl_sf_airy_Ai_e(x, GSL_PREC_DOUBLE, &result);
35  if (status!=0) {
36  std::cerr << "Warning, GSL function gsl_sf_airy_ai"
37  << " return code" << status << std::endl;
38  raise(SIGFPE);
39  }
40  return result.val;
41  }
42  else if (_type==Bi) {
43  int status = gsl_sf_airy_Bi_e( x, GSL_PREC_DOUBLE, &result);
44  if (status!=0) {
45  std::cerr << "Warning, GSL function gsl_sf_airy_bi"
46  << " return code" << status << std::endl;
47  raise(SIGFPE);
48  }
49  return result.val;
50  }
51  return result.val;
52  }
53 
54 } // end namespace Genfun
Definition: Airy.icc:9