LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine slaeda ( integer  N,
integer  TLVLS,
integer  CURLVL,
integer  CURPBM,
integer, dimension( * )  PRMPTR,
integer, dimension( * )  PERM,
integer, dimension( * )  GIVPTR,
integer, dimension( 2, * )  GIVCOL,
real, dimension( 2, * )  GIVNUM,
real, dimension( * )  Q,
integer, dimension( * )  QPTR,
real, dimension( * )  Z,
real, dimension( * )  ZTEMP,
integer  INFO 
)

SLAEDA used by sstedc. Computes the Z vector determining the rank-one modification of the diagonal matrix. Used when the original matrix is dense.

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

Purpose:
 SLAEDA computes the Z vector corresponding to the merge step in the
 CURLVLth step of the merge process with TLVLS steps for the CURPBMth
 problem.
Parameters
[in]N
          N is INTEGER
         The dimension of the symmetric tridiagonal matrix.  N >= 0.
[in]TLVLS
          TLVLS is INTEGER
         The total number of merging levels in the overall divide and
         conquer tree.
[in]CURLVL
          CURLVL is INTEGER
         The current level in the overall merge routine,
         0 <= curlvl <= tlvls.
[in]CURPBM
          CURPBM is INTEGER
         The current problem in the current level in the overall
         merge routine (counting from upper left to lower right).
[in]PRMPTR
          PRMPTR is INTEGER array, dimension (N lg N)
         Contains a list of pointers which indicate where in PERM a
         level's permutation is stored.  PRMPTR(i+1) - PRMPTR(i)
         indicates the size of the permutation and incidentally the
         size of the full, non-deflated problem.
[in]PERM
          PERM is INTEGER array, dimension (N lg N)
         Contains the permutations (from deflation and sorting) to be
         applied to each eigenblock.
[in]GIVPTR
          GIVPTR is INTEGER array, dimension (N lg N)
         Contains a list of pointers which indicate where in GIVCOL a
         level's Givens rotations are stored.  GIVPTR(i+1) - GIVPTR(i)
         indicates the number of Givens rotations.
[in]GIVCOL
          GIVCOL is INTEGER array, dimension (2, N lg N)
         Each pair of numbers indicates a pair of columns to take place
         in a Givens rotation.
[in]GIVNUM
          GIVNUM is REAL array, dimension (2, N lg N)
         Each number indicates the S value to be used in the
         corresponding Givens rotation.
[in]Q
          Q is REAL array, dimension (N**2)
         Contains the square eigenblocks from previous levels, the
         starting positions for blocks are given by QPTR.
[in]QPTR
          QPTR is INTEGER array, dimension (N+2)
         Contains a list of pointers which indicate where in Q an
         eigenblock is stored.  SQRT( QPTR(i+1) - QPTR(i) ) indicates
         the size of the block.
[out]Z
          Z is REAL array, dimension (N)
         On output this vector contains the updating vector (the last
         row of the first sub-eigenvector matrix and the first row of
         the second sub-eigenvector matrix).
