<
I want to call a GSL function, which writes data to a pointer to be provided
(Regular Spherical Bessel Functions, array version) it has prototype

  int gsl_sf_bessel_jl_steed_array (int lmax, double x, double * jl_x_array)

so the 'array' is a pointer and no specific length (though only lmax + 1 of
the space is used, I think).

I tried the below, but the actual call results in a crash:

  arrB_GSL := define_external(
    'gsl_sf_bessel_jl_steed_array',
    'C',
    'lmax'::integer[4],
    'x'::float[8],
    'jl_x_array'::ARRAY(datatype=float[8],order=C_order, NO_COPY), 
    'RETURN'::integer[4],
    LIB="gsl.DLL");       

GSL sits in my system directory, so it is found and NO_COPY for updates into
the 'array'.

  nTst:=4;
  steedArr:=Array(datatype=float[8], order=C_order);

  arrB_GSL(nTst, 1.0, steedArr); # now that does not work ... :-(


Any suggestions how to proceed here? I have tried with length or Fortan as
ordering and this and that ... nada ... and the 'Advanced Prog Guide' does
not illuminate me.


PS: the underlying function is sqrt(2*Pi/x)*BesselJ(n+1/2,x)/2, n in IN and
the GSL should provide all the values for k=0 ... n and 0 <= x given - for
which I want a fast numerical solution. However I do not want to compile
the GSL code for my special needs again (using fixed length).
PPS: the GSL docu for that:
www.gnu.org/software/gsl/manual/html_node/Regular-Spherical-Bessel-Functions.html

Please Wait...