1 SUBROUTINE DCPOSE
(NDIM
,N
,QR
,ALPHA
,PIVOT
,IERR
,Y
,SUM
)
3 C SUBROUTINE DCPOSE IS A MODIFICATION OF THE ALGOL PROCEDURE
4 C DECOMPOSE IN P. BUSINGER AND G. H. GOLUB, LINEAR LEAST
5 C SQUARES SOLUTIONS BY HOUSEHOLDER TRANSFORMATIONS,
6 C NUMER. MATH. 7 (1965) 269-276.
8 INTEGER NDIM
,N
,PIVOT
(1)
9 DOUBLE PRECISION QR
(NDIM
,1),ALPHA
(N
)
10 INTEGER IERR
,I
,J
,JBAR
,K
,KP1
,NP1
11 DOUBLE PRECISION BETA
,SIGMA
,ALPHAK
,QRKK
,Y
(1),SUM
(1)
16 SUM
(J
)=DDOT
(N
,QR
(1,J
),1,QR
(1,J
),1)
23 IF (SIGMA
.GE
. SUM
(J
)) GO TO 40
27 IF (JBAR
.EQ
. K
) GO TO 70
38 C END OF COLUMN INTERCHANGE.
39 70 SIGMA
=DDOT
(N
-K
+1,QR
(K
,K
),1,QR
(K
,K
),1)
40 IF (SIGMA
.NE
. 0.0) GO TO 60
43 60 IF (K
.EQ
. N
) GO TO 500
46 IF (QRKK
.LT
. 0.0) ALPHAK
=-ALPHAK
48 BETA
=1.0/(SIGMA
-QRKK*ALPHAK
)
51 80 Y
(J
)=BETA*DDOT
(N
-K
+1,QR
(K
,K
),1,QR
(K
,J
),1)
54 QR
(I
,J
)=QR
(I
,J
)-QR
(I
,K
)*Y
(J
)
56 SUM
(J
)=SUM
(J
)-QR
(K
,J
)**2