3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DBDT02( M, N, B, LDB, C, LDC, U, LDU, WORK, RESID )
13 * .. Scalar Arguments ..
14 * INTEGER LDB, LDC, LDU, M, N
15 * DOUBLE PRECISION RESID
17 * .. Array Arguments ..
18 * DOUBLE PRECISION B( LDB, * ), C( LDC, * ), U( LDU, * ),
28 *> DBDT02 tests the change of basis C = U' * B by computing the residual
30 *> RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),
32 *> where B and C are M by N matrices, U is an M by M orthogonal matrix,
33 *> and EPS is the machine precision.
42 *> The number of rows of the matrices B and C and the order of
49 *> The number of columns of the matrices B and C.
54 *> B is DOUBLE PRECISION array, dimension (LDB,N)
55 *> The m by n matrix B.
61 *> The leading dimension of the array B. LDB >= max(1,M).
66 *> C is DOUBLE PRECISION array, dimension (LDC,N)
67 *> The m by n matrix C, assumed to contain U' * B.
73 *> The leading dimension of the array C. LDC >= max(1,M).
78 *> U is DOUBLE PRECISION array, dimension (LDU,M)
79 *> The m by m orthogonal matrix U.
85 *> The leading dimension of the array U. LDU >= max(1,M).
90 *> WORK is DOUBLE PRECISION array, dimension (M)
95 *> RESID is DOUBLE PRECISION
96 *> RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),
102 *> \author Univ. of Tennessee
103 *> \author Univ. of California Berkeley
104 *> \author Univ. of Colorado Denver
107 *> \date November 2011
109 *> \ingroup double_eig
111 * =====================================================================
112 SUBROUTINE DBDT02( M, N, B, LDB, C, LDC, U, LDU, WORK, RESID )
114 * -- LAPACK test routine (version 3.4.0) --
115 * -- LAPACK is a software package provided by Univ. of Tennessee, --
116 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
119 * .. Scalar Arguments ..
120 INTEGER LDB, LDC, LDU, M, N
121 DOUBLE PRECISION RESID
123 * .. Array Arguments ..
124 DOUBLE PRECISION B( LDB, * ), C( LDC, * ), U( LDU, * ),
128 * ======================================================================
131 DOUBLE PRECISION ZERO, ONE
132 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
134 * .. Local Scalars ..
136 DOUBLE PRECISION BNORM, EPS, REALMN
138 * .. External Functions ..
139 DOUBLE PRECISION DASUM, DLAMCH, DLANGE
140 EXTERNAL DASUM, DLAMCH, DLANGE
142 * .. External Subroutines ..
143 EXTERNAL DCOPY, DGEMV
145 * .. Intrinsic Functions ..
146 INTRINSIC DBLE, MAX, MIN
148 * .. Executable Statements ..
150 * Quick return if possible
153 IF( M.LE.0 .OR. N.LE.0 )
155 REALMN = DBLE( MAX( M, N ) )
156 EPS = DLAMCH( 'Precision' )
158 * Compute norm( B - U * C )
161 CALL DCOPY( M, B( 1, J ), 1, WORK, 1 )
162 CALL DGEMV( 'No transpose', M, M, -ONE, U, LDU, C( 1, J ), 1,
164 RESID = MAX( RESID, DASUM( M, WORK, 1 ) )
169 BNORM = DLANGE( '1', M, N, B, LDB, WORK )
171 IF( BNORM.LE.ZERO ) THEN
175 IF( BNORM.GE.RESID ) THEN
176 RESID = ( RESID / BNORM ) / ( REALMN*EPS )
178 IF( BNORM.LT.ONE ) THEN
179 RESID = ( MIN( RESID, REALMN*BNORM ) / BNORM ) /
182 RESID = MIN( RESID / BNORM, REALMN ) / ( REALMN*EPS )