The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
pp_addpm({At=>Top},<<'EOD');
=head1 NAME

PDL::GSLSF::COULOMB - PDL interface to GSL Special Functions

=head1 DESCRIPTION

This is an interface to the Special Function package present in the GNU Scientific Library. 

=head1 SYNOPSIS

=cut


EOD

# PP interface to GSL

pp_addhdr('
#include <gsl/gsl_sf.h>
#include <gsl/gsl_errno.h>
#include "../gslerr.h"
');

pp_def('gsl_sf_hydrogenicR',
       GenericTypes => [D],
       OtherPars =>'int n; int l; double z',
       Pars=>'double x(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_hydrogenicR_e,($COMP(n),$COMP(l),$COMP(z),$x(),&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Normalized Hydrogenic bound states. Radial dipendence.'
      );

pp_def('gsl_sf_coulomb_wave_FGp_array',
       GenericTypes => [D],
       OtherPars =>'double lam_min; int kmax=>n; double eta',
       Pars=>'double x(); double [o]fc(n); double [o]fcp(n); double [o]gc(n); double [o]gcp(n); int [o]ovfw(); double [o]fe(n); double [o]ge(n);',
       Code =>'
int s;
s = gsl_sf_coulomb_wave_FGp_array($COMP(lam_min),$COMP(kmax),$COMP(eta),$x(),$PP(fc),$PP(fcp),$PP(gc),$PP(gcp),$PP(fe),$PP(ge));
if (s==GSL_EOVRFLW) {
$ovfw()=1;
}
else {if (s) {sprintf(buf,"Error in gsl_sf_coulomb_wave_FGp_array: %s",gsl_strerror(s));barf("%s", buf);}
else {$ovfw()=0;}}
',
       Doc =>' Coulomb wave functions F_{lam_F}(eta,x), G_{lam_G}(eta,x) and their derivatives; lam_G := lam_F - k_lam_G. if ovfw is signaled then F_L(eta,x)  =  fc[k_L] * exp(fe) and similar. '
      );


pp_def('gsl_sf_coulomb_wave_sphF_array',
       GenericTypes => [D],
       OtherPars =>'double lam_min; int kmax=>n; double eta',
       Pars=>'double x(); double [o]fc(n); int [o]ovfw(); double [o]fe(n);',
       Code =>'
int s;
s = gsl_sf_coulomb_wave_sphF_array($COMP(lam_min),$COMP(kmax),$COMP(eta),$x(),$PP(fc),$PP(fe));
if (s==GSL_EOVRFLW) {
$ovfw()=1;
}
else {if (s) {sprintf(buf,"Error in gsl_sf_coulomb_wave_sphF_array: %s",gsl_strerror(s));barf("%s", buf);}
else {$ovfw()=0;}}
',
       Doc =>' Coulomb wave function divided by the argument, F(xi, eta)/xi. This is the function which reduces to spherical Bessel functions in the limit eta->0. '
      );

pp_def('gsl_sf_coulomb_CL_e',
       GenericTypes => [D],
       Pars=>'double L(); double eta();  double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_coulomb_CL_e,($L(),$eta(),&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Coulomb wave function normalization constant. [Abramowitz+Stegun 14.1.8, 14.1.9].'
      );


pp_addpm({At=>Bot},<<'EOD');
=head1 AUTHOR

This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it>
All rights reserved. There
is no warranty. You are allowed to redistribute this software /
documentation under certain conditions. For details, see the file
COPYING in the PDL distribution. If this file is separated from the
PDL distribution, the copyright notice should be included in the file.

The GSL SF modules were written by G. Jungman.

=cut


EOD

pp_add_boot('gsl_set_error_handler_off();
');


pp_done();