[out]ZTEMP
          ZTEMP is REAL array, dimension (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
September 2012
Contributors:
Jeff Rutter, Computer Science Division, University of California at Berkeley, USA

Definition at line 168 of file slaeda.f.

168 *
169 * -- LAPACK computational routine (version 3.4.2) --
170 * -- LAPACK is a software package provided by Univ. of Tennessee, --
171 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
172 * September 2012
173 *
174 * .. Scalar Arguments ..
175  INTEGER curlvl, curpbm, info, n, tlvls
176 * ..
177 * .. Array Arguments ..
178  INTEGER givcol( 2, * ), givptr( * ), perm( * ),
179  $ prmptr( * ), qptr( * )
180  REAL givnum( 2, * ), q( * ), z( * ), ztemp( * )
181 * ..
182 *
183 * =====================================================================
184 *
185 * .. Parameters ..
186  REAL zero, half, one
187  parameter ( zero = 0.0e0, half = 0.5e0, one = 1.0e0 )
188 * ..
189 * .. Local Scalars ..
190  INTEGER bsiz1, bsiz2, curr, i, k, mid, psiz1, psiz2,
191  $ ptr, zptr1
192 * ..
193 * .. External Subroutines ..
194  EXTERNAL scopy, sgemv, srot, xerbla
195 * ..
196 * .. Intrinsic Functions ..
197  INTRINSIC int, REAL, sqrt
198 * ..
199 * .. Executable Statements ..
200 *
201 * Test the input parameters.
202 *
203  info = 0
204 *
205  IF( n.LT.0 ) THEN
206  info = -1
207  END IF
208  IF( info.NE.0 ) THEN
209  CALL xerbla( 'SLAEDA', -info )
210  RETURN
211  END IF
212 *
213 * Quick return if possible
214 *
215  IF( n.EQ.0 )
216  $ RETURN
217 *
218 * Determine location of first number in second half.
219 *
220  mid = n / 2 + 1
221 *
222 * Gather last/first rows of appropriate eigenblocks into center of Z
223 *
224  ptr = 1
225 *
226 * Determine location of lowest level subproblem in the full storage
227 * scheme
228 *
229  curr = ptr + curpbm*2**curlvl + 2**( curlvl-1 ) - 1
230 *
231 * Determine size of these matrices. We add HALF to the value of
232 * the SQRT in case the machine underestimates one of these square
233 * roots.
234 *
235  bsiz1 = int( half+sqrt( REAL( QPTR( CURR+1 )-QPTR( CURR ) ) ) )
236  bsiz2 = int( half+sqrt( REAL( QPTR( CURR+2 )-QPTR( CURR+1 ) ) ) )
237  DO 10 k = 1, mid - bsiz1 - 1
238  z( k ) = zero
239  10 CONTINUE
240  CALL scopy( bsiz1, q( qptr( curr )+bsiz1-1 ), bsiz1,
241  $ z( mid-bsiz1 ), 1 )
242  CALL scopy( bsiz2, q( qptr( curr+1 ) ), bsiz2, z( mid ), 1 )
243  DO 20 k = mid + bsiz2, n
244  z( k ) = zero
245  20 CONTINUE
246 *
247 * Loop through remaining levels 1 -> CURLVL applying the Givens
248 * rotations and permutation and then multiplying the center matrices
249 * against the current Z.
250 *
251  ptr = 2**tlvls + 1
252  DO 70 k = 1, curlvl - 1
253  curr = ptr + curpbm*2**( curlvl-k ) + 2**( curlvl-k-1 ) - 1
254  psiz1 = prmptr( curr+1 ) - prmptr( curr )
255  psiz2 = prmptr( curr+2 ) - prmptr( curr+1 )
256  zptr1 = mid - psiz1
257 *
258 * Apply Givens at CURR and CURR+1
259 *
260  DO 30 i = givptr( curr ), givptr( curr+1 ) - 1
261  CALL srot( 1, z( zptr1+givcol( 1, i )-1 ), 1,
262  $ z( zptr1+givcol( 2, i )-1 ), 1, givnum( 1, i ),
263  $ givnum( 2, i ) )
264  30 CONTINUE
265  DO 40 i = givptr( curr+1 ), givptr( curr+2 ) - 1
266  CALL srot( 1, z( mid-1+givcol( 1, i ) ), 1,
267  $ z( mid-1+givcol( 2, i ) ), 1, givnum( 1, i ),
268  $ givnum( 2, i ) )
269  40 CONTINUE
270  psiz1 = prmptr( curr+1 ) - prmptr( curr )
271  psiz2 = prmptr( curr+2 ) - prmptr( curr+1 )
272  DO 50 i = 0, psiz1 - 1
273  ztemp( i+1 ) = z( zptr1+perm( prmptr( curr )+i )-1 )
274  50 CONTINUE
275  DO 60 i = 0, psiz2 - 1
276  ztemp( psiz1+i+1 ) = z( mid+perm( prmptr( curr+1 )+i )-1 )
277  60 CONTINUE
278 *
279 * Multiply Blocks at CURR and CURR+1
280 *
281 * Determine size of these matrices. We add HALF to the value of
282 * the SQRT in case the machine underestimates one of these
283 * square roots.
284 *
285  bsiz1 = int( half+sqrt( REAL( QPTR( CURR+1 )-QPTR( CURR ) ) ) )
286  bsiz2 = int( half+sqrt( REAL( QPTR( CURR+2 )-QPTR( CURR+ $ 1 ) ) ) )
287  IF( bsiz1.GT.0 ) THEN
288  CALL sgemv( 'T', bsiz1, bsiz1, one, q( qptr( curr ) ),
289  $ bsiz1, ztemp( 1 ), 1, zero, z( zptr1 ), 1 )
290  END IF
291  CALL scopy( psiz1-bsiz1, ztemp( bsiz1+1 ), 1, z( zptr1+bsiz1 ),
292  $ 1 )
293  IF( bsiz2.GT.0 ) THEN
294  CALL sgemv( 'T', bsiz2, bsiz2, one, q( qptr( curr+1 ) ),
295  $ bsiz2, ztemp( psiz1+1 ), 1, zero, z( mid ), 1 )
296  END IF
297  CALL scopy( psiz2-bsiz2, ztemp( psiz1+bsiz2+1 ), 1,
298  $ z( mid+bsiz2 ), 1 )
299 *
300  ptr = ptr + 2**( tlvls-k )
301  70 CONTINUE
302 *
303  RETURN
304 *
305 * End of SLAEDA
306 *
307 
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine sgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
SGEMV
Definition: sgemv.f:158
subroutine srot(N, SX, INCX, SY, INCY, C, S)
SROT
Definition: srot.f:53
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY
Definition: scopy.f:53

Here is the call graph for this function:

Here is the caller graph for this function: