LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zgtt01 ( integer  N,
complex*16, dimension( * )  DL,
complex*16, dimension( * )  D,
complex*16, dimension( * )  DU,
complex*16, dimension( * )  DLF,
complex*16, dimension( * )  DF,
complex*16, dimension( * )  DUF,
complex*16, dimension( * )  DU2,
integer, dimension( * )  IPIV,
complex*16, dimension( ldwork, * )  WORK,
integer  LDWORK,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

ZGTT01

Purpose:
 ZGTT01 reconstructs a tridiagonal matrix A from its LU factorization
 and computes the residual
    norm(L*U - A) / ( norm(A) * EPS ),
 where EPS is the machine epsilon.
Parameters
[in]N
          N is INTEGTER
          The order of the matrix A.  N >= 0.
[in]DL
          DL is COMPLEX*16 array, dimension (N-1)
          The (n-1) sub-diagonal elements of A.
[in]D
          D is COMPLEX*16 array, dimension (N)
          The diagonal elements of A.
[in]DU
          DU is COMPLEX*16 array, dimension (N-1)
          The (n-1) super-diagonal elements of A.
[in]DLF
          DLF is COMPLEX*16 array, dimension (N-1)
          The (n-1) multipliers that define the matrix L from the
          LU factorization of A.
[in]DF
          DF is COMPLEX*16 array, dimension (N)
          The n diagonal elements of the upper triangular matrix U from
          the LU factorization of A.
[in]DUF
          DUF is COMPLEX*16 array, dimension (N-1)
          The (n-1) elements of the first super-diagonal of U.
[in]DU2
          DU2 is COMPLEX*16 array, dimension (N-2)
          The (n-2) elements of the second super-diagonal of U.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices; for 1 <= i <= n, row i of the matrix was
          interchanged with row IPIV(i).  IPIV(i) will always be either
          i or i+1; IPIV(i) = i indicates a row interchange was not
          required.
[out]WORK
          WORK is COMPLEX*16 array, dimension (LDWORK,N)
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.  LDWORK >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RESID
          RESID is DOUBLE PRECISION
          The scaled residual:  norm(L*U - A) / (norm(A) * EPS)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 136 of file zgtt01.f.

136 *
137 * -- LAPACK test routine (version 3.4.0) --
138 * -- LAPACK is a software package provided by Univ. of Tennessee, --
139 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
140 * November 2011
141 *
142 * .. Scalar Arguments ..
143  INTEGER ldwork, n
144  DOUBLE PRECISION resid
145 * ..
146 * .. Array Arguments ..
147  INTEGER ipiv( * )
148  DOUBLE PRECISION rwork( * )
149  COMPLEX*16 d( * ), df( * ), dl( * ), dlf( * ), du( * ),
150  $ du2( * ), duf( * ), work( ldwork, * )
151 * ..
152 *
153 * =====================================================================
154 *
155 * .. Parameters ..
156  DOUBLE PRECISION one, zero
157  parameter ( one = 1.0d+0, zero = 0.0d+0 )
158 * ..
159 * .. Local Scalars ..
160  INTEGER i, ip, j, lastj
161  DOUBLE PRECISION anorm, eps
162  COMPLEX*16 li
163 * ..
164 * .. External Functions ..
165  DOUBLE PRECISION dlamch, zlangt, zlanhs
166  EXTERNAL dlamch, zlangt, zlanhs
167 * ..
168 * .. Intrinsic Functions ..
169  INTRINSIC min
170 * ..
171 * .. External Subroutines ..
172  EXTERNAL zaxpy, zswap
173 * ..
174 * .. Executable Statements ..
175 *
176 * Quick return if possible
177 *
178  IF( n.LE.0 ) THEN
179  resid = zero
180  RETURN
181  END IF
182 *
183  eps = dlamch( 'Epsilon' )
184 *
185 * Copy the matrix U to WORK.
186 *
187  DO 20 j = 1, n
188  DO 10 i = 1, n
189  work( i, j ) = zero
190  10 CONTINUE
191  20 CONTINUE
192  DO 30 i = 1, n
193  IF( i.EQ.1 ) THEN
194  work( i, i ) = df( i )
195  IF( n.GE.2 )
196  $ work( i, i+1 ) = duf( i )
197  IF( n.GE.3 )
198  $ work( i, i+2 ) = du2( i )
199  ELSE IF( i.EQ.n ) THEN
200  work( i, i ) = df( i )
201  ELSE
202  work( i, i ) = df( i )
203  work( i, i+1 ) = duf( i )
204  IF( i.LT.n-1 )
205  $ work( i, i+2 ) = du2( i )
206  END IF
207  30 CONTINUE
208 *
209 * Multiply on the left by L.
210 *
211  lastj = n
212  DO 40 i = n - 1, 1, -1
213  li = dlf( i )
214  CALL zaxpy( lastj-i+1, li, work( i, i ), ldwork,
215  $ work( i+1, i ), ldwork )
216  ip = ipiv( i )
217  IF( ip.EQ.i ) THEN
218  lastj = min( i+2, n )
219  ELSE
220  CALL zswap( lastj-i+1, work( i, i ), ldwork, work( i+1, i ),
221  $ ldwork )
222  END IF
223  40 CONTINUE
224 *
225 * Subtract the matrix A.
226 *
227  work( 1, 1 ) = work( 1, 1 ) - d( 1 )
228  IF( n.GT.1 ) THEN
229  work( 1, 2 ) = work( 1, 2 ) - du( 1 )
230  work( n, n-1 ) = work( n, n-1 ) - dl( n-1 )
231  work( n, n ) = work( n, n ) - d( n )
232  DO 50 i = 2, n - 1
233  work( i, i-1 ) = work( i, i-1 ) - dl( i-1 )
234  work( i, i ) = work( i, i ) - d( i )
235  work( i, i+1 ) = work( i, i+1 ) - du( i )
236  50 CONTINUE
237  END IF
238 *
239 * Compute the 1-norm of the tridiagonal matrix A.
240 *
241  anorm = zlangt( '1', n, dl, d, du )
242 *
243 * Compute the 1-norm of WORK, which is only guaranteed to be
244 * upper Hessenberg.
245 *
246  resid = zlanhs( '1', n, work, ldwork, rwork )
247 *
248 * Compute norm(L*U - A) / (norm(A) * EPS)
249 *
250  IF( anorm.LE.zero ) THEN
251  IF( resid.NE.zero )
252  $ resid = one / eps
253  ELSE
254  resid = ( resid / anorm ) / eps
255  END IF
256 *
257  RETURN
258 *
259 * End of ZGTT01
260 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
Definition: zswap.f:52
double precision function zlangt(NORM, N, DL, D, DU)
ZLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlangt.f:108
double precision function zlanhs(NORM, N, A, LDA, WORK)
ZLANHS returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlanhs.f:111
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: