LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cbdt02 ( integer  M,
integer  N,
complex, dimension( ldb, * )  B,
integer  LDB,
complex, dimension( ldc, * )  C,
integer  LDC,
complex, dimension( ldu, * )  U,
integer  LDU,
complex, dimension( * )  WORK,
real, dimension( * )  RWORK,
real  RESID 
)

CBDT02

Purpose:
 CBDT02 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 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 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 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 array, dimension (M)
[out]RWORK
          RWORK is REAL array, dimension (M)
[out]RESID
          RESID is REAL
          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.
Date
November 2011

Definition at line 121 of file cbdt02.f.

121 *
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..--
125 * November 2011
126 *
127 * .. Scalar Arguments ..
128  INTEGER ldb, ldc, ldu, m, n
129  REAL resid
130 * ..
131 * .. Array Arguments ..
132  REAL rwork( * )
133  COMPLEX b( ldb, * ), c( ldc, * ), u( ldu, * ),
134  $ work( * )
135 * ..
136 *
137 * ======================================================================
138 *
139 * .. Parameters ..
140  REAL zero, one
141  parameter ( zero = 0.0e+0, one = 1.0e+0 )
142 * ..
143 * .. Local Scalars ..
144  INTEGER j
145  REAL bnorm, eps, realmn
146 * ..
147 * .. External Functions ..
148  REAL clange, scasum, slamch
149  EXTERNAL clange, scasum, slamch
150 * ..
151 * .. External Subroutines ..
152  EXTERNAL ccopy, cgemv
153 * ..
154 * .. Intrinsic Functions ..
155  INTRINSIC cmplx, max, min, real
156 * ..
157 * .. Executable Statements ..
158 *
159 * Quick return if possible
160 *
161  resid = zero
162  IF( m.LE.0 .OR. n.LE.0 )
163  $ RETURN
164  realmn = REAL( MAX( M, N ) )
165  eps = slamch( 'Precision' )
166 *
167 * Compute norm( B - U * C )
168 *
169  DO 10 j = 1, n
170  CALL ccopy( m, b( 1, j ), 1, work, 1 )
171  CALL cgemv( 'No transpose', m, m, -cmplx( one ), u, ldu,
172  $ c( 1, j ), 1, cmplx( one ), work, 1 )
173  resid = max( resid, scasum( m, work, 1 ) )
174  10 CONTINUE
175 *
176 * Compute norm of B.
177 *
178  bnorm = clange( '1', m, n, b, ldb, rwork )
179 *
180  IF( bnorm.LE.zero ) THEN
181  IF( resid.NE.zero )
182  $ resid = one / eps
183  ELSE
184  IF( bnorm.GE.resid ) THEN
185  resid = ( resid / bnorm ) / ( realmn*eps )
186  ELSE
187  IF( bnorm.LT.one ) THEN
188  resid = ( min( resid, realmn*bnorm ) / bnorm ) /
189  $ ( realmn*eps )
190  ELSE
191  resid = min( resid / bnorm, realmn ) / ( realmn*eps )
192  END IF
193  END IF
194  END IF
195  RETURN
196 *
197 * End of CBDT02
198 *
real function scasum(N, CX, INCX)
SCASUM
Definition: scasum.f:54
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:117
subroutine cgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
CGEMV
Definition: cgemv.f:160
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
Definition: ccopy.f:52
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69

Here is the call graph for this function:

Here is the caller graph for this function: