LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ cget54()

subroutine cget54 ( integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldb, * )  B,
integer  LDB,
complex, dimension( lds, * )  S,
integer  LDS,
complex, dimension( ldt, * )  T,
integer  LDT,
complex, dimension( ldu, * )  U,
integer  LDU,
complex, dimension( ldv, * )  V,
integer  LDV,
complex, dimension( * )  WORK,
real  RESULT 
)

CGET54

Purpose:
 CGET54 checks a generalized decomposition of the form

          A = U*S*V'  and B = U*T* V'

 where ' means conjugate transpose and U and V are unitary.

 Specifically,

   RESULT = ||( A - U*S*V', B - U*T*V' )|| / (||( A, B )||*n*ulp )
Parameters
[in]N
          N is INTEGER
          The size of the matrix.  If it is zero, SGET54 does nothing.
          It must be at least zero.
[in]A
          A is COMPLEX array, dimension (LDA, N)
          The original (unfactored) matrix A.
[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 original (unfactored) matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of B.  It must be at least 1
          and at least N.
[in]S
          S is COMPLEX array, dimension (LDS, N)
          The factored matrix S.
[in]LDS
          LDS is INTEGER
          The leading dimension of S.  It must be at least 1
          and at least N.
[in]T
          T is COMPLEX array, dimension (LDT, N)
          The factored matrix T.
[in]LDT
          LDT is INTEGER
          The leading dimension of T.  It must be at least 1
          and at least N.
[in]U
          U is COMPLEX array, dimension (LDU, N)
          The orthogonal matrix on the left-hand side in the
          decomposition.
[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 orthogonal matrix on the left-hand side in the
          decomposition.
[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 (3*N**2)
[out]RESULT
          RESULT is REAL
          The value RESULT, It 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 158 of file cget54.f.

158 *
159 * -- LAPACK test routine (version 3.7.0) --
160 * -- LAPACK is a software package provided by Univ. of Tennessee, --
161 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
162 * December 2016
163 *
164 * .. Scalar Arguments ..
165  INTEGER lda, ldb, lds, ldt, ldu, ldv, n
166  REAL result
167 * ..
168 * .. Array Arguments ..
169  COMPLEX a( lda, * ), b( ldb, * ), s( lds, * ),
170  $ t( ldt, * ), u( ldu, * ), v( ldv, * ),
171  $ work( * )
172 * ..
173 *
174 * =====================================================================
175 *
176 * .. Parameters ..
177  REAL zero, one
178  parameter( zero = 0.0e+0, one = 1.0e+0 )
179  COMPLEX czero, cone
180  parameter( czero = ( 0.0e+0, 0.0e+0 ),
181  $ cone = ( 1.0e+0, 0.0e+0 ) )
182 * ..
183 * .. Local Scalars ..
184  REAL abnorm, ulp, unfl, wnorm
185 * ..
186 * .. Local Arrays ..
187  REAL dum( 1 )
188 * ..
189 * .. External Functions ..
190  REAL clange, slamch
191  EXTERNAL clange, slamch
192 * ..
193 * .. External Subroutines ..
194  EXTERNAL cgemm, clacpy
195 * ..
196 * .. Intrinsic Functions ..
197  INTRINSIC max, min, real
198 * ..
199 * .. Executable Statements ..
200 *
201  result = zero
202  IF( n.LE.0 )
203  $ RETURN
204 *
205 * Constants
206 *
207  unfl = slamch( 'Safe minimum' )
208  ulp = slamch( 'Epsilon' )*slamch( 'Base' )
209 *
210 * compute the norm of (A,B)
211 *
212  CALL clacpy( 'Full', n, n, a, lda, work, n )
213  CALL clacpy( 'Full', n, n, b, ldb, work( n*n+1 ), n )
214  abnorm = max( clange( '1', n, 2*n, work, n, dum ), unfl )
215 *
216 * Compute W1 = A - U*S*V', and put in the array WORK(1:N*N)
217 *
218  CALL clacpy( ' ', n, n, a, lda, work, n )
219  CALL cgemm( 'N', 'N', n, n, n, cone, u, ldu, s, lds, czero,
220  $ work( n*n+1 ), n )
221 *
222  CALL cgemm( 'N', 'C', n, n, n, -cone, work( n*n+1 ), n, v, ldv,
223  $ cone, work, n )
224 *
225 * Compute W2 = B - U*T*V', and put in the workarray W(N*N+1:2*N*N)
226 *
227  CALL clacpy( ' ', n, n, b, ldb, work( n*n+1 ), n )
228  CALL cgemm( 'N', 'N', n, n, n, cone, u, ldu, t, ldt, czero,
229  $ work( 2*n*n+1 ), n )
230 *
231  CALL cgemm( 'N', 'C', n, n, n, -cone, work( 2*n*n+1 ), n, v, ldv,
232  $ cone, work( n*n+1 ), n )
233 *
234 * Compute norm(W)/ ( ulp*norm((A,B)) )
235 *
236  wnorm = clange( '1', n, 2*n, work, n, dum )
237 *
238  IF( abnorm.GT.wnorm ) THEN
239  result = ( wnorm / abnorm ) / ( 2*n*ulp )
240  ELSE
241  IF( abnorm.LT.one ) THEN
242  result = ( min( wnorm, 2*n*abnorm ) / abnorm ) / ( 2*n*ulp )
243  ELSE
244  result = min( wnorm / abnorm, REAL( 2*N ) ) / ( 2*n*ulp )
245  END IF
246  END IF
247 *
248  RETURN
249 *
250 * End of CGET54
251 *
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: