LAPACK 3.12.0
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 104 of file slasdt.f.

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