PDL::GSL::DIFF3pm
Pdl interface to numerical differentiation routines in gsl
Usage
use PDL;use PDL::GSL::DIFF;my $x0 = 3.3;my @res = gsldiff(\&myfunction,$x0);# same as above:@res = gsldiff(\&myfunction,$x0,{Method => 'central'});# use only values greater than $x0 to get the derivative@res = gsldiff(\&myfunction,$x0,{Method => 'forward'});# use only values smaller than $x0 to get the derivative@res = gsldiff(\&myfunction,$x0,{Method => 'backward'});sub myfunction{my ($x) = @_;return $x**2;}#line 61 "DIFF.pm"
Overview
This is an interface to the numerical differentiation package present in the GNU Scientific Library.
Functions
diff_central
Signature: (double x(); double [o] res(); double [o] abserr(); SV* function)
info not available
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.
diff_backward
Signature: (double x(); double [o] res(); double [o] abserr(); SV* function)
info not available
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.
diff_forward
Signature: (double x(); double [o] res(); double [o] abserr(); SV* function)
info not available
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.
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. gsldiff() returns both the derivative and an absolute error estimate. The default method is 'central', others can be specified by passing an option.
Please check the GSL documentation for more information.
Usage:
($d,$abserr) = gsldiff($function_ref,$x,{Method => $method});
Example:
#derivative using default method ('central')($d,$abserr) = gsldiff(\&myf,3.3);#same as above with method set explicitly($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'central'});#using backward & forward methods($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'backward'});($d,$abserr) = gsldiff(\&myf,3.3,{Method => 'forward'});sub myf{my ($x) = @_;return exp($x);}
Releases
10 releases since Debian 3.1 (Sarge); the text changed 9 times.