LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dtbt03()

subroutine dtbt03 ( character  UPLO,
character  TRANS,
character  DIAG,
integer  N,
integer  KD,
integer  NRHS,
double precision, dimension( ldab, * )  AB,
integer  LDAB,
double precision  SCALE,
double precision, dimension( * )  CNORM,
double precision  TSCAL,
double precision, dimension( ldx, * )  X,
integer  LDX,
double precision, dimension( ldb, * )  B,
integer  LDB,
double precision, dimension( * )  WORK,
double precision  RESID 
)

DTBT03

Purpose:
 DTBT03 computes the residual for the solution to a scaled triangular
 system of equations  A*x = s*b  or  A'*x = s*b  when A is a
 triangular band matrix. Here A' is the transpose of A, s is a scalar,
 and x and b are N by NRHS matrices.  The test ratio is the maximum
 over the number of right hand sides of
    norm(s*b - op(A)*x) / ( norm(op(A)) * norm(x) * EPS ),
 where op(A) denotes A or A' and EPS is the machine epsilon.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the matrix A is upper or lower triangular.
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]TRANS
          TRANS is CHARACTER*1
          Specifies the operation applied to A.
          = 'N':  A *x = b  (No transpose)
          = 'T':  A'*x = b  (Transpose)
          = 'C':  A'*x = b  (Conjugate transpose = Transpose)
[in]DIAG
          DIAG is CHARACTER*1
          Specifies whether or not the matrix A is unit triangular.
          = 'N':  Non-unit triangular
          = 'U':  Unit triangular
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]KD
          KD is INTEGER
          The number of superdiagonals or subdiagonals of the
          triangular band matrix A.  KD >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrices X and B.  NRHS >= 0.
[in]AB
          AB is DOUBLE PRECISION array, dimension (LDAB,N)
          The upper or lower triangular band matrix A, stored in the
          first kd+1 rows of the array. The j-th column of A is stored
          in the j-th column of the array AB as follows:
          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd).
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= KD+1.
[in]SCALE
          SCALE is DOUBLE PRECISION
          The scaling factor s used in solving the triangular system.
[in]CNORM
          CNORM is DOUBLE PRECISION array, dimension (N)
          The 1-norms of the columns of A, not counting the diagonal.
[in]TSCAL
          TSCAL is DOUBLE PRECISION
          The scaling factor used in computing the 1-norms in CNORM.
          CNORM actually contains the column norms of TSCAL*A.
[in]X
          X is DOUBLE PRECISION 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]B
          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
          The right hand side vectors for the system of linear
          equations.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (N)
[out]RESID
          RESID is DOUBLE PRECISION
          The maximum over the number of right hand sides of
          norm(op(A)*x - s*b) / ( norm(op(A)) * norm(x) * EPS ).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 177 of file dtbt03.f.

177 *
178 * -- LAPACK test routine (version 3.7.0) --
179 * -- LAPACK is a software package provided by Univ. of Tennessee, --
180 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
181 * December 2016
182 *
183 * .. Scalar Arguments ..
184  CHARACTER diag, trans, uplo
185  INTEGER kd, ldab, ldb, ldx, n, nrhs
186  DOUBLE PRECISION resid, scale, tscal
187 * ..
188 * .. Array Arguments ..
189  DOUBLE PRECISION ab( ldab, * ), b( ldb, * ), cnorm( * ),
190  $ work( * ), x( ldx, * )
191 * ..
192 *
193 * =====================================================================
194 *
195 * .. Parameters ..
196  DOUBLE PRECISION one, zero
197  parameter( one = 1.0d+0, zero = 0.0d+0 )
198 * ..
199 * .. Local Scalars ..
200  INTEGER ix, j
201  DOUBLE PRECISION bignum, eps, err, smlnum, tnorm, xnorm, xscal
202 * ..
203 * .. External Functions ..
204  LOGICAL lsame
205  INTEGER idamax
206  DOUBLE PRECISION dlamch
207  EXTERNAL lsame, idamax, dlamch
208 * ..
209 * .. External Subroutines ..
210  EXTERNAL daxpy, dcopy, dlabad, dscal, dtbmv
211 * ..
212 * .. Intrinsic Functions ..
213  INTRINSIC abs, dble, max
214 * ..
215 * .. Executable Statements ..
216 *
217 * Quick exit if N = 0
218 *
219  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
220  resid = zero
221  RETURN
222  END IF
223  eps = dlamch( 'Epsilon' )
224  smlnum = dlamch( 'Safe minimum' )
225  bignum = one / smlnum
226  CALL dlabad( smlnum, bignum )
227 *
228 * Compute the norm of the triangular matrix A using the column
229 * norms already computed by DLATBS.
230 *
231  tnorm = zero
232  IF( lsame( diag, 'N' ) ) THEN
233  IF( lsame( uplo, 'U' ) ) THEN
234  DO 10 j = 1, n
235  tnorm = max( tnorm, tscal*abs( ab( kd+1, j ) )+
236  $ cnorm( j ) )
237  10 CONTINUE
238  ELSE
239  DO 20 j = 1, n
240  tnorm = max( tnorm, tscal*abs( ab( 1, j ) )+cnorm( j ) )
241  20 CONTINUE
242  END IF
243  ELSE
244  DO 30 j = 1, n
245  tnorm = max( tnorm, tscal+cnorm( j ) )
246  30 CONTINUE
247  END IF
248 *
249 * Compute the maximum over the number of right hand sides of
250 * norm(op(A)*x - s*b) / ( norm(op(A)) * norm(x) * EPS ).
251 *
252  resid = zero
253  DO 40 j = 1, nrhs
254  CALL dcopy( n, x( 1, j ), 1, work, 1 )
255  ix = idamax( n, work, 1 )
256  xnorm = max( one, abs( x( ix, j ) ) )
257  xscal = ( one / xnorm ) / dble( kd+1 )
258  CALL dscal( n, xscal, work, 1 )
259  CALL dtbmv( uplo, trans, diag, n, kd, ab, ldab, work, 1 )
260  CALL daxpy( n, -scale*xscal, b( 1, j ), 1, work, 1 )
261  ix = idamax( n, work, 1 )
262  err = tscal*abs( work( ix ) )
263  ix = idamax( n, x( 1, j ), 1 )
264  xnorm = abs( x( ix, j ) )
265  IF( err*smlnum.LE.xnorm ) THEN
266  IF( xnorm.GT.zero )
267  $ err = err / xnorm
268  ELSE
269  IF( err.GT.zero )
270  $ err = one / eps
271  END IF
272  IF( err*smlnum.LE.tnorm ) THEN
273  IF( tnorm.GT.zero )
274  $ err = err / tnorm
275  ELSE
276  IF( err.GT.zero )
277  $ err = one / eps
278  END IF
279  resid = max( resid, err )
280  40 CONTINUE
281 *
282  RETURN
283 *
284 * End of DTBT03
285 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
Definition: dcopy.f:84
integer function idamax(N, DX, INCX)
IDAMAX
Definition: idamax.f:73
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
Definition: daxpy.f:91
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine dscal(N, DA, DX, INCX)
DSCAL
Definition: dscal.f:81
subroutine dlabad(SMALL, LARGE)
DLABAD
Definition: dlabad.f:76
subroutine dtbmv(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)
DTBMV
Definition: dtbmv.f:188
Here is the call graph for this function:
Here is the caller graph for this function: