LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ sget54()

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

SGET54

Purpose:
 SGET54 checks a generalized decomposition of the form

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

 where ' means transpose and U and V are orthogonal.

 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 REAL 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 REAL 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 REAL 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 REAL 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 REAL 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 REAL 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 REAL 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 sget54.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  REAL 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 * ..
180 * .. Local Scalars ..
181  REAL abnorm, ulp, unfl, wnorm
182 * ..
183 * .. Local Arrays ..
184  REAL dum( 1 )
185 * ..
186 * .. External Functions ..
187  REAL slamch, slange
188  EXTERNAL slamch, slange
189 * ..
190 * .. External Subroutines ..
191  EXTERNAL sgemm, slacpy
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 * compute the norm of (A,B)
208 *
209  CALL slacpy( 'Full', n, n, a, lda, work, n )
210  CALL slacpy( 'Full', n, n, b, ldb, work( n*n+1 ), n )
211  abnorm = max( slange( '1', n, 2*n, work, n, dum ), unfl )
212 *
213 * Compute W1 = A - U*S*V', and put in the array WORK(1:N*N)
214 *
215  CALL slacpy( ' ', n, n, a, lda, work, n )
216  CALL sgemm( 'N', 'N', n, n, n, one, u, ldu, s, lds, zero,
217  $ work( n*n+1 ), n )
218 *
219  CALL sgemm( 'N', 'C', n, n, n, -one, work( n*n+1 ), n, v, ldv,
220  $ one, work, n )
221 *
222 * Compute W2 = B - U*T*V', and put in the workarray W(N*N+1:2*N*N)
223 *
224  CALL slacpy( ' ', n, n, b, ldb, work( n*n+1 ), n )
225  CALL sgemm( 'N', 'N', n, n, n, one, u, ldu, t, ldt, zero,
226  $ work( 2*n*n+1 ), n )
227 *
228  CALL sgemm( 'N', 'C', n, n, n, -one, work( 2*n*n+1 ), n, v, ldv,
229  $ one, work( n*n+1 ), n )
230 *
231 * Compute norm(W)/ ( ulp*norm((A,B)) )
232 *
233  wnorm = slange( '1', n, 2*n, work, n, dum )
234 *
235  IF( abnorm.GT.wnorm ) THEN
236  result = ( wnorm / abnorm ) / ( 2*n*ulp )
237  ELSE
238  IF( abnorm.LT.one ) THEN
239  result = ( min( wnorm, 2*n*abnorm ) / abnorm ) / ( 2*n*ulp )
240  ELSE
241  result = min( wnorm / abnorm, REAL( 2*N ) ) / ( 2*n*ulp )
242  END IF
243  END IF
244 *
245  RETURN
246 *
247 * End of SGET54
248 *
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
Definition: sgemm.f:189
real function slange(NORM, M, N, A, LDA, WORK)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: slange.f:116
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
Definition: slacpy.f:105
Here is the call graph for this function:
Here is the caller graph for this function: