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

SPBT02

Purpose:
 SPBT02 computes the residual for a solution of a symmetric banded
 system of equations  A*x = b:
    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
          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]KD
          KD is INTEGER
          The number of super-diagonals of the matrix A if UPLO = 'U',
          or the number of sub-diagonals if UPLO = 'L'.  KD >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides. NRHS >= 0.
[in]A
          A is REAL array, dimension (LDA,N)
          The original symmetric band matrix A.  If UPLO = 'U', the
          upper triangular part of A is stored as a band matrix; if
          UPLO = 'L', the lower triangular part of A is stored.  The
          columns of the appropriate triangle are stored in the columns
          of A and the diagonals of the triangle are stored in the rows
          of A.  See SPBTRF for further details.
[in]LDA
          LDA is INTEGER.
          The leading dimension of the array A.  LDA >= max(1,KD+1).
[in]X
          X is REAL 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 REAL 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 138 of file spbt02.f.

138 *
139 * -- LAPACK test routine (version 3.4.0) --
140 * -- LAPACK is a software package provided by Univ. of Tennessee, --
141 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
142 * November 2011
143 *
144 * .. Scalar Arguments ..
145  CHARACTER uplo
146  INTEGER kd, lda, ldb, ldx, n, nrhs
147  REAL resid
148 * ..
149 * .. Array Arguments ..
150  REAL a( lda, * ), b( ldb, * ), rwork( * ),
151  $ x( ldx, * )
152 * ..
153 *
154 * =====================================================================
155 *
156 * .. Parameters ..
157  REAL zero, one
158  parameter ( zero = 0.0e+0, one = 1.0e+0 )
159 * ..
160 * .. Local Scalars ..
161  INTEGER j
162  REAL anorm, bnorm, eps, xnorm
163 * ..
164 * .. External Functions ..
165  REAL sasum, slamch, slansb
166  EXTERNAL sasum, slamch, slansb
167 * ..
168 * .. External Subroutines ..
169  EXTERNAL ssbmv
170 * ..
171 * .. Intrinsic Functions ..
172  INTRINSIC max
173 * ..
174 * .. Executable Statements ..
175 *
176 * Quick exit if N = 0 or NRHS = 0.
177 *
178  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
179  resid = zero
180  RETURN
181  END IF
182 *
183 * Exit with RESID = 1/EPS if ANORM = 0.
184 *
185  eps = slamch( 'Epsilon' )
186  anorm = slansb( '1', uplo, n, kd, a, lda, rwork )
187  IF( anorm.LE.zero ) THEN
188  resid = one / eps
189  RETURN
190  END IF
191 *
192 * Compute B - A*X
193 *
194  DO 10 j = 1, nrhs
195  CALL ssbmv( uplo, n, kd, -one, a, lda, x( 1, j ), 1, one,
196  $ b( 1, j ), 1 )
197  10 CONTINUE
198 *
199 * Compute the maximum over the number of right hand sides of
200 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS )
201 *
202  resid = zero
203  DO 20 j = 1, nrhs
204  bnorm = sasum( n, b( 1, j ), 1 )
205  xnorm = sasum( n, x( 1, j ), 1 )
206  IF( xnorm.LE.zero ) THEN
207  resid = one / eps
208  ELSE
209  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
210  END IF
211  20 CONTINUE
212 *
213  RETURN
214 *
215 * End of SPBT02
216 *
subroutine ssbmv(UPLO, N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
SSBMV
Definition: ssbmv.f:186
real function slansb(NORM, UPLO, N, K, AB, LDAB, WORK)
SLANSB 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 band matrix.
Definition: slansb.f:131
real function sasum(N, SX, INCX)
SASUM
Definition: sasum.f:54
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: