next up previous 196
Next: Replacing calls to E02BEF
Up: One-dimensional Interpolation and Fitting, Splines
Previous: Replacing calls to E02BCF


Replacing calls to E02BDF

PDA_DBSQAD has not yet been used anywhere to replace E02BDF. Thus the migration hints given here may contain errors or may be based on misunderstandings.

The equivalent of this routine in SLATEC is PDA_DBSQAD. The NAG code would look like

      INTEGER N, IFAIL
      DOUBLE PRECISION T(N+7), C(N+7), DEFINT
      IFAIL = 1
      CALL E02BDF( N+7, T, C, DEFINT, IFAIL )
      IF ( IFAIL .NE. 0 ) THEN
         An error has occurred
      END IF

Here N, T and C are the same as in E02BAF. If T and C originate from a call to E01BAF then for N+7 read M+4 with M the number of data points given to the interpolation. DEFINT returns the integral over the whole x range where the spline is defined. This is from T(4) to T(N+4), which are most probably the smallest and largest X used in the fit or interpolation.

The dimension passed to PDA_DBSQAD is not that of T, but that of C, i.e. N+3 (or M after interpolation). PDA_DBSQAD calculates the integral for any interval on which the spline is defined. For the same interval as in the NAG code, the two limiting knots are given to PDA_DBSQAD.

      INTEGER K, N
      PARAMETER ( K = 4 )
      DOUBLE PRECISION T(N+K+3), C(N+3), DEFINT
      DOUBLE PRECISION WORK(3*K)
      CALL PDA_DBSQAD( T, C, N+3, K, T(4), T(N+4), DEFINT, WORK, IFAIL )
      IF ( IFAIL .NE. 0 ) THEN
         An error has occurred
      END IF



next up previous 196
Next: Replacing calls to E02BEF
Up: One-dimensional Interpolation and Fitting, Splines
Previous: Replacing calls to E02BCF

PDA [1ex
Starlink User Note 194
H. Meyerdierks, D. Berry, P. W. Draper, G. Privett, M. Currie
12th October 2005
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council