LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ zbdt02()

subroutine zbdt02 ( integer  M,
integer  N,
complex*16, dimension( ldb, * )  B,
integer  LDB,
complex*16, dimension( ldc, * )  C,
integer  LDC,
complex*16, dimension( ldu, * )  U,
integer  LDU,
complex*16, dimension( * )  WORK,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

ZBDT02

Purpose:
 ZBDT02 tests the change of basis C = U' * B by computing the residual

    RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),

 where B and C are M by N matrices, U is an M by M orthogonal matrix,
 and EPS is the machine precision.
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrices B and C and the order of
          the matrix Q.
[in]N
          N is INTEGER
          The number of columns of the matrices B and C.
[in]B
          B is COMPLEX*16 array, dimension (LDB,N)
          The m by n matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,M).
[in]C
          C is COMPLEX*16 array, dimension (LDC,N)
          The m by n matrix C, assumed to contain U' * B.
[in]LDC
          LDC is INTEGER
          The leading dimension of the array C.  LDC >= max(1,M).
[in]U
          U is COMPLEX*16 array, dimension (LDU,M)
          The m by m orthogonal matrix U.
[in]LDU
          LDU is INTEGER
          The leading dimension of the array U.  LDU >= max(1,M).
[out]WORK
          WORK is COMPLEX*16 array, dimension (M)
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (M)
[out]RESID
          RESID is DOUBLE PRECISION
          RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 117 of file zbdt02.f.

119 *
120 * -- LAPACK test routine --
121 * -- LAPACK is a software package provided by Univ. of Tennessee, --
122 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123 *
124 * .. Scalar Arguments ..
125  INTEGER LDB, LDC, LDU, M, N
126  DOUBLE PRECISION RESID
127 * ..
128 * .. Array Arguments ..
129  DOUBLE PRECISION RWORK( * )
130  COMPLEX*16 B( LDB, * ), C( LDC, * ), U( LDU, * ),
131  $ WORK( * )
132 * ..
133 *
134 * ======================================================================
135 *
136 * .. Parameters ..
137  DOUBLE PRECISION ZERO, ONE
138  parameter( zero = 0.0d+0, one = 1.0d+0 )
139 * ..
140 * .. Local Scalars ..
141  INTEGER J
142  DOUBLE PRECISION BNORM, EPS, REALMN
143 * ..
144 * .. External Functions ..
145  DOUBLE PRECISION DLAMCH, DZASUM, ZLANGE
146  EXTERNAL dlamch, dzasum, zlange
147 * ..
148 * .. External Subroutines ..
149  EXTERNAL zcopy, zgemv
150 * ..
151 * .. Intrinsic Functions ..
152  INTRINSIC dble, dcmplx, max, min
153 * ..
154 * .. Executable Statements ..
155 *
156 * Quick return if possible
157 *
158  resid = zero
159  IF( m.LE.0 .OR. n.LE.0 )
160  $ RETURN
161  realmn = dble( max( m, n ) )
162  eps = dlamch( 'Precision' )
163 *
164 * Compute norm( B - U * C )
165 *
166  DO 10 j = 1, n
167  CALL zcopy( m, b( 1, j ), 1, work, 1 )
168  CALL zgemv( 'No transpose', m, m, -dcmplx( one ), u, ldu,
169  $ c( 1, j ), 1, dcmplx( one ), work, 1 )
170  resid = max( resid, dzasum( m, work, 1 ) )
171  10 CONTINUE
172 *
173 * Compute norm of B.
174 *
175  bnorm = zlange( '1', m, n, b, ldb, rwork )
176 *
177  IF( bnorm.LE.zero ) THEN
178  IF( resid.NE.zero )
179  $ resid = one / eps
180  ELSE
181  IF( bnorm.GE.resid ) THEN
182  resid = ( resid / bnorm ) / ( realmn*eps )
183  ELSE
184  IF( bnorm.LT.one ) THEN
185  resid = ( min( resid, realmn*bnorm ) / bnorm ) /
186  $ ( realmn*eps )
187  ELSE
188  resid = min( resid / bnorm, realmn ) / ( realmn*eps )
189  END IF
190  END IF
191  END IF
192  RETURN
193 *
194 * End of ZBDT02
195 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:81
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
Definition: zgemv.f:158
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:115
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:72
Here is the call graph for this function:
Here is the caller graph for this function: