|
|
1.1 root 1: subroutine tl2fit(nx,ny,nn,d,w,c)
2: c planar l2 fit - tensor grid version
3: c input:
4: c nx = number of points in x
5: c ny = number of points in y
6: c nn = nx*ny
7: c d = data points
8: c on output, d(*,*) contains residuals
9: c w = workspace, of size 6*n*n
10: c internal blocking:
11: c 1..3 x
12: c 4 y
13: c 5 qraux
14: c 6 qty
15: c c = coefficients c(1) + c(2)*x + c(3)*y
16: integer i, j, k, n
17: real c(3), w(nn,6), d(nx,ny), z
18: integer i,info
19: k=1
20: do 100 i=1,nx
21: do 100 j=1,ny
22: w(k,1)=1
23: w(k,2)=(i-1)/(nx-1.)
24: w(k,3)=(j-1)/(ny-1.)
25: w(k,4)=d(i,j)
26: k=k+1
27: 100 continue
28: call sqrdc(w,nn,nn,3,w(1,5),z,z,0)
29: call sqrsl(w,nn,nn,3,w(1,5),w(1,4),z,w(1,6),c,z,z,100,info)
30: if(info.ne.0)then
31: write(6,1001) info
32: 1001 format(' sqrsl abort. info=',i5)
33: stop
34: end if
35: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.