LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dget54()

subroutine dget54 ( integer n,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( lds, * ) s,
integer lds,
double precision, dimension( ldt, * ) t,
integer ldt,
double precision, dimension( ldu, * ) u,
integer ldu,
double precision, dimension( ldv, * ) v,
integer ldv,
double precision, dimension( * ) work,
double precision result )

DGET54

Purpose:
!>
!> DGET54 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, DGET54 does nothing.
!>          It must be at least zero.
!> 
[in]A
!>          A is DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (3*N**2)
!> 
[out]RESULT
!>          RESULT is DOUBLE PRECISION
!>          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.

Definition at line 154 of file dget54.f.

156*
157* -- LAPACK test routine --
158* -- LAPACK is a software package provided by Univ. of Tennessee, --
159* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
160*
161* .. Scalar Arguments ..
162 INTEGER LDA, LDB, LDS, LDT, LDU, LDV, N
163 DOUBLE PRECISION RESULT
164* ..
165* .. Array Arguments ..
166 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), S( LDS, * ),
167 $ T( LDT, * ), U( LDU, * ), V( LDV, * ),
168 $ WORK( * )
169* ..
170*
171* =====================================================================
172*
173* .. Parameters ..
174 DOUBLE PRECISION ZERO, ONE
175 parameter( zero = 0.0d+0, one = 1.0d+0 )
176* ..
177* .. Local Scalars ..
178 DOUBLE PRECISION ABNORM, ULP, UNFL, WNORM
179* ..
180* .. Local Arrays ..
181 DOUBLE PRECISION DUM( 1 )
182* ..
183* .. External Functions ..
184 DOUBLE PRECISION DLAMCH, DLANGE
185 EXTERNAL dlamch, dlange
186* ..
187* .. External Subroutines ..
188 EXTERNAL dgemm, dlacpy
189* ..
190* .. Intrinsic Functions ..
191 INTRINSIC dble, max, min
192* ..
193* .. Executable Statements ..
194*
195 result = zero
196 IF( n.LE.0 )
197 $ RETURN
198*
199* Constants
200*
201 unfl = dlamch( 'Safe minimum' )
202 ulp = dlamch( 'Epsilon' )*dlamch( 'Base' )
203*
204* compute the norm of (A,B)
205*
206 CALL dlacpy( 'Full', n, n, a, lda, work, n )
207 CALL dlacpy( 'Full', n, n, b, ldb, work( n*n+1 ), n )
208 abnorm = max( dlange( '1', n, 2*n, work, n, dum ), unfl )
209*
210* Compute W1 = A - U*S*V', and put in the array WORK(1:N*N)
211*
212 CALL dlacpy( ' ', n, n, a, lda, work, n )
213 CALL dgemm( 'N', 'N', n, n, n, one, u, ldu, s, lds, zero,
214 $ work( n*n+1 ), n )
215*
216 CALL dgemm( 'N', 'C', n, n, n, -one, work( n*n+1 ), n, v, ldv,
217 $ one, work, n )
218*
219* Compute W2 = B - U*T*V', and put in the workarray W(N*N+1:2*N*N)
220*
221 CALL dlacpy( ' ', n, n, b, ldb, work( n*n+1 ), n )
222 CALL dgemm( 'N', 'N', n, n, n, one, u, ldu, t, ldt, zero,
223 $ work( 2*n*n+1 ), n )
224*
225 CALL dgemm( 'N', 'C', n, n, n, -one, work( 2*n*n+1 ), n, v, ldv,
226 $ one, work( n*n+1 ), n )
227*
228* Compute norm(W)/ ( ulp*norm((A,B)) )
229*
230 wnorm = dlange( '1', n, 2*n, work, n, dum )
231*
232 IF( abnorm.GT.wnorm ) THEN
233 result = ( wnorm / abnorm ) / ( 2*n*ulp )
234 ELSE
235 IF( abnorm.LT.one ) THEN
236 result = ( min( wnorm, 2*n*abnorm ) / abnorm ) / ( 2*n*ulp )
237 ELSE
238 result = min( wnorm / abnorm, dble( 2*n ) ) / ( 2*n*ulp )
239 END IF
240 END IF
241*
242 RETURN
243*
244* End of DGET54
245*
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
Definition dgemm.f:188
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
Definition dlacpy.f:101
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function dlange(norm, m, n, a, lda, work)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition dlange.f:112
Here is the call graph for this function:
Here is the caller graph for this function: