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

◆ dlaeda()

subroutine dlaeda ( integer n,
integer tlvls,
integer curlvl,
integer curpbm,
integer, dimension( * ) prmptr,
integer, dimension( * ) perm,
integer, dimension( * ) givptr,
integer, dimension( 2, * ) givcol,
double precision, dimension( 2, * ) givnum,
double precision, dimension( * ) q,
integer, dimension( * ) qptr,
double precision, dimension( * ) z,
double precision, dimension( * ) ztemp,
integer info )

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

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

Purpose:
!>
!> DLAEDA 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 DOUBLE PRECISION array, dimension (2, N lg N)
!>         Each number indicates the S value to be used in the
!>         corresponding Givens rotation.
!> 
[in]Q
!>          Q is DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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.
Contributors:
Jeff Rutter, Computer Science Division, University of California at Berkeley, USA

Definition at line 162 of file dlaeda.f.

165*
166* -- LAPACK computational routine --
167* -- LAPACK is a software package provided by Univ. of Tennessee, --
168* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
169*
170* .. Scalar Arguments ..
171 INTEGER CURLVL, CURPBM, INFO, N, TLVLS
172* ..
173* .. Array Arguments ..
174 INTEGER GIVCOL( 2, * ), GIVPTR( * ), PERM( * ),
175 $ PRMPTR( * ), QPTR( * )
176 DOUBLE PRECISION GIVNUM( 2, * ), Q( * ), Z( * ), ZTEMP( * )
177* ..
178*
179* =====================================================================
180*
181* .. Parameters ..
182 DOUBLE PRECISION ZERO, HALF, ONE
183 parameter( zero = 0.0d0, half = 0.5d0, one = 1.0d0 )
184* ..
185* .. Local Scalars ..
186 INTEGER BSIZ1, BSIZ2, CURR, I, K, MID, PSIZ1, PSIZ2,
187 $ PTR, ZPTR1
188* ..
189* .. External Subroutines ..
190 EXTERNAL dcopy, dgemv, drot, xerbla
191* ..
192* .. Intrinsic Functions ..
193 INTRINSIC dble, int, sqrt
194* ..
195* .. Executable Statements ..
196*
197* Test the input parameters.
198*
199 info = 0
200*
201 IF( n.LT.0 ) THEN
202 info = -1
203 END IF
204 IF( info.NE.0 ) THEN
205 CALL xerbla( 'DLAEDA', -info )
206 RETURN
207 END IF
208*
209* Quick return if possible
210*
211 IF( n.EQ.0 )
212 $ RETURN
213*
214* Determine location of first number in second half.
215*
216 mid = n / 2 + 1
217*
218* Gather last/first rows of appropriate eigenblocks into center of Z
219*
220 ptr = 1
221*
222* Determine location of lowest level subproblem in the full storage
223* scheme
224*
225 curr = ptr + curpbm*2**curlvl + 2**( curlvl-1 ) - 1
226*
227* Determine size of these matrices. We add HALF to the value of
228* the SQRT in case the machine underestimates one of these square
229* roots.
230*
231 bsiz1 = int( half+sqrt( dble( qptr( curr+1 )-qptr( curr ) ) ) )
232 bsiz2 = int( half+sqrt( dble( qptr( curr+2 )-qptr( curr+1 ) ) ) )
233 DO 10 k = 1, mid - bsiz1 - 1
234 z( k ) = zero
235 10 CONTINUE
236 CALL dcopy( bsiz1, q( qptr( curr )+bsiz1-1 ), bsiz1,
237 $ z( mid-bsiz1 ), 1 )
238 CALL dcopy( bsiz2, q( qptr( curr+1 ) ), bsiz2, z( mid ), 1 )
239 DO 20 k = mid + bsiz2, n
240 z( k ) = zero
241 20 CONTINUE
242*
243* Loop through remaining levels 1 -> CURLVL applying the Givens
244* rotations and permutation and then multiplying the center matrices
245* against the current Z.
246*
247 ptr = 2**tlvls + 1
248 DO 70 k = 1, curlvl - 1
249 curr = ptr + curpbm*2**( curlvl-k ) + 2**( curlvl-k-1 ) - 1
250 psiz1 = prmptr( curr+1 ) - prmptr( curr )
251 psiz2 = prmptr( curr+2 ) - prmptr( curr+1 )
252 zptr1 = mid - psiz1
253*
254* Apply Givens at CURR and CURR+1
255*
256 DO 30 i = givptr( curr ), givptr( curr+1 ) - 1
257 CALL drot( 1, z( zptr1+givcol( 1, i )-1 ), 1,
258 $ z( zptr1+givcol( 2, i )-1 ), 1, givnum( 1, i ),
259 $ givnum( 2, i ) )
260 30 CONTINUE
261 DO 40 i = givptr( curr+1 ), givptr( curr+2 ) - 1
262 CALL drot( 1, z( mid-1+givcol( 1, i ) ), 1,
263 $ z( mid-1+givcol( 2, i ) ), 1, givnum( 1, i ),
264 $ givnum( 2, i ) )
265 40 CONTINUE
266 psiz1 = prmptr( curr+1 ) - prmptr( curr )
267 psiz2 = prmptr( curr+2 ) - prmptr( curr+1 )
268 DO 50 i = 0, psiz1 - 1
269 ztemp( i+1 ) = z( zptr1+perm( prmptr( curr )+i )-1 )
270 50 CONTINUE
271 DO 60 i = 0, psiz2 - 1
272 ztemp( psiz1+i+1 ) = z( mid+perm( prmptr( curr+1 )+i )-1 )
273 60 CONTINUE
274*
275* Multiply Blocks at CURR and CURR+1
276*
277* Determine size of these matrices. We add HALF to the value of
278* the SQRT in case the machine underestimates one of these
279* square roots.
280*
281 bsiz1 = int( half+sqrt( dble( qptr( curr+1 )-qptr( curr ) ) ) )
282 bsiz2 = int( half+sqrt( dble( qptr( curr+2 )-qptr( curr+
283 $ 1 ) ) ) )
284 IF( bsiz1.GT.0 ) THEN
285 CALL dgemv( 'T', bsiz1, bsiz1, one, q( qptr( curr ) ),
286 $ bsiz1, ztemp( 1 ), 1, zero, z( zptr1 ), 1 )
287 END IF
288 CALL dcopy( psiz1-bsiz1, ztemp( bsiz1+1 ), 1,
289 $ z( zptr1+bsiz1 ),
290 $ 1 )
291 IF( bsiz2.GT.0 ) THEN
292 CALL dgemv( 'T', bsiz2, bsiz2, one, q( qptr( curr+1 ) ),
293 $ bsiz2, ztemp( psiz1+1 ), 1, zero, z( mid ), 1 )
294 END IF
295 CALL dcopy( psiz2-bsiz2, ztemp( psiz1+bsiz2+1 ), 1,
296 $ z( mid+bsiz2 ), 1 )
297*
298 ptr = ptr + 2**( tlvls-k )
299 70 CONTINUE
300*
301 RETURN
302*
303* End of DLAEDA
304*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
Definition dgemv.f:158
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT
Definition drot.f:92
Here is the call graph for this function:
Here is the caller graph for this function: