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

◆ zget51()

subroutine zget51 ( integer  itype,
integer  n,
complex*16, dimension( lda, * )  a,
integer  lda,
complex*16, dimension( ldb, * )  b,
integer  ldb,
complex*16, dimension( ldu, * )  u,
integer  ldu,
complex*16, dimension( ldv, * )  v,
integer  ldv,
complex*16, dimension( * )  work,
double precision, dimension( * )  rwork,
double precision  result 
)

ZGET51

Purpose:
      ZGET51  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, ZGET51 does nothing.
          It must be at least zero.
[in]A
          A is COMPLEX*16 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*16 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*16 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*16 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*16 array, dimension (2*N**2)
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RESULT
          RESULT is DOUBLE PRECISION
          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 zget51.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 DOUBLE PRECISION RESULT
163* ..
164* .. Array Arguments ..
165 DOUBLE PRECISION RWORK( * )
166 COMPLEX*16 A( LDA, * ), B( LDB, * ), U( LDU, * ),
167 $ V( LDV, * ), WORK( * )
168* ..
169*
170* =====================================================================
171*
172* .. Parameters ..
173 DOUBLE PRECISION ZERO, ONE, TEN
174 parameter( zero = 0.0d+0, one = 1.0d+0, ten = 10.0d+0 )
175 COMPLEX*16 CZERO, CONE
176 parameter( czero = ( 0.0d+0, 0.0d+0 ),
177 $ cone = ( 1.0d+0, 0.0d+0 ) )
178* ..
179* .. Local Scalars ..
180 INTEGER JCOL, JDIAG, JROW
181 DOUBLE PRECISION ANORM, ULP, UNFL, WNORM
182* ..
183* .. External Functions ..
184 DOUBLE PRECISION DLAMCH, ZLANGE
185 EXTERNAL dlamch, zlange
186* ..
187* .. External Subroutines ..
188 EXTERNAL zgemm, zlacpy
189* ..
190* .. Intrinsic Functions ..
191 INTRINSIC dble, max, min
192* ..
193* .. Executable Statements ..
194*
195 result = zero
196 IF( n.LE.0 )
197 $ RETURN
198*
199* Constants
200*
201 unfl = dlamch( 'Safe minimum' )
202 ulp = dlamch( 'Epsilon' )*dlamch( '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( zlange( '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 zlacpy( ' ', n, n, a, lda, work, n )
222 CALL zgemm( 'N', 'N', n, n, n, cone, u, ldu, b, ldb, czero,
223 $ work( n**2+1 ), n )
224*
225 CALL zgemm( '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 zlacpy( ' ', 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 = zlange( '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, dble( 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 zgemm( '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( zlange( '1', n, n, work, n, rwork ),
271 $ dble( n ) ) / ( n*ulp )
272 END IF
273*
274 RETURN
275*
276* End of ZGET51
277*
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
Definition zgemm.f:188
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
Definition zlacpy.f:103
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
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
Here is the call graph for this function:
Here is the caller graph for this function: