3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DSGT01( ITYPE, UPLO, N, M, A, LDA, B, LDB, Z, LDZ, D,
14 * .. Scalar Arguments ..
16 * INTEGER ITYPE, LDA, LDB, LDZ, M, N
18 * .. Array Arguments ..
19 * DOUBLE PRECISION A( LDA, * ), B( LDB, * ), D( * ), RESULT( * ),
20 * $ WORK( * ), Z( LDZ, * )
29 *> DDGT01 checks a decomposition of the form
35 *> where A is a symmetric matrix, B is
36 *> symmetric positive definite, Z is orthogonal, and D is diagonal.
38 *> One of the following test ratios is computed:
40 *> ITYPE = 1: RESULT(1) = | A Z - B Z D | / ( |A| |Z| n ulp )
42 *> ITYPE = 2: RESULT(1) = | A B Z - Z D | / ( |A| |Z| n ulp )
44 *> ITYPE = 3: RESULT(1) = | B A Z - Z D | / ( |A| |Z| n ulp )
53 *> The form of the symmetric generalized eigenproblem.
54 *> = 1: A*z = (lambda)*B*z
55 *> = 2: A*B*z = (lambda)*z
56 *> = 3: B*A*z = (lambda)*z
61 *> UPLO is CHARACTER*1
62 *> Specifies whether the upper or lower triangular part of the
63 *> symmetric matrices A and B is stored.
64 *> = 'U': Upper triangular
65 *> = 'L': Lower triangular
71 *> The order of the matrix A. N >= 0.
77 *> The number of eigenvalues found. 0 <= M <= N.
82 *> A is DOUBLE PRECISION array, dimension (LDA, N)
83 *> The original symmetric matrix A.
89 *> The leading dimension of the array A. LDA >= max(1,N).
94 *> B is DOUBLE PRECISION array, dimension (LDB, N)
95 *> The original symmetric positive definite matrix B.
101 *> The leading dimension of the array B. LDB >= max(1,N).
106 *> Z is DOUBLE PRECISION array, dimension (LDZ, M)
107 *> The computed eigenvectors of the generalized eigenproblem.
113 *> The leading dimension of the array Z. LDZ >= max(1,N).
118 *> D is DOUBLE PRECISION array, dimension (M)
119 *> The computed eigenvalues of the generalized eigenproblem.
124 *> WORK is DOUBLE PRECISION array, dimension (N*N)
127 *> \param[out] RESULT
129 *> RESULT is DOUBLE PRECISION array, dimension (1)
130 *> The test ratio as described above.
136 *> \author Univ. of Tennessee
137 *> \author Univ. of California Berkeley
138 *> \author Univ. of Colorado Denver
141 *> \date November 2011
143 *> \ingroup double_eig
145 * =====================================================================
146 SUBROUTINE DSGT01( ITYPE, UPLO, N, M, A, LDA, B, LDB, Z, LDZ, D,
149 * -- LAPACK test routine (version 3.4.0) --
150 * -- LAPACK is a software package provided by Univ. of Tennessee, --
151 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
154 * .. Scalar Arguments ..
156 INTEGER ITYPE, LDA, LDB, LDZ, M, N
158 * .. Array Arguments ..
159 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), D( * ), RESULT( * ),
160 $ WORK( * ), Z( LDZ, * )
163 * =====================================================================
166 DOUBLE PRECISION ZERO, ONE
167 PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 )
169 * .. Local Scalars ..
171 DOUBLE PRECISION ANORM, ULP
173 * .. External Functions ..
174 DOUBLE PRECISION DLAMCH, DLANGE, DLANSY
175 EXTERNAL DLAMCH, DLANGE, DLANSY
177 * .. External Subroutines ..
178 EXTERNAL DSCAL, DSYMM
180 * .. Executable Statements ..
186 ULP = DLAMCH( 'Epsilon' )
188 * Compute product of 1-norms of A and Z.
190 ANORM = DLANSY( '1', UPLO, N, A, LDA, WORK )*
191 $ DLANGE( '1', N, M, Z, LDZ, WORK )
195 IF( ITYPE.EQ.1 ) THEN
199 CALL DSYMM( 'Left', UPLO, N, M, ONE, A, LDA, Z, LDZ, ZERO,
202 CALL DSCAL( N, D( I ), Z( 1, I ), 1 )
204 CALL DSYMM( 'Left', UPLO, N, M, ONE, B, LDB, Z, LDZ, -ONE,
207 RESULT( 1 ) = ( DLANGE( '1', N, M, WORK, N, WORK ) / ANORM ) /
210 ELSE IF( ITYPE.EQ.2 ) THEN
214 CALL DSYMM( 'Left', UPLO, N, M, ONE, B, LDB, Z, LDZ, ZERO,
217 CALL DSCAL( N, D( I ), Z( 1, I ), 1 )
219 CALL DSYMM( 'Left', UPLO, N, M, ONE, A, LDA, WORK, N, -ONE, Z,
222 RESULT( 1 ) = ( DLANGE( '1', N, M, Z, LDZ, WORK ) / ANORM ) /
225 ELSE IF( ITYPE.EQ.3 ) THEN
229 CALL DSYMM( 'Left', UPLO, N, M, ONE, A, LDA, Z, LDZ, ZERO,
232 CALL DSCAL( N, D( I ), Z( 1, I ), 1 )
234 CALL DSYMM( 'Left', UPLO, N, M, ONE, B, LDB, WORK, N, -ONE, Z,
237 RESULT( 1 ) = ( DLANGE( '1', N, M, Z, LDZ, WORK ) / ANORM ) /