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

◆ dget51()

subroutine dget51 ( integer  itype,
integer  n,
double precision, dimension( lda, * )  a,
integer  lda,
double precision, dimension( ldb, * )  b,
integer  ldb,
double precision, dimension( ldu, * )  u,
integer  ldu,
double precision, dimension( ldv, * )  v,
integer  ldv,
double precision, dimension( * )  work,
double precision  result 
)

DGET51

Purpose:
      DGET51  generally checks a decomposition of the form

              A = U B V'

      where ' means transpose and U and V are orthogonal.

      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, DGET51 does nothing.
          It must be at least zero.
[in]A
          A is DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (LDU, N)
          The orthogonal 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 DOUBLE PRECISION array, dimension (LDV, N)
          The orthogonal 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 DOUBLE PRECISION array, dimension (2*N**2)
[out]RESULT
          RESULT is DOUBLE PRECISION
          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.

Definition at line 147 of file dget51.f.

149*
150* -- LAPACK test routine --
151* -- LAPACK is a software package provided by Univ. of Tennessee, --
152* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
153*
154* .. Scalar Arguments ..
155 INTEGER ITYPE, LDA, LDB, LDU, LDV, N
156 DOUBLE PRECISION RESULT
157* ..
158* .. Array Arguments ..
159 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), U( LDU, * ),
160 $ V( LDV, * ), WORK( * )
161* ..
162*
163* =====================================================================
164*
165* .. Parameters ..
166 DOUBLE PRECISION ZERO, ONE, TEN
167 parameter( zero = 0.0d0, one = 1.0d0, ten = 10.0d0 )
168* ..
169* .. Local Scalars ..
170 INTEGER JCOL, JDIAG, JROW
171 DOUBLE PRECISION ANORM, ULP, UNFL, WNORM
172* ..
173* .. External Functions ..
174 DOUBLE PRECISION DLAMCH, DLANGE
175 EXTERNAL dlamch, dlange
176* ..
177* .. External Subroutines ..
178 EXTERNAL dgemm, dlacpy
179* ..
180* .. Intrinsic Functions ..
181 INTRINSIC dble, max, min
182* ..
183* .. Executable Statements ..
184*
185 result = zero
186 IF( n.LE.0 )
187 $ RETURN
188*
189* Constants
190*
191 unfl = dlamch( 'Safe minimum' )
192 ulp = dlamch( 'Epsilon' )*dlamch( 'Base' )
193*
194* Some Error Checks
195*
196 IF( itype.LT.1 .OR. itype.GT.3 ) THEN
197 result = ten / ulp
198 RETURN
199 END IF
200*
201 IF( itype.LE.2 ) THEN
202*
203* Tests scaled by the norm(A)
204*
205 anorm = max( dlange( '1', n, n, a, lda, work ), unfl )
206*
207 IF( itype.EQ.1 ) THEN
208*
209* ITYPE=1: Compute W = A - UBV'
210*
211 CALL dlacpy( ' ', n, n, a, lda, work, n )
212 CALL dgemm( 'N', 'N', n, n, n, one, u, ldu, b, ldb, zero,
213 $ work( n**2+1 ), n )
214*
215 CALL dgemm( 'N', 'C', n, n, n, -one, work( n**2+1 ), n, v,
216 $ ldv, one, work, n )
217*
218 ELSE
219*
220* ITYPE=2: Compute W = A - B
221*
222 CALL dlacpy( ' ', n, n, b, ldb, work, n )
223*
224 DO 20 jcol = 1, n
225 DO 10 jrow = 1, n
226 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
227 $ - a( jrow, jcol )
228 10 CONTINUE
229 20 CONTINUE
230 END IF
231*
232* Compute norm(W)/ ( ulp*norm(A) )
233*
234 wnorm = dlange( '1', n, n, work, n, work( n**2+1 ) )
235*
236 IF( anorm.GT.wnorm ) THEN
237 result = ( wnorm / anorm ) / ( n*ulp )
238 ELSE
239 IF( anorm.LT.one ) THEN
240 result = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
241 ELSE
242 result = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
243 END IF
244 END IF
245*
246 ELSE
247*
248* Tests not scaled by norm(A)
249*
250* ITYPE=3: Compute UU' - I
251*
252 CALL dgemm( 'N', 'C', n, n, n, one, u, ldu, u, ldu, zero, work,
253 $ n )
254*
255 DO 30 jdiag = 1, n
256 work( ( n+1 )*( jdiag-1 )+1 ) = work( ( n+1 )*( jdiag-1 )+
257 $ 1 ) - one
258 30 CONTINUE
259*
260 result = min( dlange( '1', n, n, work, n, work( n**2+1 ) ),
261 $ dble( n ) ) / ( n*ulp )
262 END IF
263*
264 RETURN
265*
266* End of DGET51
267*
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:103
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:114
Here is the call graph for this function:
Here is the caller graph for this function: