CLHEP  2.4.7.2
C++ Class Library for High Energy Physics
Legendre.icc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id:
3 #include "gsl/gsl_sf_legendre.h"
4 #include <cmath>
5 #include <signal.h>
6 #include <assert.h>
7 
8 
9 namespace Genfun {
10 
11  FUNCTION_OBJECT_IMP(Legendre)
12 
13  inline
14  Legendre::Legendre(unsigned int order):
15  _order(order)
16  {
17  }
18  inline
19  Legendre::~Legendre() {
20  }
21  inline
22  Legendre::Legendre(const Legendre & right):
23  _order(right._order)
24  {
25  }
26 
27 
28  inline
29  double Legendre::operator() (double x) const {
30  gsl_sf_result result;
31  int status = gsl_sf_legendre_Pl_e(_order,x, &result);
32  if (status!=0) {
33  std::cerr << "Warning, GSL function gsl_sf_legendre_e"
34  << " return code" << status << std::endl;
35  raise(SIGFPE);
36  }
37  return result.val;
38  }
39 
40 } // end namespace Genfun
Definition: Airy.icc:9