LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zgbt01 ( integer  M,
integer  N,
integer  KL,
integer  KU,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldafac, * )  AFAC,
integer  LDAFAC,
integer, dimension( * )  IPIV,
complex*16, dimension( * )  WORK,
double precision  RESID 
)

ZGBT01

Purpose:
 ZGBT01 reconstructs a band matrix  A  from its L*U factorization and
 computes the residual:
    norm(L*U - A) / ( N * norm(A) * EPS ),
 where EPS is the machine epsilon.

 The expression L*U - A is computed one column at a time, so A and
 AFAC are not modified.
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrix A.  M >= 0.
[in]N
          N is INTEGER
          The number of columns of the matrix A.  N >= 0.
[in]KL
          KL is INTEGER
          The number of subdiagonals within the band of A.  KL >= 0.
[in]KU
          KU is INTEGER
          The number of superdiagonals within the band of A.  KU >= 0.
[in,out]A
          A is COMPLEX*16 array, dimension (LDA,N)
          The original matrix A in band storage, stored in rows 1 to
          KL+KU+1.
[in]LDA
          LDA is INTEGER.
          The leading dimension of the array A.  LDA >= max(1,KL+KU+1).
[in]AFAC
          AFAC is COMPLEX*16 array, dimension (LDAFAC,N)
          The factored form of the matrix A.  AFAC contains the banded
          factors L and U from the L*U factorization, as computed by
          ZGBTRF.  U is stored as an upper triangular band matrix with
          KL+KU superdiagonals in rows 1 to KL+KU+1, and the
          multipliers used during the factorization are stored in rows
          KL+KU+2 to 2*KL+KU+1.  See ZGBTRF for further details.
[in]LDAFAC
          LDAFAC is INTEGER
          The leading dimension of the array AFAC.
          LDAFAC >= max(1,2*KL*KU+1).
[in]IPIV
          IPIV is INTEGER array, dimension (min(M,N))
          The pivot indices from ZGBTRF.
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*KL+KU+1)
[out]RESID
          RESID is DOUBLE PRECISION
          norm(L*U - A) / ( N * norm(A) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 128 of file zgbt01.f.

128 *
129 * -- LAPACK test routine (version 3.4.0) --
130 * -- LAPACK is a software package provided by Univ. of Tennessee, --
131 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132 * November 2011
133 *
134 * .. Scalar Arguments ..
135  INTEGER kl, ku, lda, ldafac, m, n
136  DOUBLE PRECISION resid
137 * ..
138 * .. Array Arguments ..
139  INTEGER ipiv( * )
140  COMPLEX*16 a( lda, * ), afac( ldafac, * ), work( * )
141 * ..
142 *
143 * =====================================================================
144 *
145 * .. Parameters ..
146  DOUBLE PRECISION zero, one
147  parameter ( zero = 0.0d+0, one = 1.0d+0 )
148 * ..
149 * .. Local Scalars ..
150  INTEGER i, i1, i2, il, ip, iw, j, jl, ju, jua, kd, lenj
151  DOUBLE PRECISION anorm, eps
152  COMPLEX*16 t
153 * ..
154 * .. External Functions ..
155  DOUBLE PRECISION dlamch, dzasum
156  EXTERNAL dlamch, dzasum
157 * ..
158 * .. External Subroutines ..
159  EXTERNAL zaxpy, zcopy
160 * ..
161 * .. Intrinsic Functions ..
162  INTRINSIC dble, dcmplx, max, min
163 * ..
164 * .. Executable Statements ..
165 *
166 * Quick exit if M = 0 or N = 0.
167 *
168  resid = zero
169  IF( m.LE.0 .OR. n.LE.0 )
170  $ RETURN
171 *
172 * Determine EPS and the norm of A.
173 *
174  eps = dlamch( 'Epsilon' )
175  kd = ku + 1
176  anorm = zero
177  DO 10 j = 1, n
178  i1 = max( kd+1-j, 1 )
179  i2 = min( kd+m-j, kl+kd )
180  IF( i2.GE.i1 )
181  $ anorm = max( anorm, dzasum( i2-i1+1, a( i1, j ), 1 ) )
182  10 CONTINUE
183 *
184 * Compute one column at a time of L*U - A.
185 *
186  kd = kl + ku + 1
187  DO 40 j = 1, n
188 *
189 * Copy the J-th column of U to WORK.
190 *
191  ju = min( kl+ku, j-1 )
192  jl = min( kl, m-j )
193  lenj = min( m, j ) - j + ju + 1
194  IF( lenj.GT.0 ) THEN
195  CALL zcopy( lenj, afac( kd-ju, j ), 1, work, 1 )
196  DO 20 i = lenj + 1, ju + jl + 1
197  work( i ) = zero
198  20 CONTINUE
199 *
200 * Multiply by the unit lower triangular matrix L. Note that L
201 * is stored as a product of transformations and permutations.
202 *
203  DO 30 i = min( m-1, j ), j - ju, -1
204  il = min( kl, m-i )
205  IF( il.GT.0 ) THEN
206  iw = i - j + ju + 1
207  t = work( iw )
208  CALL zaxpy( il, t, afac( kd+1, i ), 1, work( iw+1 ),
209  $ 1 )
210  ip = ipiv( i )
211  IF( i.NE.ip ) THEN
212  ip = ip - j + ju + 1
213  work( iw ) = work( ip )
214  work( ip ) = t
215  END IF
216  END IF
217  30 CONTINUE
218 *
219 * Subtract the corresponding column of A.
220 *
221  jua = min( ju, ku )
222  IF( jua+jl+1.GT.0 )
223  $ CALL zaxpy( jua+jl+1, -dcmplx( one ), a( ku+1-jua, j ),
224  $ 1, work( ju+1-jua ), 1 )
225 *
226 * Compute the 1-norm of the column.
227 *
228  resid = max( resid, dzasum( ju+jl+1, work, 1 ) )
229  END IF
230  40 CONTINUE
231 *
232 * Compute norm( L*U - A ) / ( N * norm(A) * EPS )
233 *
234  IF( anorm.LE.zero ) THEN
235  IF( resid.NE.zero )
236  $ resid = one / eps
237  ELSE
238  resid = ( ( resid / dble( n ) ) / anorm ) / eps
239  END IF
240 *
241  RETURN
242 *
243 * End of ZGBT01
244 *
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:52
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:54
subroutine zaxpy(N, ZA, ZX, INCX, ZY, INCY)
ZAXPY
Definition: zaxpy.f:53

Here is the call graph for this function:

Here is the caller graph for this function: