LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
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.
Date
September 2012
Contributors:
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA

Definition at line 107 of file slasdt.f.

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

Here is the caller graph for this function: