LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ 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.
Date
December 2016

Definition at line 157 of file cget51.f.

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