

Interpolate => Linear 
An extravagent way of calling the linear interpolation routine
PDL::Primitive::interpolate.
The valid attributes are:
Attribute Flag Description x sgr x positions of data y sgr function values at x positions err g error flag 
Interpolate => Hermite 
Use the piecewice cubic Hermite interpolation routines
from the SLATEC library.
Only available if PDL::Slatec is installed.
The valid attributes are:
Attribute Flag Description x sgr x positions of data y sgr function values at x positions bc sgr boundary conditions g g estimated gradient at x positions err g error flag Given the initial set of points (x,y), an estimate of the gradient is made at these points, using the given boundary conditions. The gradients are stored in the g attribute, accessible via:
$gradient = $obj>get( g ); However, as this gradient is only calculated ’at the last moment’, g will only contain data after one of interpolate, gradient, or integrate is used. 
If your data is monotonic, and you are not too bothered about edge effects, then the default value of bc of simple is for you. Otherwise, take a look at the description of PDL::Slatec::chic and use a hash reference for the bc attribute, with the following keys:An example would be
monotonic 0 if the interpolant is to be monotonic in each interval (so the gradient will be 0 at each switch point), otherwise the gradient is calculated using a 3point difference formula at switch points. If > 0 then the interpolant is forced to lie close to the data, if < 0 no such control is imposed. Default = <B>0B>. start A perl list of one or two elements. The first element defines how the boundary condition for the start of the array is to be calculated; it has a range of 5 .. 5, as given for the ic parameter of chic. The second element, only used if options 2, 1, 1, or 2 are chosen, contains the value of the vc parameter. Default = <B>[ 0 ]B>. end As for start, but for the end of the data.
$obj>set( bc => { start => [ 1, 0 ], end => [ 1, 1 ] } )which sets the first derivative at the first point to 0, and at the last point to 1.
The status method provides a simple mechanism to check if the previous method was successful. If the function returns an error flag, then it is stored in the err attribute. To find out which routine was used, use the routine method.
$obj = PDL::Func>init( Interpolate => "Hermite", x => $x, y => $y ); $obj = PDL::Func>init( { x => $x, y => $y } );Create a PDL::Func object, which can interpolate, and possibly integrate and calculate gradients of a dataset.
If not specified, the value of Interpolate is taken to be Linear, which means the interpolation is performed by PDL::Primitive::interpolate. A value of Hermite uses piecewise cubic Hermite functions, which also allows the integral and gradient of the data to be estimated.
Options can either be provided directly to the method, as in the first example, or within a hash reference, as shown in the second example.
my $nset = $obj>set( x => $newx, y => $newy ); my $nset = $obj>set( { x => $newx, y => $newy } );Set attributes for a PDL::Func object.
The return value gives the number of the supplied attributes which were actually set.
my $x = $obj>get( x ); my ( $x, $y ) = $obj>get( qw( x y ) );Get attributes from a PDL::Func object.
Given a list of attribute names, return a list of their values; in scalar mode return a scalar value. If the supplied list contains an unknown attribute, get returns a value of undef for that attribute.
my $scheme = $obj>scheme;Return the type of interpolation of a PDL::Func object.
Returns either Linear or Hermite.
my $status = $obj>status;Returns the status of a PDL::Func object.
This method provides a highlevel indication of the success of the last method called (except for get which is ignored). Returns <B>1B> if everything is okay, <B>0B> if there has been a serious error, and <B>1B> if there was a problem which was not serious. In the latter case, $obj>get("err") may provide more information, depending on the particular scheme in use.
my $name = $obj>routine;Returns the name of the last routine called by a PDL::Func object.
This is mainly useful for decoding the value stored in the err attribute.
$obj>attributes; PDL::Func>attributes;Print out the flags for the attributes of a PDL::Func object.
Useful in case the documentation is just too opaque!
PDL::Func>attributes; Flags Attribute SGR x SGR y G err
my $yi = $obj>interpolate( $xi );Returns the interpolated function at a given set of points (PDL::Func).
A status value of 1, as returned by the status method, means that some of the $xi points lay outside the range of the data. The values for these points were calculated by extrapolation (the details depend on the scheme being used).
my $gi = $obj>gradient( $xi ); my ( $yi, $gi ) = $obj>gradient( $xi );Returns the derivative and, optionally, the interpolated function for the Hermite scheme (PDL::Func).
my $ans = $obj>integrate( index => pdl( 2, 5 ) ); my $ans = $obj>integrate( x => pdl( 2.3, 4.5 ) );Integrate the function stored in the PDL::Func object, if the scheme is Hermite.
The integration can either be between points of the original x array (index), or arbitrary x values (x). For both cases, a two element piddle should be given, to specify the start and end points of the integration.
If the status method returns a value of 1, then one or both of the integration limits did not lie inside the x array. Caveat emptor with the result in such a case.
index The values given refer to the indices of the points in the x array. x The array contains the actual values to integrate between.
It should be relatively easy to provide an interface to other interpolation routines, such as those provided by the Gnu Scientific Library (GSL), or the Bspline routines in the SLATEC library.In the documentation, the methods are preceeded by PDL::Func:: to avoid clashes with functions such as set when using the help or apropos commands within perldl or pdl2.
Amalgamated PDL::Interpolate and PDL::Interpolate::Slatec to form PDL::Func. Comments greatly appreciated on the current implementation, as it is not too sensible.Thanks to Robin Williams, Halldór Olafsson, and Vince McIntyre.
Copyright (C) 2000,2001 Doug Burke (dburke@cfa.harvard.edu). All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation as described in the file COPYING in the PDL distribution.
perl v5.20.3  FUNC (3)  20151003 
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.