LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cspt02 ( character  UPLO,
integer  N,
integer  NRHS,
complex, dimension( * )  A,
complex, dimension( ldx, * )  X,
integer  LDX,
complex, dimension( ldb, * )  B,
integer  LDB,
real, dimension( * )  RWORK,
real  RESID 
)

CSPT02

Purpose:
 CSPT02 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 array, dimension (N*(N+1)/2)
          The original complex symmetric matrix A, stored as a packed
          triangular matrix.
[in]X
          X is COMPLEX 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 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 REAL array, dimension (N)
[out]RESID
          RESID is REAL
          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 125 of file cspt02.f.

125 *
126 * -- LAPACK test routine (version 3.4.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 * November 2011
130 *
131 * .. Scalar Arguments ..
132  CHARACTER uplo
133  INTEGER ldb, ldx, n, nrhs
134  REAL resid
135 * ..
136 * .. Array Arguments ..
137  REAL rwork( * )
138  COMPLEX a( * ), b( ldb, * ), x( ldx, * )
139 * ..
140 *
141 * =====================================================================
142 *
143 * .. Parameters ..
144  REAL zero, one
145  parameter ( zero = 0.0e+0, one = 1.0e+0 )
146  COMPLEX cone
147  parameter ( cone = ( 1.0e+0, 0.0e+0 ) )
148 * ..
149 * .. Local Scalars ..
150  INTEGER j
151  REAL anorm, bnorm, eps, xnorm
152 * ..
153 * .. External Functions ..
154  REAL clansp, scasum, slamch
155  EXTERNAL clansp, scasum, slamch
156 * ..
157 * .. External Subroutines ..
158  EXTERNAL cspmv
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 = slamch( 'Epsilon' )
175  anorm = clansp( '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 cspmv( 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 = scasum( n, b( 1, j ), 1 )
194  xnorm = scasum( 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 CSPT02
205 *
real function clansp(NORM, UPLO, N, AP, WORK)
CLANSP 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: clansp.f:117
real function scasum(N, CX, INCX)
SCASUM
Definition: scasum.f:54
subroutine cspmv(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
CSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix ...
Definition: cspmv.f:153
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69

Here is the call graph for this function:

Here is the caller graph for this function: