LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zptt02 ( character  UPLO,
integer  N,
integer  NRHS,
double precision, dimension( * )  D,
complex*16, dimension( * )  E,
complex*16, dimension( ldx, * )  X,
integer  LDX,
complex*16, dimension( ldb, * )  B,
integer  LDB,
double precision  RESID 
)

ZPTT02

Purpose:
 ZPTT02 computes the residual for the solution to a symmetric
 tridiagonal system of equations:
    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 superdiagonal or the subdiagonal of the
          tridiagonal matrix A is stored.
          = 'U':  E is the superdiagonal of A
          = 'L':  E is the subdiagonal of A
[in]N
          N is INTEGTER
          The order of the matrix A.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrices B and X.  NRHS >= 0.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the tridiagonal matrix A.
[in]E
          E is COMPLEX*16 array, dimension (N-1)
          The (n-1) subdiagonal elements of the tridiagonal matrix A.
[in]X
          X is COMPLEX*16 array, dimension (LDX,NRHS)
          The n by nrhs matrix of solution vectors X.
[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 n by nrhs matrix of right hand side vectors B.
          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]RESID
          RESID is DOUBLE PRECISION
          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 117 of file zptt02.f.

117 *
118 * -- LAPACK test routine (version 3.4.0) --
119 * -- LAPACK is a software package provided by Univ. of Tennessee, --
120 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
121 * November 2011
122 *
123 * .. Scalar Arguments ..
124  CHARACTER uplo
125  INTEGER ldb, ldx, n, nrhs
126  DOUBLE PRECISION resid
127 * ..
128 * .. Array Arguments ..
129  DOUBLE PRECISION d( * )
130  COMPLEX*16 b( ldb, * ), e( * ), x( ldx, * )
131 * ..
132 *
133 * =====================================================================
134 *
135 * .. Parameters ..
136  DOUBLE PRECISION one, zero
137  parameter ( one = 1.0d+0, zero = 0.0d+0 )
138 * ..
139 * .. Local Scalars ..
140  INTEGER j
141  DOUBLE PRECISION anorm, bnorm, eps, xnorm
142 * ..
143 * .. External Functions ..
144  DOUBLE PRECISION dlamch, dzasum, zlanht
145  EXTERNAL dlamch, dzasum, zlanht
146 * ..
147 * .. Intrinsic Functions ..
148  INTRINSIC max
149 * ..
150 * .. External Subroutines ..
151  EXTERNAL zlaptm
152 * ..
153 * .. Executable Statements ..
154 *
155 * Quick return if possible
156 *
157  IF( n.LE.0 ) THEN
158  resid = zero
159  RETURN
160  END IF
161 *
162 * Compute the 1-norm of the tridiagonal matrix A.
163 *
164  anorm = zlanht( '1', n, d, e )
165 *
166 * Exit with RESID = 1/EPS if ANORM = 0.
167 *
168  eps = dlamch( 'Epsilon' )
169  IF( anorm.LE.zero ) THEN
170  resid = one / eps
171  RETURN
172  END IF
173 *
174 * Compute B - A*X.
175 *
176  CALL zlaptm( uplo, n, nrhs, -one, d, e, x, ldx, one, b, ldb )
177 *
178 * Compute the maximum over the number of right hand sides of
179 * norm(B - A*X) / ( norm(A) * norm(X) * EPS ).
180 *
181  resid = zero
182  DO 10 j = 1, nrhs
183  bnorm = dzasum( n, b( 1, j ), 1 )
184  xnorm = dzasum( n, x( 1, j ), 1 )
185  IF( xnorm.LE.zero ) THEN
186  resid = one / eps
187  ELSE
188  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
189  END IF
190  10 CONTINUE
191 *
192  RETURN
193 *
194 * End of ZPTT02
195 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zlaptm(UPLO, N, NRHS, ALPHA, D, E, X, LDX, BETA, B, LDB)
ZLAPTM
Definition: zlaptm.f:131
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:54
double precision function zlanht(NORM, N, D, E)
ZLANHT 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 tridiagonal matrix.
Definition: zlanht.f:103

Here is the call graph for this function:

Here is the caller graph for this function: