|
28 | 28 | *> \verbatim |
29 | 29 | *> |
30 | 30 | *> ZGET02 computes the residual for a solution of a system of linear |
31 | | -*> equations A*x = b or A'*x = b: |
32 | | -*> RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ), |
33 | | -*> where EPS is the machine epsilon. |
| 31 | +*> equations op(A)*X = B: |
| 32 | +*> RESID = norm(B - op(A)*X) / ( norm(op(A)) * norm(X) * EPS ), |
| 33 | +*> where op(A) = A, A**T, or A**H, depending on TRANS, and EPS is the |
| 34 | +*> machine epsilon. |
34 | 35 | *> \endverbatim |
35 | 36 | * |
36 | 37 | * Arguments: |
|
40 | 41 | *> \verbatim |
41 | 42 | *> TRANS is CHARACTER*1 |
42 | 43 | *> Specifies the form of the system of equations: |
43 | | -*> = 'N': A *x = b |
44 | | -*> = 'T': A^T*x = b, where A^T is the transpose of A |
45 | | -*> = 'C': A^H*x = b, where A^H is the conjugate transpose of A |
| 44 | +*> = 'N': A * X = B (No transpose) |
| 45 | +*> = 'T': A**T * X = B (Transpose) |
| 46 | +*> = 'C': A**H * X = B (Conjugate transpose) |
46 | 47 | *> \endverbatim |
47 | 48 | *> |
48 | 49 | *> \param[in] M |
|
114 | 115 | *> \verbatim |
115 | 116 | *> RESID is DOUBLE PRECISION |
116 | 117 | *> The maximum over the number of right hand sides of |
117 | | -*> norm(B - A*X) / ( norm(A) * norm(X) * EPS ). |
| 118 | +*> norm(B - op(A)*X) / ( norm(op(A)) * norm(X) * EPS ). |
118 | 119 | *> \endverbatim |
119 | 120 | * |
120 | 121 | * Authors: |
@@ -188,19 +189,23 @@ SUBROUTINE ZGET02( TRANS, M, N, NRHS, A, LDA, X, LDX, B, LDB, |
188 | 189 | * Exit with RESID = 1/EPS if ANORM = 0. |
189 | 190 | * |
190 | 191 | EPS = DLAMCH( 'Epsilon' ) |
191 | | - ANORM = ZLANGE( '1', M, N, A, LDA, RWORK ) |
| 192 | + IF( LSAME( TRANS, 'N' ) ) THEN |
| 193 | + ANORM = ZLANGE( '1', M, N, A, LDA, RWORK ) |
| 194 | + ELSE |
| 195 | + ANORM = ZLANGE( 'I', M, N, A, LDA, RWORK ) |
| 196 | + END IF |
192 | 197 | IF( ANORM.LE.ZERO ) THEN |
193 | 198 | RESID = ONE / EPS |
194 | 199 | RETURN |
195 | 200 | END IF |
196 | 201 | * |
197 | | -* Compute B - A*X (or B - A'*X ) and store in B. |
| 202 | +* Compute B - op(A)*X and store in B. |
198 | 203 | * |
199 | 204 | CALL ZGEMM( TRANS, 'No transpose', N1, NRHS, N2, -CONE, A, LDA, X, |
200 | 205 | $ LDX, CONE, B, LDB ) |
201 | 206 | * |
202 | 207 | * Compute the maximum over the number of right hand sides of |
203 | | -* norm(B - A*X) / ( norm(A) * norm(X) * EPS ) . |
| 208 | +* norm(B - op(A)*X) / ( norm(op(A)) * norm(X) * EPS ) . |
204 | 209 | * |
205 | 210 | RESID = ZERO |
206 | 211 | DO 10 J = 1, NRHS |
|
0 commit comments