INTERPSection: User Contributed Perl Documentation (3)Updated: 2004-06-15 |
INTERPSection: User Contributed Perl Documentation (3)Updated: 2004-06-15 |
use PDL; use PDL::GSL::INTERP;
my $x = sequence(10); my $y = exp($x);
my $spl = PDL::GSL::INTERP->init('cspline',$x,$y);
my $res = $spl->eval(4.35); $res = $spl->deriv(4.35); $res = $spl->deriv2(4.35); $res = $spl->integ(2.1,7.4);
The available interpolation types are :
Please check the GSL documentation for more information.
Usage:
$blessed_ref = PDL::GSL::INTERP->init($interp_method,$x,$y,$opt);
Example:
$x = sequence(10);
$y = exp($x);
$spl = PDL::GSL::INTERP->init('cspline',$x,$y)
$spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 1}) #same as above
# no sorting done on x, user is certain that x is monotonically increasing
$spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0});
Usage:
$result = $spl->eval($points,$opt);
Example:
my $res = $spl->eval($x)
$res = $spl->eval($x,{Extrapolate => 0}) #same as above
# silently comply if $x is out of range
$res = $spl->eval($x,{Extrapolate => 1})
Usage:
$result = $spl->deriv($points,$opt);
Example:
my $res = $spl->deriv($x)
$res = $spl->deriv($x,{Extrapolate => 0}) #same as above
# silently comply if $x is out of range
$res = $spl->deriv($x,{Extrapolate => 1})
Usage:
$result = $spl->deriv2($points,$opt);
Example:
my $res = $spl->deriv2($x)
$res = $spl->deriv2($x,{Extrapolate => 0}) #same as above
# silently comply if $x is out of range
$res = $spl->deriv2($x,{Extrapolate => 1})
Usage:
$result = $spl->integ($a,$b,$opt);
Example:
my $res = $spl->integ($a,$b)
$res = $spl->integ($a,$b,{Extrapolate => 0}) #same as above
# silently comply if $a or $b are out of range
$res = $spl->eval($a,$b,{Extrapolate => 1})
The GSL documentation is online at
http://sources.redhat.com/gsl/ref/gsl-ref_toc.html
The GSL interpolation module was written by Gerard Jungman.