#15 PDL::Func issues

feature_request
closed-fixed
nobody
other (94)
5
2001-02-28
2001-02-21
Doug Burke
No

As reported by Halldór Olafsson and Vince McIntyre,
there's typo(s) in PDL::Func.

The error was that line 845 in the file Func.pm read
unless $self->{flags}{Integrate} eq "Hermite";
while it should read (as far as I gather)
unless $self->{flags}{scheme} eq "Hermite";

Also, documentation inadequacies:

In the documenation for ::init, you write

PDL::Func::init

$obj = init PDL::Func( Interpolate => "Hermite", x => $x, y => $y );
$obj = init PDL::Func( { x => $x, y => $y } );

I don't understand why the {} in the second example.
They seem to be allowed, (ie $obj->status = 1, but are they needed?)
I ask because I misread this at first and tried to do

use PDL::Func;
use PDL::Slatec;
($x,$y) = rcols('spectrum.txt');
$obj = init PDL::Func( { Interpolate => "Hermite", x => $x, y => $y } );

(I was going to integrate y(x)).

and

when you try to integrate with scheme==linear:

$obj = init PDL::Func( x => $x, y=>$y );
print $obj->integrate( x=> pdl (4200,4300) );
Error: can not call integrate for Integrate => "Linear".

is not that helpful when you're struggling to learn. Should it not read
Error: can not call integrate for Interpolate => "Linear".
or
Error: Interpolate => "Linear". Can only call integrate for
Interpolate=>"Hermite"

Discussion

  • Doug Burke
    Doug Burke
    2001-02-28

    Logged In: YES
    user_id=7154

    Changes have made to the CVS version (27 Feb 01).

    As an aside:
    $obj = init PDL::Func( { Interpolate => "Hermite", x => $x,
    y => $y });

    should work (if not, then it's a bug).

     
  • Doug Burke
    Doug Burke
    2001-02-28

    • status: open --> closed-fixed