.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 2024-02-05 "perl v5.38.2" "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 GNU 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 GSL: 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 GSL 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 PDL bug database (the database is always linked from ). .SH "SEE ALSO" .IX Header "SEE ALSO" PDL .PP The GSL 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 COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. .PP The GSL differentiation routines were written by David Morrison.