| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 | *DECK PPVAL      FUNCTION PPVAL (LDC, C, XI, LXI, K, IDERIV, X, INPPV)C***BEGIN PROLOGUE  PPVALC***PURPOSE  Calculate the value of the IDERIV-th derivative of theC            B-spline from the PP-representation.C***LIBRARY   SLATECC***CATEGORY  E3, K6C***TYPE      SINGLE PRECISION (PPVAL-S, DPPVAL-D)C***KEYWORDS  B-SPLINE, DATA FITTING, INTERPOLATION, SPLINESC***AUTHOR  Amos, D. E., (SNLA)C***DESCRIPTIONCC     Written by Carl de Boor and modified by D. E. AmosCC     AbstractC         PPVAL is the PPVALU function of the reference.CC         PPVAL calculates (at X) the value of the IDERIV-thC         derivative of the B-spline from the PP-representationC         (C,XI,LXI,K).  The Taylor expansion about XI(J) for X inC         the interval XI(J) .LE. X .LT. XI(J+1) is evaluated, J=1,LXI.C         Right limiting values at X=XI(J) are obtained.  PPVAL willC         extrapolate beyond XI(1) and XI(LXI+1).CC         To obtain left limiting values (left derivatives) at XI(J),C         replace LXI by J-1 and set X=XI(J),J=2,LXI+1.CC     Description of ArgumentsC         InputC          LDC     - leading dimension of C matrix, LDC .GE. KC          C       - matrix of dimension at least (K,LXI) containingC                    right derivatives at break points XI(*).C          XI      - break point vector of length LXI+1C          LXI     - number of polynomial piecesC          K       - order of B-spline, K .GE. 1C          IDERIV  - order of the derivative, 0 .LE. IDERIV .LE. K-1C                    IDERIV=0 gives the B-spline valueC          X       - argument, XI(1) .LE. X .LE. XI(LXI+1)C          INPPV   - an initialization parameter which must be setC                    to 1 the first time PPVAL is called.CC         OutputC          INPPV   - INPPV contains information for efficient process-C                    ing after the initial call and INPPV must notC                    be changed by the user.  Distinct splines requireC                    distinct INPPV parameters.C          PPVAL   - value of the IDERIV-th derivative at XCC     Error ConditionsC         Improper input is a fatal errorCC***REFERENCES  Carl de Boor, Package for calculating with B-splines,C                 SIAM Journal on Numerical Analysis 14, 3 (June 1977),C                 pp. 441-472.C***ROUTINES CALLED  INTRV, XERMSGC***REVISION HISTORY  (YYMMDD)C   800901  DATE WRITTENC   890531  Changed all specific intrinsics to generic.  (WRB)C   890831  Modified array declarations.  (WRB)C   890831  REVISION DATE from Version 3.2C   891214  Prologue converted to Version 4.0 format.  (BAB)C   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)C   920501  Reformatted the REFERENCES section.  (WRB)C***END PROLOGUE  PPVALC      INTEGER I, IDERIV, INPPV, J, K, LDC, LXI, NDUMMY      REAL C, DX, FLTK, X, XI      DIMENSION XI(*), C(LDC,*)C***FIRST EXECUTABLE STATEMENT  PPVAL      PPVAL = 0.0E0      IF(K.LT.1) GO TO 90      IF(LDC.LT.K) GO TO 80      IF(LXI.LT.1) GO TO 85      IF(IDERIV.LT.0 .OR. IDERIV.GE.K) GO TO 95      I = K - IDERIV      FLTK = I      CALL INTRV(XI, LXI, X, INPPV, I, NDUMMY)      DX = X - XI(I)      J = K   10 PPVAL = (PPVAL/FLTK)*DX + C(J,I)      J = J - 1      FLTK = FLTK - 1.0E0      IF (FLTK.GT.0.0E0) GO TO 10      RETURNCC   80 CONTINUE      CALL XERMSG ('SLATEC', 'PPVAL', 'LDC DOES NOT SATISFY LDC.GE.K',     +   2, 1)      RETURN   85 CONTINUE      CALL XERMSG ('SLATEC', 'PPVAL', 'LXI DOES NOT SATISFY LXI.GE.1',     +   2, 1)      RETURN   90 CONTINUE      CALL XERMSG ('SLATEC', 'PPVAL', 'K DOES NOT SATISFY K.GE.1', 2,     +   1)      RETURN   95 CONTINUE      CALL XERMSG ('SLATEC', 'PPVAL',     +   'IDERIV DOES NOT SATISFY 0.LE.IDERIV.LT.K', 2, 1)      RETURN      END
 |