INTERP.pm (PDL-2.081) | : | INTERP.pm (PDL-2.082) | ||
---|---|---|---|---|
skipping to change at line 61 | skipping to change at line 61 | |||
C<b>. Since good Perl coding practices discourage the use of Perl | C<b>. Since good Perl coding practices discourage the use of Perl | |||
variables C<$a> and C<$b>, here we refer to Parameters C<a> and C<b> | variables C<$a> and C<$b>, here we refer to Parameters C<a> and C<b> | |||
as C<$pa> and C<$pb>, respectively, and Limits (of domain or | as C<$pa> and C<$pb>, respectively, and Limits (of domain or | |||
integration) as C<$la> and C<$lb>. | integration) as C<$la> and C<$lb>. | |||
#line 63 "INTERP.pm" | #line 63 "INTERP.pm" | |||
=head1 FUNCTIONS | =head1 FUNCTIONS | |||
=cut | =cut | |||
#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
=head2 init | =head2 init | |||
=for sig | =for sig | |||
Signature: (double x(n); double y(n); gsl_spline *spl) | Signature: (double x(n); double y(n); gsl_spline *spl) | |||
=for ref | =for ref | |||
The init method initializes a new instance of INTERP. It needs as | The init method initializes a new instance of INTERP. It needs as | |||
skipping to change at line 125 | skipping to change at line 125 | |||
$spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); | $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); | |||
=for bad | =for bad | |||
init does not process bad values. | init 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 143 "INTERP.pm" | #line 143 "INTERP.pm" | |||
#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
sub init { | sub init { | |||
my $opt; | my $opt; | |||
if (ref($_[$#_]) eq 'HASH'){ $opt = pop @_; } | if (ref($_[$#_]) eq 'HASH'){ $opt = pop @_; } | |||
else{ $opt = {Sort => 1}; } | else{ $opt = {Sort => 1}; } | |||
my ($class,$type,$x,$y) = @_; | my ($class,$type,$x,$y) = @_; | |||
if( (ref($x) ne 'PDL') || (ref($y) ne 'PDL') ){ | if( (ref($x) ne 'PDL') || (ref($y) ne 'PDL') ){ | |||
barf("Have to pass ndarrays as arguments to init method\n"); | barf("Have to pass ndarrays as arguments to init method\n"); | |||
} | } | |||
if($$opt{Sort} != 0){ | if($$opt{Sort} != 0){ | |||
skipping to change at line 149 | skipping to change at line 149 | |||
} | } | |||
my $ene = nelem($x); | my $ene = nelem($x); | |||
my $obj1 = new_spline($type,$ene); | my $obj1 = new_spline($type,$ene); | |||
my $obj2 = new_accel(); | my $obj2 = new_accel(); | |||
_init_int($x,$y,$$obj1); | _init_int($x,$y,$$obj1); | |||
my @ret_a = ($obj1,$obj2); | my @ret_a = ($obj1,$obj2); | |||
return bless(\@ret_a, $class); | return bless(\@ret_a, $class); | |||
} | } | |||
#line 169 "INTERP.pm" | #line 169 "INTERP.pm" | |||
#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
*init = \&PDL::GSL::INTERP::init; | *init = \&PDL::GSL::INTERP::init; | |||
#line 176 "INTERP.pm" | #line 176 "INTERP.pm" | |||
#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
=head2 eval | =head2 eval | |||
=for sig | =for sig | |||
Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *ac c) | Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *ac c) | |||
=for ref | =for ref | |||
The function eval returns the interpolating function at a given point. | The function eval returns the interpolating function at a given point. | |||
skipping to change at line 187 | skipping to change at line 187 | |||
my $res = $spl->eval($x) | my $res = $spl->eval($x) | |||
=for bad | =for bad | |||
eval processes bad values. | eval processes bad values. | |||
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 216 "INTERP.pm" | #line 216 "INTERP.pm" | |||
#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
sub eval { | sub eval { | |||
my $opt; | my $opt; | |||
my ($obj,$x) = @_; | my ($obj,$x) = @_; | |||
my $s_obj = $$obj[0]; | my $s_obj = $$obj[0]; | |||
my $a_obj = $$obj[1]; | my $a_obj = $$obj[1]; | |||
_eval_int($x,my $o=PDL->null,$$s_obj,$$a_obj); | _eval_int($x,my $o=PDL->null,$$s_obj,$$a_obj); | |||
$o; | $o; | |||
} | } | |||
#line 230 "INTERP.pm" | #line 230 "INTERP.pm" | |||
#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
*eval = \&PDL::GSL::INTERP::eval; | *eval = \&PDL::GSL::INTERP::eval; | |||
#line 237 "INTERP.pm" | #line 237 "INTERP.pm" | |||
#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
=head2 deriv | =head2 deriv | |||
=for sig | =for sig | |||
Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *ac c) | Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *ac c) | |||
=for ref | =for ref | |||
The deriv function returns the derivative of the | The deriv function returns the derivative of the | |||
skipping to change at line 238 | skipping to change at line 238 | |||
my $res = $spl->deriv($x) | my $res = $spl->deriv($x) | |||
=for bad | =for bad | |||
deriv does not process bad values. | deriv 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 278 "INTERP.pm" | #line 278 "INTERP.pm" | |||
#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
sub deriv { | sub deriv { | |||
my ($obj,$x) = @_; | my ($obj,$x) = @_; | |||
my $s_obj = $$obj[0]; | my $s_obj = $$obj[0]; | |||
my $a_obj = $$obj[1]; | my $a_obj = $$obj[1]; | |||
_deriv_int($x,my $o=PDL->null,$$s_obj,$$a_obj); | _deriv_int($x,my $o=PDL->null,$$s_obj,$$a_obj); | |||
$o; | $o; | |||
} | } | |||
#line 291 "INTERP.pm" | #line 291 "INTERP.pm" | |||
#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
*deriv = \&PDL::GSL::INTERP::deriv; | *deriv = \&PDL::GSL::INTERP::deriv; | |||
#line 298 "INTERP.pm" | #line 298 "INTERP.pm" | |||
#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
=head2 deriv2 | =head2 deriv2 | |||
=for sig | =for sig | |||
Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *ac c) | Signature: (double x(); double [o] out(); gsl_spline *spl;gsl_interp_accel *ac c) | |||
=for ref | =for ref | |||
The deriv2 function returns the second derivative | The deriv2 function returns the second derivative | |||
skipping to change at line 288 | skipping to change at line 288 | |||
my $res = $spl->deriv2($x) | my $res = $spl->deriv2($x) | |||
=for bad | =for bad | |||
deriv2 does not process bad values. | deriv2 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 339 "INTERP.pm" | #line 339 "INTERP.pm" | |||
#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
sub deriv2 { | sub deriv2 { | |||
my ($obj,$x) = @_; | my ($obj,$x) = @_; | |||
my $s_obj = $$obj[0]; | my $s_obj = $$obj[0]; | |||
my $a_obj = $$obj[1]; | my $a_obj = $$obj[1]; | |||
_deriv2_int($x,my $o=PDL->null,$$s_obj,$$a_obj); | _deriv2_int($x,my $o=PDL->null,$$s_obj,$$a_obj); | |||
$o; | $o; | |||
} | } | |||
#line 352 "INTERP.pm" | #line 352 "INTERP.pm" | |||
#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
*deriv2 = \&PDL::GSL::INTERP::deriv2; | *deriv2 = \&PDL::GSL::INTERP::deriv2; | |||
#line 359 "INTERP.pm" | #line 359 "INTERP.pm" | |||
#line 949 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 958 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
=head2 integ | =head2 integ | |||
=for sig | =for sig | |||
Signature: (double a(); double b(); double [o] out(); gsl_spline *spl;gsl_inte rp_accel *acc) | Signature: (double a(); double b(); double [o] out(); gsl_spline *spl;gsl_inte rp_accel *acc) | |||
=for ref | =for ref | |||
The integ function returns the integral | The integ function returns the integral | |||
skipping to change at line 338 | skipping to change at line 338 | |||
my $res = $spl->integ($la,$lb) | my $res = $spl->integ($la,$lb) | |||
=for bad | =for bad | |||
integ does not process bad values. | integ 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 400 "INTERP.pm" | #line 400 "INTERP.pm" | |||
#line 950 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 959 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
sub integ { | sub integ { | |||
my ($obj,$la,$lb) = @_; | my ($obj,$la,$lb) = @_; | |||
my $s_obj = $$obj[0]; | my $s_obj = $$obj[0]; | |||
my $a_obj = $$obj[1]; | my $a_obj = $$obj[1]; | |||
_integ_int($la,$lb,my $o=PDL->null,$$s_obj,$$a_obj); | _integ_int($la,$lb,my $o=PDL->null,$$s_obj,$$a_obj); | |||
$o; | $o; | |||
} | } | |||
#line 413 "INTERP.pm" | #line 413 "INTERP.pm" | |||
#line 951 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | #line 960 "/home/osboxes/pdl-code/blib/lib/PDL/PP.pm" | |||
*integ = \&PDL::GSL::INTERP::integ; | *integ = \&PDL::GSL::INTERP::integ; | |||
#line 420 "INTERP.pm" | #line 420 "INTERP.pm" | |||
#line 45 "gsl_interp.pd" | #line 45 "gsl_interp.pd" | |||
=head1 BUGS | =head1 BUGS | |||
Feedback is welcome. | Feedback is welcome. | |||
End of changes. 15 change blocks. | ||||
15 lines changed or deleted | 15 lines changed or added |