LAPACK  3.8.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 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, 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 156 of file cget51.f.

156 *
157 * -- LAPACK test routine (version 3.7.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 * December 2016
161 *
162 * .. Scalar Arguments ..
163  INTEGER itype, lda, ldb, ldu, ldv, n
164  REAL result
165 * ..
166 * .. Array Arguments ..
167  REAL rwork( * )
168  COMPLEX a( lda, * ), b( ldb, * ), u( ldu, * ),
169  $ v( ldv, * ), work( * )
170 * ..
171 *
172 * =====================================================================
173 *
174 * .. Parameters ..
175  REAL zero, one, ten
176  parameter( zero = 0.0e+0, one = 1.0e+0, ten = 10.0e+0 )
177  COMPLEX czero, cone
178  parameter( czero = ( 0.0e+0, 0.0e+0 ),
179  $ cone = ( 1.0e+0, 0.0e+0 ) )
180 * ..
181 * .. Local Scalars ..
182  INTEGER jcol, jdiag, jrow
183  REAL anorm, ulp, unfl, wnorm
184 * ..
185 * .. External Functions ..
186  REAL clange, slamch
187  EXTERNAL clange, slamch
188 * ..
189 * .. External Subroutines ..
190  EXTERNAL cgemm, clacpy
191 * ..
192 * .. Intrinsic Functions ..
193  INTRINSIC max, min, real
194 * ..
195 * .. Executable Statements ..
196 *
197  result = zero
198  IF( n.LE.0 )
199  $ RETURN
200 *
201 * Constants
202 *
203  unfl = slamch( 'Safe minimum' )
204  ulp = slamch( 'Epsilon' )*slamch( '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( clange( '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 clacpy( ' ', n, n, a, lda, work, n )
224  CALL cgemm( 'N', 'N', n, n, n, cone, u, ldu, b, ldb, czero,
225  $ work( n**2+1 ), n )
226 *
227  CALL cgemm( '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 clacpy( ' ', 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 = clange( '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, REAL( 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 cgemm( '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( clange( '1', n, n, work, n, rwork ),
273  $ REAL( N ) ) / ( n*ulp )
274  END IF
275 *
276  RETURN
277 *
278 * End of CGET51
279 *
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
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
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
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
Definition: cgemm.f:189
Here is the call graph for this function:
Here is the caller graph for this function: