LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zpot02 ( 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 
)

ZPOT02

Purpose:
 ZPOT02 computes the residual for the solution of a Hermitian system
 of linear equations  A*x = b:

    RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ),

 where EPS is the machine epsilon.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          Hermitian 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 Hermitian 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.   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.  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 zpot02.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
151  parameter ( cone = ( 1.0d+0, 0.0d+0 ) )
152 * ..
153 * .. Local Scalars ..
154  INTEGER j
155  DOUBLE PRECISION anorm, bnorm, eps, xnorm
156 * ..
157 * .. External Functions ..
158  DOUBLE PRECISION dlamch, dzasum, zlanhe
159  EXTERNAL dlamch, dzasum, zlanhe
160 * ..
161 * .. External Subroutines ..
162  EXTERNAL zhemm
163 * ..
164 * .. Intrinsic Functions ..
165  INTRINSIC max
166 * ..
167 * .. Executable Statements ..
168 *
169 * Quick exit if N = 0 or NRHS = 0.
170 *
171  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
172  resid = zero
173  RETURN
174  END IF
175 *
176 * Exit with RESID = 1/EPS if ANORM = 0.
177 *
178  eps = dlamch( 'Epsilon' )
179  anorm = zlanhe( '1', uplo, n, a, lda, rwork )
180  IF( anorm.LE.zero ) THEN
181  resid = one / eps
182  RETURN
183  END IF
184 *
185 * Compute B - A*X
186 *
187  CALL zhemm( 'Left', uplo, n, nrhs, -cone, a, lda, x, ldx, cone, b,
188  $ ldb )
189 *
190 * Compute the maximum over the number of right hand sides of
191 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) .
192 *
193  resid = zero
194  DO 10 j = 1, nrhs
195  bnorm = dzasum( n, b( 1, j ), 1 )
196  xnorm = dzasum( n, x( 1, j ), 1 )
197  IF( xnorm.LE.zero ) THEN
198  resid = one / eps
199  ELSE
200  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
201  END IF
202  10 CONTINUE
203 *
204  RETURN
205 *
206 * End of ZPOT02
207 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE 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 Hermitian matrix.
Definition: zlanhe.f:126
subroutine zhemm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZHEMM
Definition: zhemm.f:193
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:54

Here is the call graph for this function:

Here is the caller graph for this function: