LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ ssygst()

subroutine ssygst ( integer  ITYPE,
character  UPLO,
integer  N,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( ldb, * )  B,
integer  LDB,
integer  INFO 
)

SSYGST

Download SSYGST + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 SSYGST reduces a real symmetric-definite generalized eigenproblem
 to standard form.

 If ITYPE = 1, the problem is A*x = lambda*B*x,
 and A is overwritten by inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T)

 If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or
 B*A*x = lambda*x, and A is overwritten by U*A*U**T or L**T*A*L.

 B must have been previously factorized as U**T*U or L*L**T by SPOTRF.
Parameters
[in]ITYPE
          ITYPE is INTEGER
          = 1: compute inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T);
          = 2 or 3: compute U*A*U**T or L**T*A*L.
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangle of A is stored and B is factored as
                  U**T*U;
          = 'L':  Lower triangle of A is stored and B is factored as
                  L*L**T.
[in]N
          N is INTEGER
          The order of the matrices A and B.  N >= 0.
[in,out]A
          A is REAL array, dimension (LDA,N)
          On entry, the symmetric matrix A.  If UPLO = 'U', the leading
          N-by-N upper triangular part of A contains the upper
          triangular part of the matrix A, and the strictly lower
          triangular part of A is not referenced.  If UPLO = 'L', the
          leading N-by-N lower triangular part of A contains the lower
          triangular part of the matrix A, and the strictly upper
          triangular part of A is not referenced.

          On exit, if INFO = 0, the transformed matrix, stored in the
          same format as 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 triangular factor from the Cholesky factorization of B,
          as returned by SPOTRF.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 129 of file ssygst.f.

129 *
130 * -- LAPACK computational routine (version 3.7.0) --
131 * -- LAPACK is a software package provided by Univ. of Tennessee, --
132 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
133 * December 2016
134 *
135 * .. Scalar Arguments ..
136  CHARACTER uplo
137  INTEGER info, itype, lda, ldb, n
138 * ..
139 * .. Array Arguments ..
140  REAL a( lda, * ), b( ldb, * )
141 * ..
142 *
143 * =====================================================================
144 *
145 * .. Parameters ..
146  REAL one, half
147  parameter( one = 1.0, half = 0.5 )
148 * ..
149 * .. Local Scalars ..
150  LOGICAL upper
151  INTEGER k, kb, nb
152 * ..
153 * .. External Subroutines ..
154  EXTERNAL ssygs2, ssymm, ssyr2k, strmm, strsm, xerbla
155 * ..
156 * .. Intrinsic Functions ..
157  INTRINSIC max, min
158 * ..
159 * .. External Functions ..
160  LOGICAL lsame
161  INTEGER ilaenv
162  EXTERNAL lsame, ilaenv
163 * ..
164 * .. Executable Statements ..
165 *
166 * Test the input parameters.
167 *
168  info = 0
169  upper = lsame( uplo, 'U' )
170  IF( itype.LT.1 .OR. itype.GT.3 ) THEN
171  info = -1
172  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
173  info = -2
174  ELSE IF( n.LT.0 ) THEN
175  info = -3
176  ELSE IF( lda.LT.max( 1, n ) ) THEN
177  info = -5
178  ELSE IF( ldb.LT.max( 1, n ) ) THEN
179  info = -7
180  END IF
181  IF( info.NE.0 ) THEN
182  CALL xerbla( 'SSYGST', -info )
183  RETURN
184  END IF
185 *
186 * Quick return if possible
187 *
188  IF( n.EQ.0 )
189  $ RETURN
190 *
191 * Determine the block size for this environment.
192 *
193  nb = ilaenv( 1, 'SSYGST', uplo, n, -1, -1, -1 )
194 *
195  IF( nb.LE.1 .OR. nb.GE.n ) THEN
196 *
197 * Use unblocked code
198 *
199  CALL ssygs2( itype, uplo, n, a, lda, b, ldb, info )
200  ELSE
201 *
202 * Use blocked code
203 *
204  IF( itype.EQ.1 ) THEN
205  IF( upper ) THEN
206 *
207 * Compute inv(U**T)*A*inv(U)
208 *
209  DO 10 k = 1, n, nb
210  kb = min( n-k+1, nb )
211 *
212 * Update the upper triangle of A(k:n,k:n)
213 *
214  CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
215  $ b( k, k ), ldb, info )
216  IF( k+kb.LE.n ) THEN
217  CALL strsm( 'Left', uplo, 'Transpose', 'Non-unit',
218  $ kb, n-k-kb+1, one, b( k, k ), ldb,
219  $ a( k, k+kb ), lda )
220  CALL ssymm( 'Left', uplo, kb, n-k-kb+1, -half,
221  $ a( k, k ), lda, b( k, k+kb ), ldb, one,
222  $ a( k, k+kb ), lda )
223  CALL ssyr2k( uplo, 'Transpose', n-k-kb+1, kb, -one,
224  $ a( k, k+kb ), lda, b( k, k+kb ), ldb,
225  $ one, a( k+kb, k+kb ), lda )
226  CALL ssymm( 'Left', uplo, kb, n-k-kb+1, -half,
227  $ a( k, k ), lda, b( k, k+kb ), ldb, one,
228  $ a( k, k+kb ), lda )
229  CALL strsm( 'Right', uplo, 'No transpose',
230  $ 'Non-unit', kb, n-k-kb+1, one,
231  $ b( k+kb, k+kb ), ldb, a( k, k+kb ),
232  $ lda )
233  END IF
234  10 CONTINUE
235  ELSE
236 *
237 * Compute inv(L)*A*inv(L**T)
238 *
239  DO 20 k = 1, n, nb
240  kb = min( n-k+1, nb )
241 *
242 * Update the lower triangle of A(k:n,k:n)
243 *
244  CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
245  $ b( k, k ), ldb, info )
246  IF( k+kb.LE.n ) THEN
247  CALL strsm( 'Right', uplo, 'Transpose', 'Non-unit',
248  $ n-k-kb+1, kb, one, b( k, k ), ldb,
249  $ a( k+kb, k ), lda )
250  CALL ssymm( 'Right', uplo, n-k-kb+1, kb, -half,
251  $ a( k, k ), lda, b( k+kb, k ), ldb, one,
252  $ a( k+kb, k ), lda )
253  CALL ssyr2k( uplo, 'No transpose', n-k-kb+1, kb,
254  $ -one, a( k+kb, k ), lda, b( k+kb, k ),
255  $ ldb, one, a( k+kb, k+kb ), lda )
256  CALL ssymm( 'Right', uplo, n-k-kb+1, kb, -half,
257  $ a( k, k ), lda, b( k+kb, k ), ldb, one,
258  $ a( k+kb, k ), lda )
259  CALL strsm( 'Left', uplo, 'No transpose',
260  $ 'Non-unit', n-k-kb+1, kb, one,
261  $ b( k+kb, k+kb ), ldb, a( k+kb, k ),
262  $ lda )
263  END IF
264  20 CONTINUE
265  END IF
266  ELSE
267  IF( upper ) THEN
268 *
269 * Compute U*A*U**T
270 *
271  DO 30 k = 1, n, nb
272  kb = min( n-k+1, nb )
273 *
274 * Update the upper triangle of A(1:k+kb-1,1:k+kb-1)
275 *
276  CALL strmm( 'Left', uplo, 'No transpose', 'Non-unit',
277  $ k-1, kb, one, b, ldb, a( 1, k ), lda )
278  CALL ssymm( 'Right', uplo, k-1, kb, half, a( k, k ),
279  $ lda, b( 1, k ), ldb, one, a( 1, k ), lda )
280  CALL ssyr2k( uplo, 'No transpose', k-1, kb, one,
281  $ a( 1, k ), lda, b( 1, k ), ldb, one, a,
282  $ lda )
283  CALL ssymm( 'Right', uplo, k-1, kb, half, a( k, k ),
284  $ lda, b( 1, k ), ldb, one, a( 1, k ), lda )
285  CALL strmm( 'Right', uplo, 'Transpose', 'Non-unit',
286  $ k-1, kb, one, b( k, k ), ldb, a( 1, k ),
287  $ lda )
288  CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
289  $ b( k, k ), ldb, info )
290  30 CONTINUE
291  ELSE
292 *
293 * Compute L**T*A*L
294 *
295  DO 40 k = 1, n, nb
296  kb = min( n-k+1, nb )
297 *
298 * Update the lower triangle of A(1:k+kb-1,1:k+kb-1)
299 *
300  CALL strmm( 'Right', uplo, 'No transpose', 'Non-unit',
301  $ kb, k-1, one, b, ldb, a( k, 1 ), lda )
302  CALL ssymm( 'Left', uplo, kb, k-1, half, a( k, k ),
303  $ lda, b( k, 1 ), ldb, one, a( k, 1 ), lda )
304  CALL ssyr2k( uplo, 'Transpose', k-1, kb, one,
305  $ a( k, 1 ), lda, b( k, 1 ), ldb, one, a,
306  $ lda )
307  CALL ssymm( 'Left', uplo, kb, k-1, half, a( k, k ),
308  $ lda, b( k, 1 ), ldb, one, a( k, 1 ), lda )
309  CALL strmm( 'Left', uplo, 'Transpose', 'Non-unit', kb,
310  $ k-1, one, b( k, k ), ldb, a( k, 1 ), lda )
311  CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
312  $ b( k, k ), ldb, info )
313  40 CONTINUE
314  END IF
315  END IF
316  END IF
317  RETURN
318 *
319 * End of SSYGST
320 *
subroutine strsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRSM
Definition: strsm.f:183
subroutine ssygs2(ITYPE, UPLO, N, A, LDA, B, LDB, INFO)
SSYGS2 reduces a symmetric definite generalized eigenproblem to standard form, using the factorizatio...
Definition: ssygs2.f:129
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
ILAENV
Definition: tstiee.f:83
subroutine strmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRMM
Definition: strmm.f:179
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine ssyr2k(UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SSYR2K
Definition: ssyr2k.f:194
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine ssymm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SSYMM
Definition: ssymm.f:191
Here is the call graph for this function:
Here is the caller graph for this function: