LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ dtrt01()

 subroutine dtrt01 ( character UPLO, character DIAG, integer N, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( ldainv, * ) AINV, integer LDAINV, double precision RCOND, double precision, dimension( * ) WORK, double precision RESID )

DTRT01

Purpose:
``` DTRT01 computes the residual for a triangular matrix A times its
inverse:
RESID = norm( A*AINV - I ) / ( N * norm(A) * norm(AINV) * EPS ),
where 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] 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] A ``` A is DOUBLE PRECISION array, dimension (LDA,N) The triangular matrix A. If UPLO = 'U', the leading n by n upper triangular part of the array A contains the upper triangular matrix, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading n by n lower triangular part of the array A contains the lower triangular matrix, and the strictly upper triangular part of A is not referenced. If DIAG = 'U', the diagonal elements of A are also not referenced and are assumed to be 1.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).``` [in,out] AINV ``` AINV is DOUBLE PRECISION array, dimension (LDAINV,N) On entry, the (triangular) inverse of the matrix A, in the same storage format as A. On exit, the contents of AINV are destroyed.``` [in] LDAINV ``` LDAINV is INTEGER The leading dimension of the array AINV. LDAINV >= max(1,N).``` [out] RCOND ``` RCOND is DOUBLE PRECISION The reciprocal condition number of A, computed as 1/(norm(A) * norm(AINV)).``` [out] WORK ` WORK is DOUBLE PRECISION array, dimension (N)` [out] RESID ``` RESID is DOUBLE PRECISION norm(A*AINV - I) / ( N * norm(A) * norm(AINV) * EPS )```
Date
December 2016

Definition at line 126 of file dtrt01.f.

126 *
127 * -- LAPACK test routine (version 3.7.0) --
128 * -- LAPACK is a software package provided by Univ. of Tennessee, --
129 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
130 * December 2016
131 *
132 * .. Scalar Arguments ..
133  CHARACTER diag, uplo
134  INTEGER lda, ldainv, n
135  DOUBLE PRECISION rcond, resid
136 * ..
137 * .. Array Arguments ..
138  DOUBLE PRECISION a( lda, * ), ainv( ldainv, * ), work( * )
139 * ..
140 *
141 * =====================================================================
142 *
143 * .. Parameters ..
144  DOUBLE PRECISION zero, one
145  parameter( zero = 0.0d+0, one = 1.0d+0 )
146 * ..
147 * .. Local Scalars ..
148  INTEGER j
149  DOUBLE PRECISION ainvnm, anorm, eps
150 * ..
151 * .. External Functions ..
152  LOGICAL lsame
153  DOUBLE PRECISION dlamch, dlantr
154  EXTERNAL lsame, dlamch, dlantr
155 * ..
156 * .. External Subroutines ..
157  EXTERNAL dtrmv
158 * ..
159 * .. Intrinsic Functions ..
160  INTRINSIC dble
161 * ..
162 * .. Executable Statements ..
163 *
164 * Quick exit if N = 0
165 *
166  IF( n.LE.0 ) THEN
167  rcond = one
168  resid = zero
169  RETURN
170  END IF
171 *
172 * Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
173 *
174  eps = dlamch( 'Epsilon' )
175  anorm = dlantr( '1', uplo, diag, n, n, a, lda, work )
176  ainvnm = dlantr( '1', uplo, diag, n, n, ainv, ldainv, work )
177  IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
178  rcond = zero
179  resid = one / eps
180  RETURN
181  END IF
182  rcond = ( one / anorm ) / ainvnm
183 *
184 * Set the diagonal of AINV to 1 if AINV has unit diagonal.
185 *
186  IF( lsame( diag, 'U' ) ) THEN
187  DO 10 j = 1, n
188  ainv( j, j ) = one
189  10 CONTINUE
190  END IF
191 *
192 * Compute A * AINV, overwriting AINV.
193 *
194  IF( lsame( uplo, 'U' ) ) THEN
195  DO 20 j = 1, n
196  CALL dtrmv( 'Upper', 'No transpose', diag, j, a, lda,
197  \$ ainv( 1, j ), 1 )
198  20 CONTINUE
199  ELSE
200  DO 30 j = 1, n
201  CALL dtrmv( 'Lower', 'No transpose', diag, n-j+1, a( j, j ),
202  \$ lda, ainv( j, j ), 1 )
203  30 CONTINUE
204  END IF
205 *
206 * Subtract 1 from each diagonal element to form A*AINV - I.
207 *
208  DO 40 j = 1, n
209  ainv( j, j ) = ainv( j, j ) - one
210  40 CONTINUE
211 *
212 * Compute norm(A*AINV - I) / (N * norm(A) * norm(AINV) * EPS)
213 *
214  resid = dlantr( '1', uplo, 'Non-unit', n, n, ainv, ldainv, work )
215 *
216  resid = ( ( resid*rcond ) / dble( n ) ) / eps
217 *
218  RETURN
219 *
220 * End of DTRT01
221 *
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine dtrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
DTRMV
Definition: dtrmv.f:149
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function dlantr(NORM, UPLO, DIAG, M, N, A, LDA, WORK)
DLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix.
Definition: dlantr.f:143
Here is the call graph for this function:
Here is the caller graph for this function: