.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DIFF 3pm" .TH DIFF 3pm "2023-06-17" "perl v5.36.0" "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::DIFF \- PDL interface to numerical differentiation routines in GSL .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is an interface to the numerical differentiation package present in the \&\s-1GNU\s0 Scientific Library. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use PDL; \& use PDL::GSL::DIFF; \& \& my $x0 = 3.3; \& \& my @res = gsldiff(\e&myfunction,$x0); \& # same as above: \& @res = gsldiff(\e&myfunction,$x0,{Method => \*(Aqcentral\*(Aq}); \& \& # use only values greater than $x0 to get the derivative \& @res = gsldiff(\e&myfunction,$x0,{Method => \*(Aqforward\*(Aq}); \& \& # use only values smaller than $x0 to get the derivative \& @res = gsldiff(\e&myfunction,$x0,{Method => \*(Aqbackward\*(Aq}); \& \& sub myfunction{ \& my ($x) = @_; \& return $x**2; \& } \&#line 61 "DIFF.pm" .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "diff_central" .IX Subsection "diff_central" .Vb 1 \& Signature: (double x(); double [o] res(); double [o] abserr(); SV* function) .Ve .PP info not available .PP diff_central does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS "diff_backward" .IX Subsection "diff_backward" .Vb 1 \& Signature: (double x(); double [o] res(); double [o] abserr(); SV* function) .Ve .PP info not available .PP diff_backward does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS "diff_forward" .IX Subsection "diff_forward" .Vb 1 \& Signature: (double x(); double [o] res(); double [o] abserr(); SV* function) .Ve .PP info not available .PP diff_forward does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS "gsldiff" .IX Subsection "gsldiff" This functions serves as an interface to the three differentiation functions present in \s-1GSL:\s0 gsl_diff_central, gsl_diff_backward and gsl_diff_forward. To compute the derivative, the central method uses values greater and smaller than the point at which the derivative is to be evaluated, while backward and forward use only values smaller and greater respectively. \fBgsldiff()\fR returns both the derivative and an absolute error estimate. The default method is 'central', others can be specified by passing an option. .PP Please check the \s-1GSL\s0 documentation for more information. .PP Usage: .PP .Vb 1 \& ($d,$abserr) = gsldiff($function_ref,$x,{Method => $method}); .Ve .PP Example: .PP .Vb 2 \& #derivative using default method (\*(Aqcentral\*(Aq) \& ($d,$abserr) = gsldiff(\e&myf,3.3); \& \& #same as above with method set explicitly \& ($d,$abserr) = gsldiff(\e&myf,3.3,{Method => \*(Aqcentral\*(Aq}); \& \& #using backward & forward methods \& ($d,$abserr) = gsldiff(\e&myf,3.3,{Method => \*(Aqbackward\*(Aq}); \& ($d,$abserr) = gsldiff(\e&myf,3.3,{Method => \*(Aqforward\*(Aq}); \& \& sub myf{ \& my ($x) = @_; \& return exp($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 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 differentiation routines were written by David Morrison.