File indexing completed on 2025-01-18 09:54:35
0001
0002
0003 #include "gsl/gsl_sf_legendre.h"
0004 #include <cmath>
0005 #include <signal.h>
0006 #include <assert.h>
0007
0008
0009 namespace Genfun {
0010
0011 FUNCTION_OBJECT_IMP(Legendre)
0012
0013 inline
0014 Legendre::Legendre(unsigned int order):
0015 _order(order)
0016 {
0017 }
0018 inline
0019 Legendre::~Legendre() {
0020 }
0021 inline
0022 Legendre::Legendre(const Legendre & right):
0023 _order(right._order)
0024 {
0025 }
0026
0027
0028 inline
0029 double Legendre::operator() (double x) const {
0030 gsl_sf_result result;
0031 int status = gsl_sf_legendre_Pl_e(_order,x, &result);
0032 if (status!=0) {
0033 std::cerr << "Warning, GSL function gsl_sf_legendre_e"
0034 << " return code" << status << std::endl;
0035 raise(SIGFPE);
0036 }
0037 return result.val;
0038 }
0039
0040 }