3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE ZBDT02( M, N, B, LDB, C, LDC, U, LDU, WORK, RWORK,
14 * .. Scalar Arguments ..
15 * INTEGER LDB, LDC, LDU, M, N
16 * DOUBLE PRECISION RESID
18 * .. Array Arguments ..
19 * DOUBLE PRECISION RWORK( * )
20 * COMPLEX*16 B( LDB, * ), C( LDC, * ), U( LDU, * ),
30 *> ZBDT02 tests the change of basis C = U' * B by computing the residual
32 *> RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),
34 *> where B and C are M by N matrices, U is an M by M orthogonal matrix,
35 *> and EPS is the machine precision.
44 *> The number of rows of the matrices B and C and the order of
51 *> The number of columns of the matrices B and C.
56 *> B is COMPLEX*16 array, dimension (LDB,N)
57 *> The m by n matrix B.
63 *> The leading dimension of the array B. LDB >= max(1,M).
68 *> C is COMPLEX*16 array, dimension (LDC,N)
69 *> The m by n matrix C, assumed to contain U' * B.
75 *> The leading dimension of the array C. LDC >= max(1,M).
80 *> U is COMPLEX*16 array, dimension (LDU,M)
81 *> The m by m orthogonal matrix U.
87 *> The leading dimension of the array U. LDU >= max(1,M).
92 *> WORK is COMPLEX*16 array, dimension (M)
97 *> RWORK is DOUBLE PRECISION array, dimension (M)
102 *> RESID is DOUBLE PRECISION
103 *> RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),
109 *> \author Univ. of Tennessee
110 *> \author Univ. of California Berkeley
111 *> \author Univ. of Colorado Denver
114 *> \date November 2011
116 *> \ingroup complex16_eig
118 * =====================================================================
119 SUBROUTINE ZBDT02( M, N, B, LDB, C, LDC, U, LDU, WORK, RWORK,
122 * -- LAPACK test routine (version 3.4.0) --
123 * -- LAPACK is a software package provided by Univ. of Tennessee, --
124 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
127 * .. Scalar Arguments ..
128 INTEGER LDB, LDC, LDU, M, N
129 DOUBLE PRECISION RESID
131 * .. Array Arguments ..
132 DOUBLE PRECISION RWORK( * )
133 COMPLEX*16 B( LDB, * ), C( LDC, * ), U( LDU, * ),
137 * ======================================================================
140 DOUBLE PRECISION ZERO, ONE
141 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
143 * .. Local Scalars ..
145 DOUBLE PRECISION BNORM, EPS, REALMN
147 * .. External Functions ..
148 DOUBLE PRECISION DLAMCH, DZASUM, ZLANGE
149 EXTERNAL DLAMCH, DZASUM, ZLANGE
151 * .. External Subroutines ..
152 EXTERNAL ZCOPY, ZGEMV
154 * .. Intrinsic Functions ..
155 INTRINSIC DBLE, DCMPLX, MAX, MIN
157 * .. Executable Statements ..
159 * Quick return if possible
162 IF( M.LE.0 .OR. N.LE.0 )
164 REALMN = DBLE( MAX( M, N ) )
165 EPS = DLAMCH( 'Precision' )
167 * Compute norm( B - U * C )
170 CALL ZCOPY( M, B( 1, J ), 1, WORK, 1 )
171 CALL ZGEMV( 'No transpose', M, M, -DCMPLX( ONE ), U, LDU,
172 $ C( 1, J ), 1, DCMPLX( ONE ), WORK, 1 )
173 RESID = MAX( RESID, DZASUM( M, WORK, 1 ) )
178 BNORM = ZLANGE( '1', M, N, B, LDB, RWORK )
180 IF( BNORM.LE.ZERO ) THEN
184 IF( BNORM.GE.RESID ) THEN
185 RESID = ( RESID / BNORM ) / ( REALMN*EPS )
187 IF( BNORM.LT.ONE ) THEN
188 RESID = ( MIN( RESID, REALMN*BNORM ) / BNORM ) /
191 RESID = MIN( RESID / BNORM, REALMN ) / ( REALMN*EPS )