LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zpot06 ( character  UPLO,
integer  N,
integer  NRHS,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldx, * )  X,
integer  LDX,
complex*16, dimension( ldb, * )  B,
integer  LDB,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

ZPOT06

Purpose:
 ZPOT06 computes the residual for a solution of a system of linear
 equations  A*x = b :
    RESID = norm(B - A*X,inf) / ( norm(A,inf) * norm(X,inf) * EPS ),
 where EPS is the machine epsilon.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          symmetric matrix A is stored:
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]N
          N is INTEGER
          The number of rows and columns of the matrix A.  N >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of columns of B, the matrix of right hand sides.
          NRHS >= 0.
[in]A
          A is COMPLEX*16 array, dimension (LDA,N)
          The original M x N matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in]X
          X is COMPLEX*16 array, dimension (LDX,NRHS)
          The computed solution vectors for the system of linear
          equations.
[in]LDX
          LDX is INTEGER
          The leading dimension of the array X.  If TRANS = 'N',
          LDX >= max(1,N); if TRANS = 'T' or 'C', LDX >= max(1,N).
[in,out]B
          B is COMPLEX*16 array, dimension (LDB,NRHS)
          On entry, the right hand side vectors for the system of
          linear equations.
          On exit, B is overwritten with the difference B - A*X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  IF TRANS = 'N',
          LDB >= max(1,M); if TRANS = 'T' or 'C', LDB >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RESID
          RESID is DOUBLE PRECISION
          The maximum over the number of right hand sides of
          norm(B - A*X) / ( norm(A) * norm(X) * EPS ).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 129 of file zpot06.f.

129 *
130 * -- LAPACK test routine (version 3.4.0) --
131 * -- LAPACK is a software package provided by Univ. of Tennessee, --
132 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
133 * November 2011
134 *
135 * .. Scalar Arguments ..
136  CHARACTER uplo
137  INTEGER lda, ldb, ldx, n, nrhs
138  DOUBLE PRECISION resid
139 * ..
140 * .. Array Arguments ..
141  DOUBLE PRECISION rwork( * )
142  COMPLEX*16 a( lda, * ), b( ldb, * ), x( ldx, * )
143 * ..
144 *
145 * =====================================================================
146 *
147 * .. Parameters ..
148  DOUBLE PRECISION zero, one
149  parameter ( zero = 0.0d+0, one = 1.0d+0 )
150  COMPLEX*16 cone, negcone
151  parameter ( cone = ( 1.0d+0, 0.0d+0 ) )
152  parameter ( negcone = ( -1.0d+0, 0.0d+0 ) )
153 * ..
154 * .. Local Scalars ..
155  INTEGER ifail, j
156  DOUBLE PRECISION anorm, bnorm, eps, xnorm
157  COMPLEX*16 zdum
158 * ..
159 * .. External Functions ..
160  LOGICAL lsame
161  INTEGER izamax
162  DOUBLE PRECISION dlamch, zlansy
163  EXTERNAL lsame, izamax, dlamch, zlansy
164 * ..
165 * .. External Subroutines ..
166  EXTERNAL zhemm
167 * ..
168 * .. Intrinsic Functions ..
169  INTRINSIC abs, dble, dimag, max
170 * ..
171 * .. Statement Functions ..
172  DOUBLE PRECISION cabs1
173 * ..
174 * .. Statement Function definitions ..
175  cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
176 * ..
177 * ..
178 * .. Executable Statements ..
179 *
180 * Quick exit if N = 0 or NRHS = 0
181 *
182  IF( n.LE.0 .OR. nrhs.EQ.0 ) THEN
183  resid = zero
184  RETURN
185  END IF
186 *
187 * Exit with RESID = 1/EPS if ANORM = 0.
188 *
189  eps = dlamch( 'Epsilon' )
190  anorm = zlansy( 'I', uplo, n, a, lda, rwork )
191  IF( anorm.LE.zero ) THEN
192  resid = one / eps
193  RETURN
194  END IF
195 *
196 * Compute B - A*X and store in B.
197  ifail=0
198 *
199  CALL zhemm( 'Left', uplo, n, nrhs, negcone, a, lda, x,
200  $ ldx, cone, b, ldb )
201 *
202 * Compute the maximum over the number of right hand sides of
203 * norm(B - A*X) / ( norm(A) * norm(X) * EPS ) .
204 *
205  resid = zero
206  DO 10 j = 1, nrhs
207  bnorm = cabs1(b(izamax( n, b( 1, j ), 1 ),j))
208  xnorm = cabs1(x(izamax( n, x( 1, j ), 1 ),j))
209  IF( xnorm.LE.zero ) THEN
210  resid = one / eps
211  ELSE
212  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
213  END IF
214  10 CONTINUE
215 *
216  RETURN
217 *
218 * End of ZPOT06
219 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zhemm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZHEMM
Definition: zhemm.f:193
double precision function zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
integer function izamax(N, ZX, INCX)
IZAMAX
Definition: izamax.f:53
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: