--- PDL::GSL::INTEG.3pm-orig 2004-11-19 06:26:17.779182032 -0500 +++ PDL::GSL::INTEG.3pm 2004-11-19 06:27:08.497471680 -0500 @@ -132,6 +132,41 @@ .TH INTEG 3 "2004-06-15" "perl v5.8.3" "User Contributed Perl Documentation" .SH "NAME" PDL::GSL::INTEG \- PDL interface to numerical integration routines in GSL +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use PDL; +\& use PDL::GSL::INTEG; +.Ve +.PP +.Vb 4 +\& my $a = 1.2; +\& my $b = 3.7; +\& my $epsrel = 0; +\& my $epsabs = 1e-6; +.Ve +.PP +.Vb 4 +\& # Non adaptive integration +\& my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\e&myf,$a,$b,$epsrel,$epsabs); +\& # Warnings on +\& my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\e&myf,$a,$b,$epsrel,$epsabs,{Warn=>'y'}); +.Ve +.PP +.Vb 5 +\& # Adaptive integration with warnings on +\& my $limit = 1000; +\& my $key = 5; +\& my ($res,$abserr,$ierr) = gslinteg_qag(\e&myf,$a,$b,$epsrel, +\& $epsabs,$limit,$key,{Warn=>'y'}); +.Ve +.PP +.Vb 4 +\& sub myf{ +\& my ($x) = @_; +\& return exp(-$x**2); +\& } +.Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is an interface to the numerical integration package present in the @@ -181,41 +216,6 @@ the reason of failure will be printed. .PP Please check the \s-1GSL\s0 documentation for more information. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -.Vb 2 -\& use PDL; -\& use PDL::GSL::INTEG; -.Ve -.PP -.Vb 4 -\& my $a = 1.2; -\& my $b = 3.7; -\& my $epsrel = 0; -\& my $epsabs = 1e-6; -.Ve -.PP -.Vb 4 -\& # Non adaptive integration -\& my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\e&myf,$a,$b,$epsrel,$epsabs); -\& # Warnings on -\& my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\e&myf,$a,$b,$epsrel,$epsabs,{Warn=>'y'}); -.Ve -.PP -.Vb 5 -\& # Adaptive integration with warnings on -\& my $limit = 1000; -\& my $key = 5; -\& my ($res,$abserr,$ierr) = gslinteg_qag(\e&myf,$a,$b,$epsrel, -\& $epsabs,$limit,$key,{Warn=>'y'}); -.Ve -.PP -.Vb 4 -\& sub myf{ -\& my ($x) = @_; -\& return exp(-$x**2); -\& } -.Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .Sh "\fIgslinteg_qng()\fP \*(-- Non-adaptive Gauss-Kronrod integration"