LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ cget51()

subroutine cget51 ( integer  itype,
integer  n,
complex, dimension( lda, * )  a,
integer  lda,
complex, dimension( ldb, * )  b,
integer  ldb,
complex, dimension( ldu, * )  u,
integer  ldu,
complex, dimension( ldv, * )  v,
integer  ldv,
complex, dimension( * )  work,
real, dimension( * )  rwork,
real  result 
)

CGET51

Purpose:
      CGET51  generally checks a decomposition of the form

              A = U B V**H

      where **H means conjugate transpose and U and V are unitary.

      Specifically, if ITYPE=1

              RESULT = | A - U B V**H | / ( |A| n ulp )

      If ITYPE=2, then:

              RESULT = | A - B | / ( |A| n ulp )

      If ITYPE=3, then:

              RESULT = | I - U U**H | / ( n ulp )
Parameters
[in]ITYPE
          ITYPE is INTEGER
          Specifies the type of tests to be performed.
          =1: RESULT = | A - U B V**H | / ( |A| n ulp )
          =2: RESULT = | A - B | / ( |A| n ulp )
          =3: RESULT = | I - U U**H | / ( n ulp )
[in]N
          N is INTEGER
          The size of the matrix.  If it is zero, CGET51 does nothing.
          It must be at least zero.
[in]A
          A is COMPLEX array, dimension (LDA, N)
          The original (unfactored) matrix.
[in]LDA
          LDA is INTEGER
          The leading dimension of A.  It must be at least 1
          and at least N.
[in]B
          B is COMPLEX array, dimension (LDB, N)
          The factored matrix.
[in]LDB
          LDB is INTEGER
          The leading dimension of B.  It must be at least 1
          and at least N.
[in]U
          U is COMPLEX array, dimension (LDU, N)
          The unitary matrix on the left-hand side in the
          decomposition.
          Not referenced if ITYPE=2
[in]LDU
          LDU is INTEGER
          The leading dimension of U.  LDU must be at least N and
          at least 1.
[in]V
          V is COMPLEX array, dimension (LDV, N)
          The unitary matrix on the left-hand side in the
          decomposition.
          Not referenced if ITYPE=2
[in]LDV
          LDV is INTEGER
          The leading dimension of V.  LDV must be at least N and
          at least 1.
[out]WORK
          WORK is COMPLEX array, dimension (2*N**2)
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]RESULT
          RESULT is REAL
          The values computed by the test specified by ITYPE.  The
          value is currently limited to 1/ulp, to avoid overflow.
          Errors are flagged by RESULT=10/ulp.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 153 of file cget51.f.

155*
156* -- LAPACK test routine --
157* -- LAPACK is a software package provided by Univ. of Tennessee, --
158* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
159*
160* .. Scalar Arguments ..
161 INTEGER ITYPE, LDA, LDB, LDU, LDV, N
162 REAL RESULT
163* ..
164* .. Array Arguments ..
165 REAL RWORK( * )
166 COMPLEX A( LDA, * ), B( LDB, * ), U( LDU, * ),
167 $ V( LDV, * ), WORK( * )
168* ..
169*
170* =====================================================================
171*
172* .. Parameters ..
173 REAL ZERO, ONE, TEN
174 parameter( zero = 0.0e+0, one = 1.0e+0, ten = 10.0e+0 )
175 COMPLEX CZERO, CONE
176 parameter( czero = ( 0.0e+0, 0.0e+0 ),
177 $ cone = ( 1.0e+0, 0.0e+0 ) )
178* ..
179* .. Local Scalars ..
180 INTEGER JCOL, JDIAG, JROW
181 REAL ANORM, ULP, UNFL, WNORM
182* ..
183* .. External Functions ..
184 REAL CLANGE, SLAMCH
185 EXTERNAL clange, slamch
186* ..
187* .. External Subroutines ..
188 EXTERNAL cgemm, clacpy
189* ..
190* .. Intrinsic Functions ..
191 INTRINSIC max, min, real
192* ..
193* .. Executable Statements ..
194*
195 result = zero
196 IF( n.LE.0 )
197 $ RETURN
198*
199* Constants
200*
201 unfl = slamch( 'Safe minimum' )
202 ulp = slamch( 'Epsilon' )*slamch( 'Base' )
203*
204* Some Error Checks
205*
206 IF( itype.LT.1 .OR. itype.GT.3 ) THEN
207 result = ten / ulp
208 RETURN
209 END IF
210*
211 IF( itype.LE.2 ) THEN
212*
213* Tests scaled by the norm(A)
214*
215 anorm = max( clange( '1', n, n, a, lda, rwork ), unfl )
216*
217 IF( itype.EQ.1 ) THEN
218*
219* ITYPE=1: Compute W = A - U B V**H
220*
221 CALL clacpy( ' ', n, n, a, lda, work, n )
222 CALL cgemm( 'N', 'N', n, n, n, cone, u, ldu, b, ldb, czero,
223 $ work( n**2+1 ), n )
224*
225 CALL cgemm( 'N', 'C', n, n, n, -cone, work( n**2+1 ), n, v,
226 $ ldv, cone, work, n )
227*
228 ELSE
229*
230* ITYPE=2: Compute W = A - B
231*
232 CALL clacpy( ' ', n, n, b, ldb, work, n )
233*
234 DO 20 jcol = 1, n
235 DO 10 jrow = 1, n
236 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
237 $ - a( jrow, jcol )
238 10 CONTINUE
239 20 CONTINUE
240 END IF
241*
242* Compute norm(W)/ ( ulp*norm(A) )
243*
244 wnorm = clange( '1', n, n, work, n, rwork )
245*
246 IF( anorm.GT.wnorm ) THEN
247 result = ( wnorm / anorm ) / ( n*ulp )
248 ELSE
249 IF( anorm.LT.one ) THEN
250 result = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
251 ELSE
252 result = min( wnorm / anorm, real( n ) ) / ( n*ulp )
253 END IF
254 END IF
255*
256 ELSE
257*
258* Tests not scaled by norm(A)
259*
260* ITYPE=3: Compute U U**H - I
261*
262 CALL cgemm( 'N', 'C', n, n, n, cone, u, ldu, u, ldu, czero,
263 $ work, n )
264*
265 DO 30 jdiag = 1, n
266 work( ( n+1 )*( jdiag-1 )+1 ) = work( ( n+1 )*( jdiag-1 )+
267 $ 1 ) - cone
268 30 CONTINUE
269*
270 result = min( clange( '1', n, n, work, n, rwork ),
271 $ real( n ) ) / ( n*ulp )
272 END IF
273*
274 RETURN
275*
276* End of CGET51
277*
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
Definition cgemm.f:188
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
Definition clacpy.f:103
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
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:115
Here is the call graph for this function:
Here is the caller graph for this function: