LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zspt02()

subroutine zspt02 ( character  UPLO,
integer  N,
integer  NRHS,
complex*16, dimension( * )  A,
complex*16, dimension( ldx, * )  X,
integer  LDX,
complex*16, dimension( ldb, * )  B,
integer  LDB,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

ZSPT02

Purpose:
 ZSPT02 computes the residual in the solution of a complex symmetric
 system of linear equations  A*x = b  when packed storage is used for
 the coefficient matrix.  The ratio computed is

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

 where EPS is the machine precision.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          complex 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 (N*(N+1)/2)
          The original complex symmetric matrix A, stored as a packed
          triangular matrix.
[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
December 2016

Definition at line 125 of file zspt02.f.

125 *
126 * -- LAPACK test routine (version 3.7.0) --
127 * -- LAPACK is a software package provided by Univ. of Tennessee, --
128 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129 * December 2016
130 *
131 * .. Scalar Arguments ..
132  CHARACTER uplo
133  INTEGER ldb, ldx, n, nrhs
134  DOUBLE PRECISION resid
135 * ..
136 * .. Array Arguments ..
137  DOUBLE PRECISION rwork( * )
138  COMPLEX*16 a( * ), b( ldb, * ), x( ldx, * )
139 * ..
140 *
141 * =====================================================================
142 *
143 * .. Parameters ..
144  DOUBLE PRECISION zero, one
145  parameter( zero = 0.0d+0, one = 1.0d+0 )
146  COMPLEX*16 cone
147  parameter( cone = ( 1.0d+0, 0.0d+0 ) )
148 * ..
149 * .. Local Scalars ..
150  INTEGER j
151  DOUBLE PRECISION anorm, bnorm, eps, xnorm
152 * ..
153 * .. External Functions ..
154  DOUBLE PRECISION dlamch, dzasum, zlansp
155  EXTERNAL dlamch, dzasum, zlansp
156 * ..
157 * .. External Subroutines ..
158  EXTERNAL zspmv
159 * ..
160 * .. Intrinsic Functions ..
161  INTRINSIC max
162 * ..
163 * .. Executable Statements ..
164 *
165 * Quick exit if N = 0 or NRHS = 0
166 *
167  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
168  resid = zero
169  RETURN
170  END IF
171 *
172 * Exit with RESID = 1/EPS if ANORM = 0.
173 *
174  eps = dlamch( 'Epsilon' )
175  anorm = zlansp( '1', uplo, n, a, rwork )
176  IF( anorm.LE.zero ) THEN
177  resid = one / eps
178  RETURN
179  END IF
180 *
181 * Compute B - A*X for the matrix of right hand sides B.
182 *
183  DO 10 j = 1, nrhs
184  CALL zspmv( uplo, n, -cone, a, x( 1, j ), 1, cone, b( 1, j ),
185  $ 1 )
186  10 CONTINUE
187 *
188 * Compute the maximum over the number of right hand sides of
189 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) .
190 *
191  resid = zero
192  DO 20 j = 1, nrhs
193  bnorm = dzasum( n, b( 1, j ), 1 )
194  xnorm = dzasum( n, x( 1, j ), 1 )
195  IF( xnorm.LE.zero ) THEN
196  resid = one / eps
197  ELSE
198  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
199  END IF
200  20 CONTINUE
201 *
202  RETURN
203 *
204 * End of ZSPT02
205 *
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:74
double precision function zlansp(NORM, UPLO, N, AP, WORK)
ZLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form.
Definition: zlansp.f:117
subroutine zspmv(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
ZSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix ...
Definition: zspmv.f:153
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
Here is the call graph for this function:
Here is the caller graph for this function: