diff --git a/ext/gsl_native/extconf.rb b/ext/gsl_native/extconf.rb index e8e5f83e..4533b29c 100644 --- a/ext/gsl_native/extconf.rb +++ b/ext/gsl_native/extconf.rb @@ -116,5 +116,11 @@ def gsl_gem_config(target, dir = 'ext') end have_struct_member('gsl_multifit_fdfsolver', 'J', 'gsl/gsl_multifit_nlin.h') +have_func('gsl_sf_mathieu_a_e', 'gsl/gsl_sf_mathieu.h'); +have_func('gsl_sf_mathieu_b_e', 'gsl/gsl_sf_mathieu.h'); +have_func('gsl_sf_mathieu_ce_e', 'gsl/gsl_sf_mathieu.h'); +have_func('gsl_sf_mathieu_se_e', 'gsl/gsl_sf_mathieu.h'); +have_func('gsl_sf_mathieu_Mc_e', 'gsl/gsl_sf_mathieu.h'); +have_func('gsl_sf_mathieu_Ms_e', 'gsl/gsl_sf_mathieu.h'); create_makefile('gsl_native') diff --git a/ext/gsl_native/sf_mathieu.c b/ext/gsl_native/sf_mathieu.c index 5f6ea14d..b8d33e68 100644 --- a/ext/gsl_native/sf_mathieu.c +++ b/ext/gsl_native/sf_mathieu.c @@ -133,11 +133,19 @@ static VALUE sf_mathieu_eval_e_int2_double2(VALUE n1, VALUE n2, VALUE qq, VALUE /**********/ static VALUE rb_gsl_sf_mathieu_a_e(VALUE module, VALUE order, VALUE qq) { +#ifdef HAVE_GSL_SF_MATHIEU_A_E return rb_gsl_sf_eval_e_int_double(gsl_sf_mathieu_a_e, order, qq); +#else + return rb_gsl_sf_eval_e_int_double(gsl_sf_mathieu_a, order, qq); +#endif } static VALUE rb_gsl_sf_mathieu_a(VALUE module, VALUE order, VALUE qq) { +#ifdef HAVE_GSL_SF_MATHIEU_A_E return sf_mathieu_eval(order, qq, gsl_sf_mathieu_a_e); +#else + return sf_mathieu_eval(order, qq, gsl_sf_mathieu_a); +#endif } static VALUE rb_gsl_sf_mathieu_a_array(VALUE module, int argc, VALUE *argv) { @@ -145,11 +153,19 @@ static VALUE rb_gsl_sf_mathieu_a_array(VALUE module, int argc, VALUE *argv) } static VALUE rb_gsl_sf_mathieu_b_e(VALUE module, VALUE order, VALUE qq) { +#ifdef HAVE_GSL_SF_MATHIEU_B_E return rb_gsl_sf_eval_e_int_double(gsl_sf_mathieu_b_e, order, qq); +#else + return rb_gsl_sf_eval_e_int_double(gsl_sf_mathieu_b, order, qq); +#endif } static VALUE rb_gsl_sf_mathieu_b(VALUE module, VALUE order, VALUE qq) { +#ifdef HAVE_GSL_SF_MATHIEU_B_E return sf_mathieu_eval(order, qq, gsl_sf_mathieu_b_e); +#else + return sf_mathieu_eval(order, qq, gsl_sf_mathieu_b); +#endif } static VALUE rb_gsl_sf_mathieu_b_array(VALUE module, int argc, VALUE *argv) { @@ -157,11 +173,19 @@ static VALUE rb_gsl_sf_mathieu_b_array(VALUE module, int argc, VALUE *argv) } static VALUE rb_gsl_sf_mathieu_ce_e(VALUE module, VALUE order, VALUE qq, VALUE zz) { +#ifdef HAVE_GSL_SF_MATHIEU_CE_E return sf_mathieu_eval_e_int_double2(order, qq, zz, gsl_sf_mathieu_ce_e); +#else + return sf_mathieu_eval_e_int_double2(order, qq, zz, gsl_sf_mathieu_ce); +#endif } static VALUE rb_gsl_sf_mathieu_ce(VALUE module, VALUE order, VALUE qq, VALUE zz) { +#ifdef HAVE_GSL_SF_MATHIEU_CE_E return sf_mathieu_eval_int_double2(order, qq, zz, gsl_sf_mathieu_ce_e); +#else + return sf_mathieu_eval_int_double2(order, qq, zz, gsl_sf_mathieu_ce); +#endif } static VALUE rb_gsl_sf_mathieu_ce_array(VALUE module, int argc, VALUE *argv) { @@ -169,11 +193,19 @@ static VALUE rb_gsl_sf_mathieu_ce_array(VALUE module, int argc, VALUE *argv) } static VALUE rb_gsl_sf_mathieu_se_e(VALUE module, VALUE order, VALUE qq, VALUE zz) { +#ifdef HAVE_GSL_SF_MATHIEU_SE_E return sf_mathieu_eval_e_int_double2(order, qq, zz, gsl_sf_mathieu_se_e); +#else + return sf_mathieu_eval_e_int_double2(order, qq, zz, gsl_sf_mathieu_se); +#endif } static VALUE rb_gsl_sf_mathieu_se(VALUE module, VALUE order, VALUE qq, VALUE zz) { +#ifdef HAVE_GSL_SF_MATHIEU_SE_E return sf_mathieu_eval_int_double2(order, qq, zz, gsl_sf_mathieu_se_e); +#else + return sf_mathieu_eval_int_double2(order, qq, zz, gsl_sf_mathieu_se); +#endif } static VALUE rb_gsl_sf_mathieu_se_array(VALUE module, int argc, VALUE *argv) { @@ -183,11 +215,19 @@ static VALUE rb_gsl_sf_mathieu_se_array(VALUE module, int argc, VALUE *argv) /*****/ static VALUE rb_gsl_sf_mathieu_Mc_e(VALUE module, VALUE n1, VALUE n2, VALUE q, VALUE x) { +#ifdef HAVE_GSL_SF_MATHIEU_MC_E return sf_mathieu_eval_e_int2_double2(n1, n2, q, x, gsl_sf_mathieu_Mc_e); +#else + return sf_mathieu_eval_e_int2_double2(n1, n2, q, x, gsl_sf_mathieu_Mc); +#endif } static VALUE rb_gsl_sf_mathieu_Mc(VALUE module, VALUE n1, VALUE n2, VALUE q, VALUE x) { +#ifdef HAVE_GSL_SF_MATHIEU_MC_E return sf_mathieu_eval2(n1, n2, q, x, gsl_sf_mathieu_Mc_e); +#else + return sf_mathieu_eval2(n1, n2, q, x, gsl_sf_mathieu_Mc); +#endif } static VALUE rb_gsl_sf_mathieu_Mc_array(VALUE module, int argc, VALUE *argv) { @@ -195,11 +235,19 @@ static VALUE rb_gsl_sf_mathieu_Mc_array(VALUE module, int argc, VALUE *argv) } static VALUE rb_gsl_sf_mathieu_Ms_e(VALUE module, VALUE n1, VALUE n2, VALUE q, VALUE x) { +#ifdef HAVE_GSL_SF_MATHIEU_MS_E return sf_mathieu_eval_e_int2_double2(n1, n2, q, x, gsl_sf_mathieu_Ms_e); +#else + return sf_mathieu_eval_e_int2_double2(n1, n2, q, x, gsl_sf_mathieu_Ms); +#endif } static VALUE rb_gsl_sf_mathieu_Ms(VALUE module, VALUE n1, VALUE n2, VALUE q, VALUE x) { +#ifdef HAVE_GSL_SF_MATHIEU_MS_E return sf_mathieu_eval2(n1, n2, q, x, gsl_sf_mathieu_Ms_e); +#else + return sf_mathieu_eval2(n1, n2, q, x, gsl_sf_mathieu_Ms); +#endif } static VALUE rb_gsl_sf_mathieu_Ms_array(VALUE module, int argc, VALUE *argv) {