Re: FORTRAN TYPE construct?



michael@xxxxxxxxxxxxxxxx wrote:
Andrew:
Cubic Spline interpolation routines (it is better to use Shape
preserving Cubic Splines ), in general require two arrays a(n) and
b(4,n) that hold the calculated coefficients of the splines. N is the
number of points you wish to interpoalte.
So make sure that you allocate enough space to hold these coefficients

That was my thought, too, so I looked in my Numerical Recipes.

It seems that NR has routines named SPLINE and SPLINT, though I
only have the original (Fortran 77) version of the book.
Instead of returning the four spline coefficients, they return the
second derivative of the spline function at each point.
It seems to be easy to interpolate the cubic spline value from
the Y and Y'' values at the two nearest points.

The Fortran 77 version has a call like:

CALL SPLINE(X,Y,N,YP1,YPN,Y2)

with X, Y, and Y2 dimensioned N. YP1 and YPN are the input
first derivative at the end points, or 1e30 to set the second
derivative to zero at the end for a natural spline.

A newer version presumably doesn't need N, but should still need
YP1 and YPN.

-- glen
.



Relevant Pages

  • Re: Interpolation : value at endpoint.
    ... interpolation problematics at the boundaries of interpolation ... The name spline itself goes back to this same thin ... The traditional cubic spline is a C2 ... knot and the penultimate knot, ...
    (comp.soft-sys.matlab)
  • Re: Confusion about splitting classes to allow sharing of resources
    ... I have a working Spline ... >> Along with the splines for x and y, the Curve class also has one ... >> Adding new interpolation variables in subclasses of Curve will then ... instantiate the relevant Nodes and add them to the R5 ...
    (comp.object)
  • Re: Confusion about splitting classes to allow sharing of resources
    ... Then the Spline would ... actual interpolation to the algorithm de jour one set of points at a time. ... regeneration behavior since it is the only one that uses the data. ...
    (comp.object)
  • Re: Confusion about splitting classes to allow sharing of resources
    ... > both the algorithm and the data. ... Then the Spline would ... > between spline flavors are the interpolation algorithm, ... It's the responsibility of this 'somebody' I am still a bit confused ...
    (comp.object)
  • Re: Numerical integration at arbitrary x
    ... >> unknown positions using a high order local interpolation. ... >> with the grid halved and applied tio the spline in order to get the ... >> you also could use a nonequidistant fft for smoothing, ... depending on the integration order you end up selecting. ...
    (sci.math.num-analysis)