1 subroutine splopt ( tau, n, k, scrtch, t, iflag )
62 integer iflag,k,n, i,id,index,j,km1,kpk,kpkm1,kpn,kp1,l,left
63 &,leftmk,lenw,ll,llmax,llmin,na,nb,nc,nd,newtmx,newton,nmk,nmkm1,nx
64 double precision scrtch(1),t(1),tau(n),
65 & del,delmax,floatk,sign,signst,sum
71 data newtmx,tolrte / 10,0.000001d+00/
75 601
format(13h argument n =,i4,29h in
splopt is less than k =,i3)
77 2
if (k .gt. 2)
go to 3
79 602
format(13h argument k =,i3,27h in
splopt is less than 3)
89 if (nmk .gt. (nmk/2)*2) signst = 1.0d+00
106 5 scrtch(kpn+j) = tau(n)
108 6 scrtch(k+j) = tau(j)
111 scrtch(nmk+1+nx) = tau(n)
115 9 sum = sum + tau(j+l)
116 10 scrtch(j+nx) = sum/dble(km1)
121 tol = tolrte*(tau(n) - tau(1))/dble(nmk)
126 21 scrtch(i+nc) = 0.0d+00
128 22 scrtch(i-1+na) = 0.0d+00
133 23
if (xij .lt. scrtch(left+1))
go to 25
135 if (left .lt. kpn)
go to 23
137 25
call bsplvb(scrtch,k,1,xij,left,scrtch(1+nb))
149 index = leftmk-j + (j-1)*kpkm1 + nc
150 llmin = max0(1,k-leftmk)
151 llmax = min0(k,n-leftmk)
153 26 scrtch(ll+index) = scrtch(ll+nb)
154 call bsplvb(scrtch,kp1,2,xij,left,scrtch(1+nb))
155 id = max0(0,leftmk-kp1)
156 llmin = 1 - min0(0,leftmk-kp1)
159 27 scrtch(id+na) = scrtch(id+na) - sign*scrtch(ll+nb)
161 call banfac(scrtch(1+nc),kpkm1,nmk,km1,km1,iflag)
164 644
format(32h c in
splopt is not invertible)
168 46 scrtch(i-1+na) = scrtch(i-1+na) + scrtch(i+na)
170 if (i .gt. 1)
go to 46
172 49 scrtch(i+nd) = scrtch(i+na)*(tau(i+k)-tau(i))/floatk
174 call banslv(scrtch(1+nc),kpkm1,nmk,km1,km1,scrtch(1+nd))
181 del = sign*scrtch(i+nd)
182 delmax = dmax1(delmax,dabs(del))
183 if (del .gt. 0.0d+00)
go to 51
184 del = dmax1(del,(scrtch(i-1+nx)-scrtch(i+nx))/3.0d+00)
186 51 del = dmin1(del,(scrtch(i+1+nx)-scrtch(i+nx))/3.0d+00)
188 53 scrtch(i+nx) = scrtch(i+nx) + del
191 if (delmax .lt. tol)
go to 54
193 if (newton .le. newtmx)
go to 20
195 653
format(33h no convergence in
splopt after,i3,14h newton steps.)
197 55 t(k+i) = scrtch(i+nx)
subroutine banslv(w, nroww, nrow, nbandl, nbandu, b)
subroutine banfac(w, nroww, nrow, nbandl, nbandu, iflag)
subroutine bsplvb(t, jhigh, index, x, left, biatx)
subroutine splopt(tau, n, k, scrtch, t, iflag)