LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
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 VC>
      where * means conjugate transpose and U and V are unitary.

      Specifically, if ITYPE=1

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

      If ITYPE=2, then:

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

      If ITYPE=3, then:

              RESULT = | I - UU* | / ( n ulp )
Parameters
[in]ITYPE
          ITYPE is INTEGER
          Specifies the type of tests to be performed.
          =1: RESULT = | A - U B V* | / ( |A| n ulp )
          =2: RESULT = | A - B | / ( |A| n ulp )
          =3: RESULT = | I - UU* | / ( 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.
Date
November 2011

Definition at line 156 of file zget51.f.

156 *
157 * -- LAPACK test routine (version 3.4.0) --
158 * -- LAPACK is a software package provided by Univ. of Tennessee, --
159 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
160 * November 2011
161 *
162 * .. Scalar Arguments ..
163  INTEGER itype, lda, ldb, ldu, ldv, n
164  DOUBLE PRECISION result
165 * ..
166 * .. Array Arguments ..
167  DOUBLE PRECISION rwork( * )
168  COMPLEX*16 a( lda, * ), b( ldb, * ), u( ldu, * ),
169  $ v( ldv, * ), work( * )
170 * ..
171 *
172 * =====================================================================
173 *
174 * .. Parameters ..
175  DOUBLE PRECISION zero, one, ten
176  parameter ( zero = 0.0d+0, one = 1.0d+0, ten = 10.0d+0 )
177  COMPLEX*16 czero, cone
178  parameter ( czero = ( 0.0d+0, 0.0d+0 ),
179  $ cone = ( 1.0d+0, 0.0d+0 ) )
180 * ..
181 * .. Local Scalars ..
182  INTEGER jcol, jdiag, jrow
183  DOUBLE PRECISION anorm, ulp, unfl, wnorm
184 * ..
185 * .. External Functions ..
186  DOUBLE PRECISION dlamch, zlange
187  EXTERNAL dlamch, zlange
188 * ..
189 * .. External Subroutines ..
190  EXTERNAL zgemm, zlacpy
191 * ..
192 * .. Intrinsic Functions ..
193  INTRINSIC dble, max, min
194 * ..
195 * .. Executable Statements ..
196 *
197  result = zero
198  IF( n.LE.0 )
199  $ RETURN
200 *
201 * Constants
202 *
203  unfl = dlamch( 'Safe minimum' )
204  ulp = dlamch( 'Epsilon' )*dlamch( 'Base' )
205 *
206 * Some Error Checks
207 *
208  IF( itype.LT.1 .OR. itype.GT.3 ) THEN
209  result = ten / ulp
210  RETURN
211  END IF
212 *
213  IF( itype.LE.2 ) THEN
214 *
215 * Tests scaled by the norm(A)
216 *
217  anorm = max( zlange( '1', n, n, a, lda, rwork ), unfl )
218 *
219  IF( itype.EQ.1 ) THEN
220 *
221 * ITYPE=1: Compute W = A - UBV'
222 *
223  CALL zlacpy( ' ', n, n, a, lda, work, n )
224  CALL zgemm( 'N', 'N', n, n, n, cone, u, ldu, b, ldb, czero,
225  $ work( n**2+1 ), n )
226 *
227  CALL zgemm( 'N', 'C', n, n, n, -cone, work( n**2+1 ), n, v,
228  $ ldv, cone, work, n )
229 *
230  ELSE
231 *
232 * ITYPE=2: Compute W = A - B
233 *
234  CALL zlacpy( ' ', n, n, b, ldb, work, n )
235 *
236  DO 20 jcol = 1, n
237  DO 10 jrow = 1, n
238  work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
239  $ - a( jrow, jcol )
240  10 CONTINUE
241  20 CONTINUE
242  END IF
243 *
244 * Compute norm(W)/ ( ulp*norm(A) )
245 *
246  wnorm = zlange( '1', n, n, work, n, rwork )
247 *
248  IF( anorm.GT.wnorm ) THEN
249  result = ( wnorm / anorm ) / ( n*ulp )
250  ELSE
251  IF( anorm.LT.one ) THEN
252  result = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
253  ELSE
254  result = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
255  END IF
256  END IF
257 *
258  ELSE
259 *
260 * Tests not scaled by norm(A)
261 *
262 * ITYPE=3: Compute UU' - I
263 *
264  CALL zgemm( 'N', 'C', n, n, n, cone, u, ldu, u, ldu, czero,
265  $ work, n )
266 *
267  DO 30 jdiag = 1, n
268  work( ( n+1 )*( jdiag-1 )+1 ) = work( ( n+1 )*( jdiag-1 )+
269  $ 1 ) - cone
270  30 CONTINUE
271 *
272  result = min( zlange( '1', n, n, work, n, rwork ),
273  $ dble( n ) ) / ( n*ulp )
274  END IF
275 *
276  RETURN
277 *
278 * End of ZGET51
279 *
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
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:117

Here is the call graph for this function:

Here is the caller graph for this function: