.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "INTEG 3pm" .TH INTEG 3pm "2016-10-10" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDL::GSL::INTEG \- PDL interface to numerical integration routines in GSL .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is an interface to the numerical integration package present in the \&\s-1GNU\s0 Scientific Library, which is an implementation of \s-1QUADPACK.\s0 .PP Functions are named \fBgslinteg_{algorithm}\fR where {algorithm} is the \s-1QUADPACK\s0 naming convention. The available functions are: .IP "gslinteg_qng: Non-adaptive Gauss-Kronrod integration" 3 .IX Item "gslinteg_qng: Non-adaptive Gauss-Kronrod integration" .PD 0 .IP "gslinteg_qag: Adaptive integration" 3 .IX Item "gslinteg_qag: Adaptive integration" .IP "gslinteg_qags: Adaptive integration with singularities" 3 .IX Item "gslinteg_qags: Adaptive integration with singularities" .IP "gslinteg_qagp: Adaptive integration with known singular points" 3 .IX Item "gslinteg_qagp: Adaptive integration with known singular points" .IP "gslinteg_qagi: Adaptive integration on infinite interval of the form (\-\einfty,\einfty)" 3 .IX Item "gslinteg_qagi: Adaptive integration on infinite interval of the form (-infty,infty)" .IP "gslinteg_qagiu: Adaptive integration on infinite interval of the form (a,\einfty)" 3 .IX Item "gslinteg_qagiu: Adaptive integration on infinite interval of the form (a,infty)" .IP "gslinteg_qagil: Adaptive integration on infinite interval of the form (\-\einfty,b)" 3 .IX Item "gslinteg_qagil: Adaptive integration on infinite interval of the form (-infty,b)" .IP "gslinteg_qawc: Adaptive integration for Cauchy principal values" 3 .IX Item "gslinteg_qawc: Adaptive integration for Cauchy principal values" .IP "gslinteg_qaws: Adaptive integration for singular functions" 3 .IX Item "gslinteg_qaws: Adaptive integration for singular functions" .IP "gslinteg_qawo: Adaptive integration for oscillatory functions" 3 .IX Item "gslinteg_qawo: Adaptive integration for oscillatory functions" .IP "gslinteg_qawf: Adaptive integration for Fourier integrals" 3 .IX Item "gslinteg_qawf: Adaptive integration for Fourier integrals" .PD .PP Each algorithm computes an approximation to the integral, I, of the function f(x)w(x), where w(x) is a weight function (for general integrands w(x)=1). The user provides absolute and relative error bounds (epsabs,epsrel) which specify the following accuracy requirement: .PP |RESULT \- I| <= max(epsabs, epsrel |I|) .PP The routines will fail to converge if the error bounds are too stringent, but always return the best approximation obtained up to that stage .PP All functions return the result, and estimate of the absolute error and an error flag (which is zero if there were no problems). You are responsible for checking for any errors, no warnings are issued unless the option {Warn => 'y'} is specified in which case the reason of failure will be printed. .PP You can nest integrals up to 20 levels. If you find yourself in the unlikely situation that you need more, you can change the value of 'max_nested_integrals' in the first line of the file '\s-1FUNC\s0.c' and recompile. .PP Please check the \s-1GSL\s0 documentation for more information. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use PDL; \& use PDL::GSL::INTEG; \& \& my $a = 1.2; \& my $b = 3.7; \& my $epsrel = 0; \& my $epsabs = 1e\-6; \& \& # 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=>\*(Aqy\*(Aq}); \& \& # 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=>\*(Aqy\*(Aq}); \& \& sub myf{ \& my ($x) = @_; \& return exp(\-$x**2); \& } .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "qng_meat" .IX Subsection "qng_meat" .Vb 3 \& Signature: (double a(); double b(); double epsabs(); \& double epsrel(); double [o] result(); double [o] abserr(); \& int [o] neval(); int [o] ierr(); int gslwarn(); SV* function) .Ve .PP info not available .PP qng_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qag_meat" .IX Subsection "qag_meat" .Vb 2 \& Signature: (double a(); double b(); double epsabs();double epsrel(); int limit(); \& int key(); double [o] result(); double [o] abserr();int n();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qag_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qags_meat" .IX Subsection "qags_meat" .Vb 2 \& Signature: (double a(); double b(); double epsabs();double epsrel(); int limit(); \& double [o] result(); double [o] abserr();int n();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qags_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qagp_meat" .IX Subsection "qagp_meat" .Vb 2 \& Signature: (double pts(l); double epsabs();double epsrel();int limit(); \& double [o] result(); double [o] abserr();int n();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qagp_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qagi_meat" .IX Subsection "qagi_meat" .Vb 2 \& Signature: (double epsabs();double epsrel(); int limit(); \& double [o] result(); double [o] abserr(); int n(); int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qagi_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qagiu_meat" .IX Subsection "qagiu_meat" .Vb 2 \& Signature: (double a(); double epsabs();double epsrel();int limit(); \& double [o] result(); double [o] abserr();int n();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qagiu_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qagil_meat" .IX Subsection "qagil_meat" .Vb 2 \& Signature: (double b(); double epsabs();double epsrel();int limit(); \& double [o] result(); double [o] abserr();int n();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qagil_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qawc_meat" .IX Subsection "qawc_meat" .Vb 2 \& Signature: (double a(); double b(); double c(); double epsabs();double epsrel();int limit(); \& double [o] result(); double [o] abserr();int n();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qawc_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qaws_meat" .IX Subsection "qaws_meat" .Vb 3 \& Signature: (double a(); double b();double epsabs();double epsrel();int limit(); \& double [o] result(); double [o] abserr();int n(); \& double alpha(); double beta(); int mu(); int nu();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qaws_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qawo_meat" .IX Subsection "qawo_meat" .Vb 3 \& Signature: (double a(); double b();double epsabs();double epsrel();int limit(); \& double [o] result(); double [o] abserr();int n(); \& int sincosopt(); double omega(); double L(); int nlevels();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qawo_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "qawf_meat" .IX Subsection "qawf_meat" .Vb 3 \& Signature: (double a(); double epsabs();int limit(); \& double [o] result(); double [o] abserr();int n(); \& int sincosopt(); double omega(); int nlevels();int [o] ierr();int gslwarn();; SV* function) .Ve .PP info not available .PP qawf_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "gslinteg_qng" .IX Subsection "gslinteg_qng" Non-adaptive Gauss-Kronrod integration .PP This function applies the Gauss-Kronrod 10\-point, 21\-point, 43\-point and 87\-point integration rules in succession until an estimate of the integral of f over ($a,$b) is achieved within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. It is meant for fast integration of smooth functions. It returns an array with the result, an estimate of the absolute error, an error flag and the number of function evaluations performed. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr,$neval) = gslinteg_qng($function_ref,$a,$b, \& $epsrel,$epsabs,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\e&f,0,1,0,1e\-9); \& # with warnings on \& my ($res,$abserr,$ierr,$neval) = gslinteg_qng(\e&f,0,1,0,1e\-9,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& return ($x**2.6)*log(1.0/$x); \& } .Ve .SS "gslinteg_qag" .IX Subsection "gslinteg_qag" Adaptive integration .PP This function applies an integration rule adaptively until an estimate of the integral of f over ($a,$b) is achieved within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. On each iteration the adaptive integration strategy bisects the interval with the largest error estimate; the maximum number of allowed subdivisions is given by the parameter \f(CW$limit\fR. The integration rule is determined by the value of \f(CW$key\fR, which has to be one of (1,2,3,4,5,6) and correspond to the 15, 21, 31, 41, 51 and 61 point Gauss-Kronrod rules respectively. It returns an array with the result, an estimate of the absolute error and an error flag. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qag($function_ref,$a,$b,$epsrel, \& $epsabs,$limit,$key,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qag(\e&f,0,1,0,1e\-10,1000,1); \& # with warnings on \& my ($res,$abserr,$ierr) = gslinteg_qag(\e&f,0,1,0,1e\-10,1000,1,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& return ($x**2.6)*log(1.0/$x); \& } .Ve .SS "gslinteg_qags" .IX Subsection "gslinteg_qags" Adaptive integration with singularities .PP This function applies the Gauss-Kronrod 21\-point integration rule adaptively until an estimate of the integral of f over ($a,$b) is achieved within the desired absolute and relative error limits, \&\f(CW$epsabs\fR and \f(CW$epsrel\fR. The algorithm is such that it accelerates the convergence of the integral in the presence of discontinuities and integrable singularities. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qags($function_ref,$a,$b,$epsrel, \& $epsabs,$limit,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qags(\e&f,0,1,0,1e\-10,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qags(\e&f,0,1,0,1e\-10,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& return ($x)*log(1.0/$x); \& } .Ve .SS "gslinteg_qagp" .IX Subsection "gslinteg_qagp" Adaptive integration with known singular points .PP This function applies the adaptive integration algorithm used by gslinteg_qags taking into account the location of singular points until an estimate of the integral of f over ($a,$b) is achieved within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. Singular points are supplied in the piddle \f(CW$points\fR, whose endpoints determine the integration range. So, for example, if the function has singular points at x_1 and x_2 and the integral is desired from a to b (a < x_1 < x_2 < b), \f(CW$points\fR = pdl(a,x_1,x_2,b). The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qagp($function_ref,$points,$epsabs, \& $epsrel,$limit,[{Warn => $warn}]) .Ve .PP Example: .PP .Vb 4 \& my $points = pdl(0,1,sqrt(2),3); \& my ($res,$abserr,$ierr) = gslinteg_qagp(\e&f,$points,0,1e\-3,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qagp(\e&f,$points,0,1e\-3,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& my $x2 = $x**2; \& my $x3 = $x**3; \& return $x3 * log(abs(($x2\-1.0)*($x2\-2.0))); \& } .Ve .SS "gslinteg_qagi" .IX Subsection "gslinteg_qagi" Adaptive integration on infinite interval .PP This function estimates the integral of the function f over the infinite interval (\-\einfty,+\einfty) within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. After a transformation, the algorithm of gslinteg_qags with a 15\-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qagi($function_ref,$epsabs, \& $epsrel,$limit,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qagi(\e&myfn,1e\-7,0,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qagi(\e&myfn,1e\-7,0,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub myfn{ \& my ($x) = @_; \& return exp(\-$x \- $x*$x) ; \& } .Ve .SS "gslinteg_qagiu" .IX Subsection "gslinteg_qagiu" Adaptive integration on infinite interval .PP This function estimates the integral of the function f over the infinite interval (a,+\einfty) within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. After a transformation, the algorithm of gslinteg_qags with a 15\-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qagiu($function_ref,$a,$epsabs, \& $epsrel,$limit,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 4 \& my $alfa = 1; \& my ($res,$abserr,$ierr) = gslinteg_qagiu(\e&f,99.9,1e\-7,0,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qagiu(\e&f,99.9,1e\-7,0,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& if (($x==0) && ($alfa == 1)) {return 1;} \& if (($x==0) && ($alfa > 1)) {return 0;} \& return ($x**($alfa\-1))/((1+10*$x)**2); \& } .Ve .SS "gslinteg_qagil" .IX Subsection "gslinteg_qagil" Adaptive integration on infinite interval .PP This function estimates the integral of the function f over the infinite interval (\-\einfty,b) within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. After a transformation, the algorithm of gslinteg_qags with a 15\-point Gauss-Kronrod rule is used. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qagl($function_ref,$b,$epsabs, \& $epsrel,$limit,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qagil(\e&myfn,1.0,1e\-7,0,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qagil(\e&myfn,1.0,1e\-7,0,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub myfn{ \& my ($x) = @_; \& return exp($x); \& } .Ve .SS "gslinteg_qawc" .IX Subsection "gslinteg_qawc" Adaptive integration for Cauchy principal values .PP This function computes the Cauchy principal value of the integral of f over (a,b), with a singularity at c, I = \eint_a^b dx f(x)/(x \- c). The integral is estimated within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 1 \& ($res,$abserr,$ierr) = gslinteg_qawc($function_ref,$a,$b,$c,$epsabs,$epsrel,$limit) .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qawc(\e&f,\-1,5,0,0,1e\-3,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qawc(\e&f,\-1,5,0,0,1e\-3,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& return 1.0 / (5.0 * $x * $x * $x + 6.0) ; \& } .Ve .SS "gslinteg_qaws" .IX Subsection "gslinteg_qaws" Adaptive integration for singular functions .PP The algorithm in gslinteg_qaws is designed for integrands with algebraic-logarithmic singularities at the end-points of an integration region. Specifically, this function computes the integral given by I = \eint_a^b dx f(x) (x\-a)^alpha (b\-x)^beta log^mu (x\-a) log^nu (b\-x). The integral is estimated within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 3 \& ($res,$abserr,$ierr) = \& gslinteg_qawc($function_ref,$alpha,$beta,$mu,$nu,$a,$b, \& $epsabs,$epsrel,$limit,[{Warn => $warn}]); .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qaws(\e&f,0,0,1,0,0,1,0,1e\-7,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qaws(\e&f,0,0,1,0,0,1,0,1e\-7,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& if($x==0){return 0;} \& else{ \& my $u = log($x); \& my $v = 1 + $u*$u; \& return 1.0/($v*$v); \& } \& } .Ve .SS "gslinteg_qawo" .IX Subsection "gslinteg_qawo" Adaptive integration for oscillatory functions .PP This function uses an adaptive algorithm to compute the integral of f over (a,b) with the weight function sin(omega*x) or cos(omega*x) \*(-- which of sine or cosine is used is determined by the parameter \f(CW$opt\fR ('cos' or 'sin'). The integral is estimated within the desired absolute and relative error limits, \f(CW$epsabs\fR and \f(CW$epsrel\fR. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 2 \& ($res,$abserr,$ierr) = gslinteg_qawo($function_ref,$omega,$sin_or_cos, \& $a,$b,$epsabs,$epsrel,$limit,[opt]) .Ve .PP Example: .PP .Vb 4 \& my $PI = 3.14159265358979323846264338328; \& my ($res,$abserr,$ierr) = PDL::GSL::INTEG::gslinteg_qawo(\e&f,10*$PI,\*(Aqsin\*(Aq,0,1,0,1e\-7,1000); \& # with warnings on \& ($res,$abserr,$ierr) = PDL::GSL::INTEG::gslinteg_qawo(\e&f,10*$PI,\*(Aqsin\*(Aq,0,1,0,1e\-7,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& if($x==0){return 0;} \& else{ return log($x);} \& } .Ve .SS "gslinteg_qawf" .IX Subsection "gslinteg_qawf" Adaptive integration for Fourier integrals .PP This function attempts to compute a Fourier integral of the function f over the semi-infinite interval [a,+\einfty). Specifically, it attempts tp compute I = \eint_a^{+\einfty} dx f(x)w(x), where w(x) is sin(omega*x) or cos(omega*x) \*(-- which of sine or cosine is used is determined by the parameter \f(CW$opt\fR ('cos' or 'sin'). The integral is estimated within the desired absolute error limit \f(CW$epsabs\fR. The maximum number of allowed subdivisions done by the adaptive algorithm must be supplied in the parameter \f(CW$limit\fR. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 1 \& gslinteg_qawf($function_ref,$omega,$sin_or_cos,$a,$epsabs,$limit,[opt]) .Ve .PP Example: .PP .Vb 3 \& my ($res,$abserr,$ierr) = gslinteg_qawf(\e&f,$PI/2.0,\*(Aqcos\*(Aq,0,1e\-7,1000); \& # with warnings on \& ($res,$abserr,$ierr) = gslinteg_qawf(\e&f,$PI/2.0,\*(Aqcos\*(Aq,0,1e\-7,1000,{Warn => \*(Aqy\*(Aq}); \& \& sub f{ \& my ($x) = @_; \& if ($x == 0){return 0;} \& return 1.0/sqrt($x) \& } .Ve .SH "BUGS" .IX Header "BUGS" Feedback is welcome. Log bugs in the \s-1PDL\s0 bug database (the database is always linked from ). .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1PDL\s0 .PP The \s-1GSL\s0 documentation is online at .PP .Vb 1 \& http://www.gnu.org/software/gsl/manual/ .Ve .SH "AUTHOR" .IX Header "AUTHOR" This file copyright (C) 2003,2005 Andres Jordan All rights reserved. There is no warranty. You are allowed to redistribute this software documentation under certain conditions. For details, see the file \&\s-1COPYING\s0 in the \s-1PDL\s0 distribution. If this file is separated from the \&\s-1PDL\s0 distribution, the copyright notice should be included in the file. .PP The \s-1GSL\s0 integration routines were written by Brian Gough. \s-1QUADPACK\s0 was written by Piessens, Doncker-Kapenga, Uberhuber and Kahaner.