2 SUBROUTINE dpchim (N, X, F, D, INCFD, IERR)
140 INTEGER N, INCFD, IERR
141 DOUBLE PRECISION X(*), F(INCFD,*), D(INCFD,*)
146 DOUBLE PRECISION DEL1, DEL2, DMAX, DMIN, DRAT1, DRAT2, DSAVE,
147 * H1, H2, HSUM, HSUMT3, THREE, W1, W2, ZERO
149 DOUBLE PRECISION DPCHST
150 DATA zero /0.d0/, three/3.d0/
155 IF ( n.LT.2 )
GO TO 5001
156 IF ( incfd.LT.1 )
GO TO 5002
158 IF ( x(i).LE.x(i-1) )
GO TO 5003
166 del1 = (f(1,2) - f(1,1))/h1
171 IF (nless1 .GT. 1)
GO TO 10
180 del2 = (f(1,3) - f(1,2))/h2
186 w1 = (h1 + hsum)/hsum
188 d(1,1) = w1*del1 + w2*del2
189 IF ( dpchst(d(1,1),del1) .LE. zero)
THEN
191 ELSE IF ( dpchst(del1,del2) .LT. zero)
THEN
194 IF (
abs(d(1,1)) .GT.
abs(dmax)) d(1,1) = dmax
200 IF (i .EQ. 2)
GO TO 40
206 del2 = (f(1,i+1) - f(1,i))/h2
212 IF ( dpchst(del1,del2) .LT. 0.)
GO TO 42
213 IF ( dpchst(del1,del2) .EQ. 0.)
GO TO 41
219 IF (del2 .EQ. zero)
GO TO 50
220 IF ( dpchst(dsave,del2) .LT. zero) ierr = ierr + 1
232 hsumt3 = hsum+hsum+hsum
233 w1 = (hsum + h1)/hsumt3
234 w2 = (hsum + h2)/hsumt3
239 d(1,i) = dmin/(w1*drat1 + w2*drat2)
247 w2 = (h2 + hsum)/hsum
248 d(1,n) = w1*del1 + w2*del2
249 IF ( dpchst(d(1,n),del2) .LE. zero)
THEN
251 ELSE IF ( dpchst(del1,del2) .LT. zero)
THEN
254 IF (
abs(d(1,n)) .GT.
abs(dmax)) d(1,n) = dmax
267 CALL xermsg (
'SLATEC',
'DPCHIM',
268 +
'NUMBER OF DATA POINTS LESS THAN TWO', ierr, 1)
274 CALL xermsg (
'SLATEC',
'DPCHIM',
'INCREMENT LESS THAN ONE', ierr,
281 CALL xermsg (
'SLATEC',
'DPCHIM',
282 +
'X-ARRAY NOT STRICTLY INCREASING', ierr, 1)
charNDArray max(char d, const charNDArray &m)
charNDArray min(char d, const charNDArray &m)
subroutine dpchim(N, X, F, D, INCFD, IERR)
subroutine xermsg(LIBRAR, SUBROU, MESSG, NERR, LEVEL)