|
|
1.1 root 1: subroutine l2fit(n,nn,ld,d,w,c)
2: c planar l2 fit
3: c input:
4: c n = number of points in each direction
5: c nn = n**2
6: c ld = declared dimension of d
7: c d = data points
8: c on output, d(3,*,*) 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(3,ld,ld), z
18: integer i,info
19: k=1
20: do 100 i=1,n
21: do 100 j=1,n
22: w(k,1)=1
23: w(k,2)=d(1,i,j)
24: w(k,3)=d(2,i,j)
25: w(k,4)=d(3,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.