LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine ssbevd ( character  JOBZ,
character  UPLO,
integer  N,
integer  KD,
real, dimension( ldab, * )  AB,
integer  LDAB,
real, dimension( * )  W,
real, dimension( ldz, * )  Z,
integer  LDZ,
real, dimension( * )  WORK,
integer  LWORK,
integer, dimension( * )  IWORK,
integer  LIWORK,
integer  INFO 
)

SSBEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices

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

Purpose:
 SSBEVD computes all the eigenvalues and, optionally, eigenvectors of
 a real symmetric band matrix A. If eigenvectors are desired, it uses
 a divide and conquer algorithm.

 The divide and conquer algorithm makes very mild assumptions about
 floating point arithmetic. It will work on machines with a guard
 digit in add/subtract, or on those binary machines without guard
 digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
 Cray-2. It could conceivably fail on hexadecimal or decimal machines
 without guard digits, but we know of none.
Parameters
[in]JOBZ
          JOBZ is CHARACTER*1
          = 'N':  Compute eigenvalues only;
          = 'V':  Compute eigenvalues and eigenvectors.
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangle of A is stored;
          = 'L':  Lower triangle of A is stored.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]KD
          KD is INTEGER
          The number of superdiagonals of the matrix A if UPLO = 'U',
          or the number of subdiagonals if UPLO = 'L'.  KD >= 0.
[in,out]AB
          AB is REAL array, dimension (LDAB, N)
          On entry, the upper or lower triangle of the symmetric band
          matrix A, stored in the first KD+1 rows of the array.  The
          j-th column of A is stored in the j-th column of the array AB
          as follows:
          if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j<=i<=min(n,j+kd).

          On exit, AB is overwritten by values generated during the
          reduction to tridiagonal form.  If UPLO = 'U', the first
          superdiagonal and the diagonal of the tridiagonal matrix T
          are returned in rows KD and KD+1 of AB, and if UPLO = 'L',
          the diagonal and first subdiagonal of T are returned in the
          first two rows of AB.
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= KD + 1.
[out]W
          W is REAL array, dimension (N)
          If INFO = 0, the eigenvalues in ascending order.
[out]Z
          Z is REAL array, dimension (LDZ, N)
          If JOBZ = 'V', then if INFO = 0, Z contains the orthonormal
          eigenvectors of the matrix A, with the i-th column of Z
          holding the eigenvector associated with W(i).
          If JOBZ = 'N', then Z is not referenced.
[in]LDZ
          LDZ is INTEGER
          The leading dimension of the array Z.  LDZ >= 1, and if
          JOBZ = 'V', LDZ >= max(1,N).
[out]WORK
          WORK is REAL array,
                                         dimension (LWORK)
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK.
          IF N <= 1,                LWORK must be at least 1.
          If JOBZ  = 'N' and N > 2, LWORK must be at least 2*N.
          If JOBZ  = 'V' and N > 2, LWORK must be at least
                         ( 1 + 5*N + 2*N**2 ).

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal sizes of the WORK and IWORK
          arrays, returns these values as the first entries of the WORK
          and IWORK arrays, and no error message related to LWORK or
          LIWORK is issued by XERBLA.
[out]IWORK
          IWORK is INTEGER array, dimension (MAX(1,LIWORK))
          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
[in]LIWORK
          LIWORK is INTEGER
          The dimension of the array IWORK.
          If JOBZ  = 'N' or N <= 1, LIWORK must be at least 1.
          If JOBZ  = 'V' and N > 2, LIWORK must be at least 3 + 5*N.

          If LIWORK = -1, then a workspace query is assumed; the
          routine only calculates the optimal sizes of the WORK and
          IWORK arrays, returns these values as the first entries of
          the WORK and IWORK arrays, and no error message related to
          LWORK or LIWORK is issued by XERBLA.
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
          > 0:  if INFO = i, the algorithm failed to converge; i
                off-diagonal elements of an intermediate tridiagonal
                form did not converge to zero.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 195 of file ssbevd.f.

195 *
196 * -- LAPACK driver routine (version 3.4.0) --
197 * -- LAPACK is a software package provided by Univ. of Tennessee, --
198 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
199 * November 2011
200 *
201 * .. Scalar Arguments ..
202  CHARACTER jobz, uplo
203  INTEGER info, kd, ldab, ldz, liwork, lwork, n
204 * ..
205 * .. Array Arguments ..
206  INTEGER iwork( * )
207  REAL ab( ldab, * ), w( * ), work( * ), z( ldz, * )
208 * ..
209 *
210 * =====================================================================
211 *
212 * .. Parameters ..
213  REAL zero, one
214  parameter ( zero = 0.0e+0, one = 1.0e+0 )
215 * ..
216 * .. Local Scalars ..
217  LOGICAL lower, lquery, wantz
218  INTEGER iinfo, inde, indwk2, indwrk, iscale, liwmin,
219  $ llwrk2, lwmin
220  REAL anrm, bignum, eps, rmax, rmin, safmin, sigma,
221  $ smlnum
222 * ..
223 * .. External Functions ..
224  LOGICAL lsame
225  REAL slamch, slansb
226  EXTERNAL lsame, slamch, slansb
227 * ..
228 * .. External Subroutines ..
229  EXTERNAL sgemm, slacpy, slascl, ssbtrd, sscal, sstedc,
230  $ ssterf, xerbla
231 * ..
232 * .. Intrinsic Functions ..
233  INTRINSIC sqrt
234 * ..
235 * .. Executable Statements ..
236 *
237 * Test the input parameters.
238 *
239  wantz = lsame( jobz, 'V' )
240  lower = lsame( uplo, 'L' )
241  lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
242 *
243  info = 0
244  IF( n.LE.1 ) THEN
245  liwmin = 1
246  lwmin = 1
247  ELSE
248  IF( wantz ) THEN
249  liwmin = 3 + 5*n
250  lwmin = 1 + 5*n + 2*n**2
251  ELSE
252  liwmin = 1
253  lwmin = 2*n
254  END IF
255  END IF
256  IF( .NOT.( wantz .OR. lsame( jobz, 'N' ) ) ) THEN
257  info = -1
258  ELSE IF( .NOT.( lower .OR. lsame( uplo, 'U' ) ) ) THEN
259  info = -2
260  ELSE IF( n.LT.0 ) THEN
261  info = -3
262  ELSE IF( kd.LT.0 ) THEN
263  info = -4
264  ELSE IF( ldab.LT.kd+1 ) THEN
265  info = -6
266  ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) ) THEN
267  info = -9
268  END IF
269 *
270  IF( info.EQ.0 ) THEN
271  work( 1 ) = lwmin
272  iwork( 1 ) = liwmin
273 *
274  IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
275  info = -11
276  ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery ) THEN
277  info = -13
278  END IF
279  END IF
280 *
281  IF( info.NE.0 ) THEN
282  CALL xerbla( 'SSBEVD', -info )
283  RETURN
284  ELSE IF( lquery ) THEN
285  RETURN
286  END IF
287 *
288 * Quick return if possible
289 *
290  IF( n.EQ.0 )
291  $ RETURN
292 *
293  IF( n.EQ.1 ) THEN
294  w( 1 ) = ab( 1, 1 )
295  IF( wantz )
296  $ z( 1, 1 ) = one
297  RETURN
298  END IF
299 *
300 * Get machine constants.
301 *
302  safmin = slamch( 'Safe minimum' )
303  eps = slamch( 'Precision' )
304  smlnum = safmin / eps
305  bignum = one / smlnum
306  rmin = sqrt( smlnum )
307  rmax = sqrt( bignum )
308 *
309 * Scale matrix to allowable range, if necessary.
310 *
311  anrm = slansb( 'M', uplo, n, kd, ab, ldab, work )
312  iscale = 0
313  IF( anrm.GT.zero .AND. anrm.LT.rmin ) THEN
314  iscale = 1
315  sigma = rmin / anrm
316  ELSE IF( anrm.GT.rmax ) THEN
317  iscale = 1
318  sigma = rmax / anrm
319  END IF
320  IF( iscale.EQ.1 ) THEN
321  IF( lower ) THEN
322  CALL slascl( 'B', kd, kd, one, sigma, n, n, ab, ldab, info )
323  ELSE
324  CALL slascl( 'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
325  END IF
326  END IF
327 *
328 * Call SSBTRD to reduce symmetric band matrix to tridiagonal form.
329 *
330  inde = 1
331  indwrk = inde + n
332  indwk2 = indwrk + n*n
333  llwrk2 = lwork - indwk2 + 1
334  CALL ssbtrd( jobz, uplo, n, kd, ab, ldab, w, work( inde ), z, ldz,
335  $ work( indwrk ), iinfo )
336 *
337 * For eigenvalues only, call SSTERF. For eigenvectors, call SSTEDC.
338 *
339  IF( .NOT.wantz ) THEN
340  CALL ssterf( n, w, work( inde ), info )
341  ELSE
342  CALL sstedc( 'I', n, w, work( inde ), work( indwrk ), n,
343  $ work( indwk2 ), llwrk2, iwork, liwork, info )
344  CALL sgemm( 'N', 'N', n, n, n, one, z, ldz, work( indwrk ), n,
345  $ zero, work( indwk2 ), n )
346  CALL slacpy( 'A', n, n, work( indwk2 ), n, z, ldz )
347  END IF
348 *
349 * If matrix was scaled, then rescale eigenvalues appropriately.
350 *
351  IF( iscale.EQ.1 )
352  $ CALL sscal( n, one / sigma, w, 1 )
353 *
354  work( 1 ) = lwmin
355  iwork( 1 ) = liwmin
356  RETURN
357 *
358 * End of SSBEVD
359 *
subroutine slascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Definition: slascl.f:145
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
Definition: sgemm.f:189
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
Definition: slacpy.f:105
real function slansb(NORM, UPLO, N, K, AB, LDAB, WORK)
SLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix.
Definition: slansb.f:131
subroutine sscal(N, SA, SX, INCX)
SSCAL
Definition: sscal.f:55
subroutine ssbtrd(VECT, UPLO, N, KD, AB, LDAB, D, E, Q, LDQ, WORK, INFO)
SSBTRD
Definition: ssbtrd.f:165
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine ssterf(N, D, E, INFO)
SSTERF
Definition: ssterf.f:88
subroutine sstedc(COMPZ, N, D, E, Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO)
SSTEDC
Definition: sstedc.f:190
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: