#include "gnuplot_plugin.h" #include #include DLLEXPORT struct value Jn(int nargs, struct value *arg, void *p){ struct value r; double x; int n; RETURN_ERROR_IF_WRONG_NARGS(r, nargs, 2); RETURN_ERROR_IF_NONNUMERIC(r, arg[0]); RETURN_ERROR_IF_NONNUMERIC(r, arg[1]); r.type = CMPLX; n = IVAL(arg[0]); x = RVAL(arg[1]); r.v.cmplx_val.real = gsl_sf_bessel_Jn(n, x); r.v.cmplx_val.imag = 0.0; return r; }