LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ ssgt01()

subroutine ssgt01 ( integer  ITYPE,
character  UPLO,
integer  N,
integer  M,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( ldb, * )  B,
integer  LDB,
real, dimension( ldz, * )  Z,
integer  LDZ,
real, dimension( * )  D,
real, dimension( * )  WORK,
real, dimension( * )  RESULT 
)

SSGT01

Purpose:
 SSGT01 checks a decomposition of the form

    A Z   =  B Z D or
    A B Z =  Z D or
    B A Z =  Z D

 where A is a symmetric matrix, B is
 symmetric positive definite, Z is orthogonal, and D is diagonal.

 One of the following test ratios is computed:

 ITYPE = 1:  RESULT(1) = | A Z - B Z D | / ( |A| |Z| n ulp )

 ITYPE = 2:  RESULT(1) = | A B Z - Z D | / ( |A| |Z| n ulp )

 ITYPE = 3:  RESULT(1) = | B A Z - Z D | / ( |A| |Z| n ulp )
Parameters
[in]ITYPE
          ITYPE is INTEGER
          The form of the symmetric generalized eigenproblem.
          = 1:  A*z = (lambda)*B*z
          = 2:  A*B*z = (lambda)*z
          = 3:  B*A*z = (lambda)*z
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          symmetric matrices A and B is stored.
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]M
          M is INTEGER
          The number of eigenvalues found.  0 <= M <= N.
[in]A
          A is REAL array, dimension (LDA, N)
          The original symmetric matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in]B
          B is REAL array, dimension (LDB, N)
          The original symmetric positive definite matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[in]Z
          Z is REAL array, dimension (LDZ, M)
          The computed eigenvectors of the generalized eigenproblem.
[in]LDZ
          LDZ is INTEGER
          The leading dimension of the array Z.  LDZ >= max(1,N).
[in]D
          D is REAL array, dimension (M)
          The computed eigenvalues of the generalized eigenproblem.
[out]WORK
          WORK is REAL array, dimension (N*N)
[out]RESULT
          RESULT is REAL array, dimension (1)
          The test ratio as described above.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 148 of file ssgt01.f.

148 *
149 * -- LAPACK test routine (version 3.7.0) --
150 * -- LAPACK is a software package provided by Univ. of Tennessee, --
151 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
152 * December 2016
153 *
154 * .. Scalar Arguments ..
155  CHARACTER uplo
156  INTEGER itype, lda, ldb, ldz, m, n
157 * ..
158 * .. Array Arguments ..
159  REAL a( lda, * ), b( ldb, * ), d( * ), result( * ),
160  $ work( * ), z( ldz, * )
161 * ..
162 *
163 * =====================================================================
164 *
165 * .. Parameters ..
166  REAL zero, one
167  parameter( zero = 0.0e0, one = 1.0e0 )
168 * ..
169 * .. Local Scalars ..
170  INTEGER i
171  REAL anorm, ulp
172 * ..
173 * .. External Functions ..
174  REAL slamch, slange, slansy
175  EXTERNAL slamch, slange, slansy
176 * ..
177 * .. External Subroutines ..
178  EXTERNAL sscal, ssymm
179 * ..
180 * .. Executable Statements ..
181 *
182  result( 1 ) = zero
183  IF( n.LE.0 )
184  $ RETURN
185 *
186  ulp = slamch( 'Epsilon' )
187 *
188 * Compute product of 1-norms of A and Z.
189 *
190  anorm = slansy( '1', uplo, n, a, lda, work )*
191  $ slange( '1', n, m, z, ldz, work )
192  IF( anorm.EQ.zero )
193  $ anorm = one
194 *
195  IF( itype.EQ.1 ) THEN
196 *
197 * Norm of AZ - BZD
198 *
199  CALL ssymm( 'Left', uplo, n, m, one, a, lda, z, ldz, zero,
200  $ work, n )
201  DO 10 i = 1, m
202  CALL sscal( n, d( i ), z( 1, i ), 1 )
203  10 CONTINUE
204  CALL ssymm( 'Left', uplo, n, m, one, b, ldb, z, ldz, -one,
205  $ work, n )
206 *
207  result( 1 ) = ( slange( '1', n, m, work, n, work ) / anorm ) /
208  $ ( n*ulp )
209 *
210  ELSE IF( itype.EQ.2 ) THEN
211 *
212 * Norm of ABZ - ZD
213 *
214  CALL ssymm( 'Left', uplo, n, m, one, b, ldb, z, ldz, zero,
215  $ work, n )
216  DO 20 i = 1, m
217  CALL sscal( n, d( i ), z( 1, i ), 1 )
218  20 CONTINUE
219  CALL ssymm( 'Left', uplo, n, m, one, a, lda, work, n, -one, z,
220  $ ldz )
221 *
222  result( 1 ) = ( slange( '1', n, m, z, ldz, work ) / anorm ) /
223  $ ( n*ulp )
224 *
225  ELSE IF( itype.EQ.3 ) THEN
226 *
227 * Norm of BAZ - ZD
228 *
229  CALL ssymm( 'Left', uplo, n, m, one, a, lda, z, ldz, zero,
230  $ work, n )
231  DO 30 i = 1, m
232  CALL sscal( n, d( i ), z( 1, i ), 1 )
233  30 CONTINUE
234  CALL ssymm( 'Left', uplo, n, m, one, b, ldb, work, n, -one, z,
235  $ ldz )
236 *
237  result( 1 ) = ( slange( '1', n, m, z, ldz, work ) / anorm ) /
238  $ ( n*ulp )
239  END IF
240 *
241  RETURN
242 *
243 * End of SSGT01
244 *
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 sscal(N, SA, SX, INCX)
SSCAL
Definition: sscal.f:81
subroutine ssymm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SSYMM
Definition: ssymm.f:191
real function slansy(NORM, UPLO, N, A, LDA, WORK)
SLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix.
Definition: slansy.f:124
Here is the call graph for this function:
Here is the caller graph for this function: