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

◆ ssbev()

subroutine ssbev ( 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 info )

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

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

Purpose:
!>
!> SSBEV computes all the eigenvalues and, optionally, eigenvectors of
!> a real symmetric band matrix A.
!> 
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 (max(1,3*N-2))
!> 
[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.

Definition at line 142 of file ssbev.f.

144*
145* -- LAPACK driver routine --
146* -- LAPACK is a software package provided by Univ. of Tennessee, --
147* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
148*
149* .. Scalar Arguments ..
150 CHARACTER JOBZ, UPLO
151 INTEGER INFO, KD, LDAB, LDZ, N
152* ..
153* .. Array Arguments ..
154 REAL AB( LDAB, * ), W( * ), WORK( * ), Z( LDZ, * )
155* ..
156*
157* =====================================================================
158*
159* .. Parameters ..
160 REAL ZERO, ONE
161 parameter( zero = 0.0e0, one = 1.0e0 )
162* ..
163* .. Local Scalars ..
164 LOGICAL LOWER, WANTZ
165 INTEGER IINFO, IMAX, INDE, INDWRK, ISCALE
166 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
167 $ SMLNUM
168* ..
169* .. External Functions ..
170 LOGICAL LSAME
171 REAL SLAMCH, SLANSB
172 EXTERNAL lsame, slamch, slansb
173* ..
174* .. External Subroutines ..
175 EXTERNAL slascl, ssbtrd, sscal, ssteqr, ssterf,
176 $ xerbla
177* ..
178* .. Intrinsic Functions ..
179 INTRINSIC sqrt
180* ..
181* .. Executable Statements ..
182*
183* Test the input parameters.
184*
185 wantz = lsame( jobz, 'V' )
186 lower = lsame( uplo, 'L' )
187*
188 info = 0
189 IF( .NOT.( wantz .OR. lsame( jobz, 'N' ) ) ) THEN
190 info = -1
191 ELSE IF( .NOT.( lower .OR. lsame( uplo, 'U' ) ) ) THEN
192 info = -2
193 ELSE IF( n.LT.0 ) THEN
194 info = -3
195 ELSE IF( kd.LT.0 ) THEN
196 info = -4
197 ELSE IF( ldab.LT.kd+1 ) THEN
198 info = -6
199 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) ) THEN
200 info = -9
201 END IF
202*
203 IF( info.NE.0 ) THEN
204 CALL xerbla( 'SSBEV ', -info )
205 RETURN
206 END IF
207*
208* Quick return if possible
209*
210 IF( n.EQ.0 )
211 $ RETURN
212*
213 IF( n.EQ.1 ) THEN
214 IF( lower ) THEN
215 w( 1 ) = ab( 1, 1 )
216 ELSE
217 w( 1 ) = ab( kd+1, 1 )
218 END IF
219 IF( wantz )
220 $ z( 1, 1 ) = one
221 RETURN
222 END IF
223*
224* Get machine constants.
225*
226 safmin = slamch( 'Safe minimum' )
227 eps = slamch( 'Precision' )
228 smlnum = safmin / eps
229 bignum = one / smlnum
230 rmin = sqrt( smlnum )
231 rmax = sqrt( bignum )
232*
233* Scale matrix to allowable range, if necessary.
234*
235 anrm = slansb( 'M', uplo, n, kd, ab, ldab, work )
236 iscale = 0
237 IF( anrm.GT.zero .AND. anrm.LT.rmin ) THEN
238 iscale = 1
239 sigma = rmin / anrm
240 ELSE IF( anrm.GT.rmax ) THEN
241 iscale = 1
242 sigma = rmax / anrm
243 END IF
244 IF( iscale.EQ.1 ) THEN
245 IF( lower ) THEN
246 CALL slascl( 'B', kd, kd, one, sigma, n, n, ab, ldab,
247 $ info )
248 ELSE
249 CALL slascl( 'Q', kd, kd, one, sigma, n, n, ab, ldab,
250 $ info )
251 END IF
252 END IF
253*
254* Call SSBTRD to reduce symmetric band matrix to tridiagonal form.
255*
256 inde = 1
257 indwrk = inde + n
258 CALL ssbtrd( jobz, uplo, n, kd, ab, ldab, w, work( inde ), z,
259 $ ldz,
260 $ work( indwrk ), iinfo )
261*
262* For eigenvalues only, call SSTERF. For eigenvectors, call SSTEQR.
263*
264 IF( .NOT.wantz ) THEN
265 CALL ssterf( n, w, work( inde ), info )
266 ELSE
267 CALL ssteqr( jobz, n, w, work( inde ), z, ldz,
268 $ work( indwrk ),
269 $ info )
270 END IF
271*
272* If matrix was scaled, then rescale eigenvalues appropriately.
273*
274 IF( iscale.EQ.1 ) THEN
275 IF( info.EQ.0 ) THEN
276 imax = n
277 ELSE
278 imax = info - 1
279 END IF
280 CALL sscal( imax, one / sigma, w, 1 )
281 END IF
282*
283 RETURN
284*
285* End of SSBEV
286*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine ssbtrd(vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work, info)
SSBTRD
Definition ssbtrd.f:161
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
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,...
Definition slansb.f:127
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:142
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine sscal(n, sa, sx, incx)
SSCAL
Definition sscal.f:79
subroutine ssteqr(compz, n, d, e, z, ldz, work, info)
SSTEQR
Definition ssteqr.f:129
subroutine ssterf(n, d, e, info)
SSTERF
Definition ssterf.f:84
Here is the call graph for this function:
Here is the caller graph for this function: