[Perldl] cspline does not extrapolate?

chm devel.chm.01 at gmail.com
Thu Feb 9 14:37:11 HST 2012


On 2/9/2012 6:01 PM, InSuk Joung wrote:
> use strict;
> use warnings;
> use PDL;
> use PDL::GSL::INTERP;
>
> my $x = sequence(10);
> my $y = $x**2;
>
> my $spl = PDL::GSL::INTERP->init( 'cspline', $x, $y );
> print $spl->eval( -1, {Extrapolate=>1} ), "\n";

The problem with the exception handler appears
to have been fixed since the PDL-2.4.7 release
(according to the git log).  To avoid the problem
you'll need to avoid out-of-domain values for the
input parameter being evaluated or switch to PDL
version 2.4.8 or newer (the PDL-2.4.10 release
this week has many bugs fixed and new features!).
I ran your test code on 2.4.10 and the result
was nan with no error as expected.

--Chris




More information about the Perldl mailing list