1 SUBROUTINE UPQRQF
(N
,ETA
,S
,F0
,F1
,QT
,R
,W
,T
)
3 C SUBROUTINE UPQRQF PERFORMS A BROYDEN UPDATE ON THE Q R
4 C FACTORIZATION OF A MATRIX A, (AN APPROXIMATION TO J(X0)),
5 C RESULTING IN THE FACTORIZATION Q+ R+ OF
7 C A+ = A + (Y - A*S) (ST)/(ST * S),
9 C (AN APPROXIMATION TO J(X1))
10 C WHERE S = X1 - X0, ST = S TRANSPOSE, Y = F(X1) - F(X0).
12 C THE ENTRY POINT R1UPQF PERFORMS THE RANK ONE UPDATE ON THE QR
20 C N IS THE DIMENSION OF X AND F(X).
22 C ETA IS A NOISE PARAMETER. IF (Y-A*S)(I) .LE. ETA*(|F1(I)|+|F0(I)|)
23 C FOR 1 .LE. I .LE. N, THEN NO UPDATE IS PERFORMED.
25 C S(1:N) = X1 - X0 (OR S FOR THE ENTRY POINT R1UPQF).
31 C QT(1:N,1:N) CONTAINS THE OLD Q TRANSPOSE, WHERE A = Q*R .
33 C R(1:N*(N+1)/2) CONTAINS THE OLD R, STORED BY ROWS.
35 C W(1:N), T(1:N) ARE WORK ARRAYS ( T CONTAINS THE VECTOR T FOR THE
36 C ENTRY POINT R1UPQF ).
41 C N AND ETA ARE UNCHANGED.
43 C QT CONTAINS Q+ TRANSPOSE.
45 C R CONTAINS R+, STORED BY ROWS.
47 C S, F0, F1, W, AND T HAVE ALL BEEN CHANGED.
50 C CALLS DAXPY, DDOT, AND DNRM2.
52 C ***** DECLARATIONS *****
54 C FUNCTION DECLARATIONS
56 DOUBLE PRECISION DDOT
, DNRM2
60 DOUBLE PRECISION C
, DEN
, ONE
, SS
, WW
, YY
61 INTEGER I
, INDEXR
, INDXR2
, J
, K
71 DOUBLE PRECISION S
(N
), F0
(N
), F1
(N
), QT
(N
,N
), R
(N*
(N
+1)/2),
74 C ***** END OF DECLARATIONS *****
76 C ***** FIRST EXECUTABLE STATEMENT *****
81 C ***** DEFINE T AND S SUCH THAT *****
89 T
(I
) = DDOT
(N
-I
+1,R
(INDEXR
),1,S
(I
),1)
90 INDEXR
= INDEXR
+ N
- I
+ 1
93 C W = Y - Q*T = Y - A*S.
96 W
(I
) = F1
(I
) - F0
(I
) - DDOT
(N
,QT
(1,I
),1,T
,1)
98 C IF W(I) IS NOT SMALL, THEN UPDATE MUST BE PERFORMED,
99 C OTHERWISE SET W(I) TO 0.
101 IF (ABS
(W
(I
)) .GT
. ETA*
(ABS
(F1
(I
)) + ABS
(F0
(I
)))) THEN
108 C IF NO UPDATE IS NECESSARY, THEN RETURN.
112 C T = QT*W = QT*Y - R*S.
115 T
(I
) = DDOT
(N
,QT
(I
,1),N
,W
,1)
120 DEN
= 1.0/DDOT
(N
,S
,1,S
,1)
121 CALL DSCAL
(N
,DEN
,S
,1)
123 C ***** END OF COMPUTATION OF T & S *****
124 C AT THIS POINT, A+ = Q*(R + T*ST).
126 CALL r1upqf
(n
, s
, t
, qt
, r
, w
)