7072
|
1 SUBROUTINE DLASDT( N, LVL, ND, INODE, NDIML, NDIMR, MSUB ) |
|
2 * |
|
3 * -- LAPACK auxiliary routine (version 3.1) -- |
|
4 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. |
|
5 * November 2006 |
|
6 * |
|
7 * .. Scalar Arguments .. |
|
8 INTEGER LVL, MSUB, N, ND |
|
9 * .. |
|
10 * .. Array Arguments .. |
|
11 INTEGER INODE( * ), NDIML( * ), NDIMR( * ) |
|
12 * .. |
|
13 * |
|
14 * Purpose |
|
15 * ======= |
|
16 * |
|
17 * DLASDT creates a tree of subproblems for bidiagonal divide and |
|
18 * conquer. |
|
19 * |
|
20 * Arguments |
|
21 * ========= |
|
22 * |
|
23 * N (input) INTEGER |
|
24 * On entry, the number of diagonal elements of the |
|
25 * bidiagonal matrix. |
|
26 * |
|
27 * LVL (output) INTEGER |
|
28 * On exit, the number of levels on the computation tree. |
|
29 * |
|
30 * ND (output) INTEGER |
|
31 * On exit, the number of nodes on the tree. |
|
32 * |
|
33 * INODE (output) INTEGER array, dimension ( N ) |
|
34 * On exit, centers of subproblems. |
|
35 * |
|
36 * NDIML (output) INTEGER array, dimension ( N ) |
|
37 * On exit, row dimensions of left children. |
|
38 * |
|
39 * NDIMR (output) INTEGER array, dimension ( N ) |
|
40 * On exit, row dimensions of right children. |
|
41 * |
|
42 * MSUB (input) INTEGER. |
|
43 * On entry, the maximum row dimension each subproblem at the |
|
44 * bottom of the tree can be of. |
|
45 * |
|
46 * Further Details |
|
47 * =============== |
|
48 * |
|
49 * Based on contributions by |
|
50 * Ming Gu and Huan Ren, Computer Science Division, University of |
|
51 * California at Berkeley, USA |
|
52 * |
|
53 * ===================================================================== |
|
54 * |
|
55 * .. Parameters .. |
|
56 DOUBLE PRECISION TWO |
|
57 PARAMETER ( TWO = 2.0D+0 ) |
|
58 * .. |
|
59 * .. Local Scalars .. |
|
60 INTEGER I, IL, IR, LLST, MAXN, NCRNT, NLVL |
|
61 DOUBLE PRECISION TEMP |
|
62 * .. |
|
63 * .. Intrinsic Functions .. |
|
64 INTRINSIC DBLE, INT, LOG, MAX |
|
65 * .. |
|
66 * .. Executable Statements .. |
|
67 * |
|
68 * Find the number of levels on the tree. |
|
69 * |
|
70 MAXN = MAX( 1, N ) |
|
71 TEMP = LOG( DBLE( MAXN ) / DBLE( MSUB+1 ) ) / LOG( TWO ) |
|
72 LVL = INT( TEMP ) + 1 |
|
73 * |
|
74 I = N / 2 |
|
75 INODE( 1 ) = I + 1 |
|
76 NDIML( 1 ) = I |
|
77 NDIMR( 1 ) = N - I - 1 |
|
78 IL = 0 |
|
79 IR = 1 |
|
80 LLST = 1 |
|
81 DO 20 NLVL = 1, LVL - 1 |
|
82 * |
|
83 * Constructing the tree at (NLVL+1)-st level. The number of |
|
84 * nodes created on this level is LLST * 2. |
|
85 * |
|
86 DO 10 I = 0, LLST - 1 |
|
87 IL = IL + 2 |
|
88 IR = IR + 2 |
|
89 NCRNT = LLST + I |
|
90 NDIML( IL ) = NDIML( NCRNT ) / 2 |
|
91 NDIMR( IL ) = NDIML( NCRNT ) - NDIML( IL ) - 1 |
|
92 INODE( IL ) = INODE( NCRNT ) - NDIMR( IL ) - 1 |
|
93 NDIML( IR ) = NDIMR( NCRNT ) / 2 |
|
94 NDIMR( IR ) = NDIMR( NCRNT ) - NDIML( IR ) - 1 |
|
95 INODE( IR ) = INODE( NCRNT ) + NDIML( IR ) + 1 |
|
96 10 CONTINUE |
|
97 LLST = LLST*2 |
|
98 20 CONTINUE |
|
99 ND = LLST*2 - 1 |
|
100 * |
|
101 RETURN |
|
102 * |
|
103 * End of DLASDT |
|
104 * |
|
105 END |