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

◆ slasdt()

subroutine slasdt ( integer n,
integer lvl,
integer nd,
integer, dimension( * ) inode,
integer, dimension( * ) ndiml,
integer, dimension( * ) ndimr,
integer msub )

SLASDT creates a tree of subproblems for bidiagonal divide and conquer. Used by sbdsdc.

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

Purpose:
!>
!> SLASDT creates a tree of subproblems for bidiagonal divide and
!> conquer.
!> 
Parameters
[in]N
!>          N is INTEGER
!>          On entry, the number of diagonal elements of the
!>          bidiagonal matrix.
!> 
[out]LVL
!>          LVL is INTEGER
!>          On exit, the number of levels on the computation tree.
!> 
[out]ND
!>          ND is INTEGER
!>          On exit, the number of nodes on the tree.
!> 
[out]INODE
!>          INODE is INTEGER array, dimension ( N )
!>          On exit, centers of subproblems.
!> 
[out]NDIML
!>          NDIML is INTEGER array, dimension ( N )
!>          On exit, row dimensions of left children.
!> 
[out]NDIMR
!>          NDIMR is INTEGER array, dimension ( N )
!>          On exit, row dimensions of right children.
!> 
[in]MSUB
!>          MSUB is INTEGER
!>          On entry, the maximum row dimension each subproblem at the
!>          bottom of the tree can be of.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA

Definition at line 102 of file slasdt.f.

103*
104* -- LAPACK auxiliary routine --
105* -- LAPACK is a software package provided by Univ. of Tennessee, --
106* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
107*
108* .. Scalar Arguments ..
109 INTEGER LVL, MSUB, N, ND
110* ..
111* .. Array Arguments ..
112 INTEGER INODE( * ), NDIML( * ), NDIMR( * )
113* ..
114*
115* =====================================================================
116*
117* .. Parameters ..
118 REAL TWO
119 parameter( two = 2.0e+0 )
120* ..
121* .. Local Scalars ..
122 INTEGER I, IL, IR, LLST, MAXN, NCRNT, NLVL
123 REAL TEMP
124* ..
125* .. Intrinsic Functions ..
126 INTRINSIC int, log, max, real
127* ..
128* .. Executable Statements ..
129*
130* Find the number of levels on the tree.
131*
132 maxn = max( 1, n )
133 temp = log( real( maxn ) / real( msub+1 ) ) / log( two )
134 lvl = int( temp ) + 1
135*
136 i = n / 2
137 inode( 1 ) = i + 1
138 ndiml( 1 ) = i
139 ndimr( 1 ) = n - i - 1
140 il = 0
141 ir = 1
142 llst = 1
143 DO 20 nlvl = 1, lvl - 1
144*
145* Constructing the tree at (NLVL+1)-st level. The number of
146* nodes created on this level is LLST * 2.
147*
148 DO 10 i = 0, llst - 1
149 il = il + 2
150 ir = ir + 2
151 ncrnt = llst + i
152 ndiml( il ) = ndiml( ncrnt ) / 2
153 ndimr( il ) = ndiml( ncrnt ) - ndiml( il ) - 1
154 inode( il ) = inode( ncrnt ) - ndimr( il ) - 1
155 ndiml( ir ) = ndimr( ncrnt ) / 2
156 ndimr( ir ) = ndimr( ncrnt ) - ndiml( ir ) - 1
157 inode( ir ) = inode( ncrnt ) + ndiml( ir ) + 1
158 10 CONTINUE
159 llst = llst*2
160 20 CONTINUE
161 nd = llst*2 - 1
162*
163 RETURN
164*
165* End of SLASDT
166*
Here is the caller graph for this function: