LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine spbstf ( character  UPLO,
integer  N,
integer  KD,
real, dimension( ldab, * )  AB,
integer  LDAB,
integer  INFO 
)

SPBSTF

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

Purpose:
 SPBSTF computes a split Cholesky factorization of a real
 symmetric positive definite band matrix A.

 This routine is designed to be used in conjunction with SSBGST.

 The factorization has the form  A = S**T*S  where S is a band matrix
 of the same bandwidth as A and the following structure:

   S = ( U    )
       ( M  L )

 where U is upper triangular of order m = (n+kd)/2, and L is lower
 triangular of order n-m.
Parameters
[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, if INFO = 0, the factor S from the split Cholesky
          factorization A = S**T*S. See Further Details.
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= KD+1.
[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 factorization could not be completed,
               because the updated element a(i,i) was negative; the
               matrix A is not positive definite.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
  The band storage scheme is illustrated by the following example, when
  N = 7, KD = 2:

  S = ( s11  s12  s13                     )
      (      s22  s23  s24                )
      (           s33  s34                )
      (                s44                )
      (           s53  s54  s55           )
      (                s64  s65  s66      )
      (                     s75  s76  s77 )

  If UPLO = 'U', the array AB holds:

  on entry:                          on exit:

   *    *   a13  a24  a35  a46  a57   *    *   s13  s24  s53  s64  s75
   *   a12  a23  a34  a45  a56  a67   *   s12  s23  s34  s54  s65  s76
  a11  a22  a33  a44  a55  a66  a77  s11  s22  s33  s44  s55  s66  s77

  If UPLO = 'L', the array AB holds:

  on entry:                          on exit:

  a11  a22  a33  a44  a55  a66  a77  s11  s22  s33  s44  s55  s66  s77
  a21  a32  a43  a54  a65  a76   *   s12  s23  s34  s54  s65  s76   *
  a31  a42  a53  a64  a64   *    *   s13  s24  s53  s64  s75   *    *

  Array elements marked * are not used by the routine.

Definition at line 154 of file spbstf.f.

154 *
155 * -- LAPACK computational routine (version 3.4.0) --
156 * -- LAPACK is a software package provided by Univ. of Tennessee, --
157 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
158 * November 2011
159 *
160 * .. Scalar Arguments ..
161  CHARACTER uplo
162  INTEGER info, kd, ldab, n
163 * ..
164 * .. Array Arguments ..
165  REAL ab( ldab, * )
166 * ..
167 *
168 * =====================================================================
169 *
170 * .. Parameters ..
171  REAL one, zero
172  parameter ( one = 1.0e+0, zero = 0.0e+0 )
173 * ..
174 * .. Local Scalars ..
175  LOGICAL upper
176  INTEGER j, kld, km, m
177  REAL ajj
178 * ..
179 * .. External Functions ..
180  LOGICAL lsame
181  EXTERNAL lsame
182 * ..
183 * .. External Subroutines ..
184  EXTERNAL sscal, ssyr, xerbla
185 * ..
186 * .. Intrinsic Functions ..
187  INTRINSIC max, min, sqrt
188 * ..
189 * .. Executable Statements ..
190 *
191 * Test the input parameters.
192 *
193  info = 0
194  upper = lsame( uplo, 'U' )
195  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
196  info = -1
197  ELSE IF( n.LT.0 ) THEN
198  info = -2
199  ELSE IF( kd.LT.0 ) THEN
200  info = -3
201  ELSE IF( ldab.LT.kd+1 ) THEN
202  info = -5
203  END IF
204  IF( info.NE.0 ) THEN
205  CALL xerbla( 'SPBSTF', -info )
206  RETURN
207  END IF
208 *
209 * Quick return if possible
210 *
211  IF( n.EQ.0 )
212  $ RETURN
213 *
214  kld = max( 1, ldab-1 )
215 *
216 * Set the splitting point m.
217 *
218  m = ( n+kd ) / 2
219 *
220  IF( upper ) THEN
221 *
222 * Factorize A(m+1:n,m+1:n) as L**T*L, and update A(1:m,1:m).
223 *
224  DO 10 j = n, m + 1, -1
225 *
226 * Compute s(j,j) and test for non-positive-definiteness.
227 *
228  ajj = ab( kd+1, j )
229  IF( ajj.LE.zero )
230  $ GO TO 50
231  ajj = sqrt( ajj )
232  ab( kd+1, j ) = ajj
233  km = min( j-1, kd )
234 *
235 * Compute elements j-km:j-1 of the j-th column and update the
236 * the leading submatrix within the band.
237 *
238  CALL sscal( km, one / ajj, ab( kd+1-km, j ), 1 )
239  CALL ssyr( 'Upper', km, -one, ab( kd+1-km, j ), 1,
240  $ ab( kd+1, j-km ), kld )
241  10 CONTINUE
242 *
243 * Factorize the updated submatrix A(1:m,1:m) as U**T*U.
244 *
245  DO 20 j = 1, m
246 *
247 * Compute s(j,j) and test for non-positive-definiteness.
248 *
249  ajj = ab( kd+1, j )
250  IF( ajj.LE.zero )
251  $ GO TO 50
252  ajj = sqrt( ajj )
253  ab( kd+1, j ) = ajj
254  km = min( kd, m-j )
255 *
256 * Compute elements j+1:j+km of the j-th row and update the
257 * trailing submatrix within the band.
258 *
259  IF( km.GT.0 ) THEN
260  CALL sscal( km, one / ajj, ab( kd, j+1 ), kld )
261  CALL ssyr( 'Upper', km, -one, ab( kd, j+1 ), kld,
262  $ ab( kd+1, j+1 ), kld )
263  END IF
264  20 CONTINUE
265  ELSE
266 *
267 * Factorize A(m+1:n,m+1:n) as L**T*L, and update A(1:m,1:m).
268 *
269  DO 30 j = n, m + 1, -1
270 *
271 * Compute s(j,j) and test for non-positive-definiteness.
272 *
273  ajj = ab( 1, j )
274  IF( ajj.LE.zero )
275  $ GO TO 50
276  ajj = sqrt( ajj )
277  ab( 1, j ) = ajj
278  km = min( j-1, kd )
279 *
280 * Compute elements j-km:j-1 of the j-th row and update the
281 * trailing submatrix within the band.
282 *
283  CALL sscal( km, one / ajj, ab( km+1, j-km ), kld )
284  CALL ssyr( 'Lower', km, -one, ab( km+1, j-km ), kld,
285  $ ab( 1, j-km ), kld )
286  30 CONTINUE
287 *
288 * Factorize the updated submatrix A(1:m,1:m) as U**T*U.
289 *
290  DO 40 j = 1, m
291 *
292 * Compute s(j,j) and test for non-positive-definiteness.
293 *
294  ajj = ab( 1, j )
295  IF( ajj.LE.zero )
296  $ GO TO 50
297  ajj = sqrt( ajj )
298  ab( 1, j ) = ajj
299  km = min( kd, m-j )
300 *
301 * Compute elements j+1:j+km of the j-th column and update the
302 * trailing submatrix within the band.
303 *
304  IF( km.GT.0 ) THEN
305  CALL sscal( km, one / ajj, ab( 2, j ), 1 )
306  CALL ssyr( 'Lower', km, -one, ab( 2, j ), 1,
307  $ ab( 1, j+1 ), kld )
308  END IF
309  40 CONTINUE
310  END IF
311  RETURN
312 *
313  50 CONTINUE
314  info = j
315  RETURN
316 *
317 * End of SPBSTF
318 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine sscal(N, SA, SX, INCX)
SSCAL
Definition: sscal.f:55
subroutine ssyr(UPLO, N, ALPHA, X, INCX, A, LDA)
SSYR
Definition: ssyr.f:134
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: