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::ELLINT - 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

=head1 Functions

=cut
EOD

# PP interface to GSL

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

pp_def('gsl_sf_ellint_Kcomp',
       GenericTypes => [D],
       Pars=>'double k(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_Kcomp_e,($k(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Legendre form of complete elliptic integrals K(k) = Integral[1/Sqrt[1 - k^2 Sin[t]^2], {t, 0, Pi/2}].'
      );

pp_def('gsl_sf_ellint_Ecomp',
       GenericTypes => [D],
       Pars=>'double k(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_Ecomp_e,($k(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Legendre form of complete elliptic integrals E(k) = Integral[  Sqrt[1 - k^2 Sin[t]^2], {t, 0, Pi/2}]'
      );

pp_def('gsl_sf_ellint_F',
       GenericTypes => [D],
       Pars=>'double phi(); double k(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_F_e,($phi(),$k(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Legendre form of incomplete elliptic integrals F(phi,k)   = Integral[1/Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}]'
      );

pp_def('gsl_sf_ellint_E',
       GenericTypes => [D],
       Pars=>'double phi(); double k(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_E_e,($phi(),$k(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Legendre form of incomplete elliptic integrals E(phi,k)   = Integral[  Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}]'
      );

pp_def('gsl_sf_ellint_P',
       GenericTypes => [D],
       Pars=>'double phi(); double k(); double n();
              double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_P_e,($phi(),$k(),$n(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Legendre form of incomplete elliptic integrals P(phi,k,n) = Integral[(1 + n Sin[t]^2)^(-1)/Sqrt[1 - k^2 Sin[t]^2], {t, 0, phi}]'
      );

pp_def('gsl_sf_ellint_D',
       GenericTypes => [D],
       Pars=>'double phi(); double k(); double n();
              double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_D_e,($phi(),$k(),$n(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Legendre form of incomplete elliptic integrals D(phi,k,n)'
      );

pp_def('gsl_sf_ellint_RC',
       GenericTypes => [D],
       Pars=>'double x(); double yy(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_RC_e,($x(),$yy(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Carlsons symmetric basis of functions RC(x,y)   = 1/2 Integral[(t+x)^(-1/2) (t+y)^(-1)], {t,0,Inf}'
      );

pp_def('gsl_sf_ellint_RD',
       GenericTypes => [D],
       Pars=>'double x(); double yy(); double z(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_RD_e,($x(),$yy(),$z(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Carlsons symmetric basis of functions RD(x,y,z) = 3/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-3/2), {t,0,Inf}]'
      );

pp_def('gsl_sf_ellint_RF',
       GenericTypes => [D],
       Pars=>'double x(); double yy(); double z(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_RF_e,($x(),$yy(),$z(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Carlsons symmetric basis of functions RF(x,y,z) = 1/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-1/2), {t,0,Inf}]'
      );

pp_def('gsl_sf_ellint_RJ',
       GenericTypes => [D],
       Pars=>'double x(); double yy(); double z(); double p(); double [o]y(); double [o]e()',
       Code =>'
gsl_sf_result r;
GSLERR(gsl_sf_ellint_RJ_e,($x(),$yy(),$z(),$p(),GSL_PREC_DOUBLE,&r))
$y() = r.val;
$e() = r.err; 
',
       Doc =>'Carlsons symmetric basis of functions RJ(x,y,z,p) = 3/2 Integral[(t+x)^(-1/2) (t+y)^(-1/2) (t+z)^(-1/2) (t+p)^(-1), {t,0,Inf}]'
      );

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

This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it>,
2002 Christian Soeller.
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_done();