File indexing completed on 2025-01-18 09:54:34
0001
0002
0003 #include "gsl/gsl_sf_airy.h"
0004 #include <cmath>
0005 #include <signal.h>
0006 #include <assert.h>
0007
0008
0009 namespace Genfun {
0010
0011 FUNCTION_OBJECT_IMP(Airy)
0012 inline
0013 Airy::Airy(Type type):
0014 _type(type)
0015 {
0016 }
0017
0018 inline
0019 Airy::~Airy() {
0020 }
0021
0022 inline
0023 Airy::Airy(const Airy & right):
0024 _type(right._type)
0025 {
0026 }
0027
0028
0029
0030 inline
0031 double Airy::operator() (double x) const {
0032 gsl_sf_result result;
0033 if (_type==Ai) {
0034 int status = gsl_sf_airy_Ai_e(x, GSL_PREC_DOUBLE, &result);
0035 if (status!=0) {
0036 std::cerr << "Warning, GSL function gsl_sf_airy_ai"
0037 << " return code" << status << std::endl;
0038 raise(SIGFPE);
0039 }
0040 return result.val;
0041 }
0042 else if (_type==Bi) {
0043 int status = gsl_sf_airy_Bi_e( x, GSL_PREC_DOUBLE, &result);
0044 if (status!=0) {
0045 std::cerr << "Warning, GSL function gsl_sf_airy_bi"
0046 << " return code" << status << std::endl;
0047 raise(SIGFPE);
0048 }
0049 return result.val;
0050 }
0051 return result.val;
0052 }
0053
0054 }