LAPACK 3.3.0
|
00001 SUBROUTINE DLASDT( N, LVL, ND, INODE, NDIML, NDIMR, MSUB ) 00002 * 00003 * -- LAPACK auxiliary routine (version 3.2.2) -- 00004 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00005 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00006 * June 2010 00007 * 00008 * .. Scalar Arguments .. 00009 INTEGER LVL, MSUB, N, ND 00010 * .. 00011 * .. Array Arguments .. 00012 INTEGER INODE( * ), NDIML( * ), NDIMR( * ) 00013 * .. 00014 * 00015 * Purpose 00016 * ======= 00017 * 00018 * DLASDT creates a tree of subproblems for bidiagonal divide and 00019 * conquer. 00020 * 00021 * Arguments 00022 * ========= 00023 * 00024 * N (input) INTEGER 00025 * On entry, the number of diagonal elements of the 00026 * bidiagonal matrix. 00027 * 00028 * LVL (output) INTEGER 00029 * On exit, the number of levels on the computation tree. 00030 * 00031 * ND (output) INTEGER 00032 * On exit, the number of nodes on the tree. 00033 * 00034 * INODE (output) INTEGER array, dimension ( N ) 00035 * On exit, centers of subproblems. 00036 * 00037 * NDIML (output) INTEGER array, dimension ( N ) 00038 * On exit, row dimensions of left children. 00039 * 00040 * NDIMR (output) INTEGER array, dimension ( N ) 00041 * On exit, row dimensions of right children. 00042 * 00043 * MSUB (input) INTEGER 00044 * On entry, the maximum row dimension each subproblem at the 00045 * bottom of the tree can be of. 00046 * 00047 * Further Details 00048 * =============== 00049 * 00050 * Based on contributions by 00051 * Ming Gu and Huan Ren, Computer Science Division, University of 00052 * California at Berkeley, USA 00053 * 00054 * ===================================================================== 00055 * 00056 * .. Parameters .. 00057 DOUBLE PRECISION TWO 00058 PARAMETER ( TWO = 2.0D+0 ) 00059 * .. 00060 * .. Local Scalars .. 00061 INTEGER I, IL, IR, LLST, MAXN, NCRNT, NLVL 00062 DOUBLE PRECISION TEMP 00063 * .. 00064 * .. Intrinsic Functions .. 00065 INTRINSIC DBLE, INT, LOG, MAX 00066 * .. 00067 * .. Executable Statements .. 00068 * 00069 * Find the number of levels on the tree. 00070 * 00071 MAXN = MAX( 1, N ) 00072 TEMP = LOG( DBLE( MAXN ) / DBLE( MSUB+1 ) ) / LOG( TWO ) 00073 LVL = INT( TEMP ) + 1 00074 * 00075 I = N / 2 00076 INODE( 1 ) = I + 1 00077 NDIML( 1 ) = I 00078 NDIMR( 1 ) = N - I - 1 00079 IL = 0 00080 IR = 1 00081 LLST = 1 00082 DO 20 NLVL = 1, LVL - 1 00083 * 00084 * Constructing the tree at (NLVL+1)-st level. The number of 00085 * nodes created on this level is LLST * 2. 00086 * 00087 DO 10 I = 0, LLST - 1 00088 IL = IL + 2 00089 IR = IR + 2 00090 NCRNT = LLST + I 00091 NDIML( IL ) = NDIML( NCRNT ) / 2 00092 NDIMR( IL ) = NDIML( NCRNT ) - NDIML( IL ) - 1 00093 INODE( IL ) = INODE( NCRNT ) - NDIMR( IL ) - 1 00094 NDIML( IR ) = NDIMR( NCRNT ) / 2 00095 NDIMR( IR ) = NDIMR( NCRNT ) - NDIML( IR ) - 1 00096 INODE( IR ) = INODE( NCRNT ) + NDIML( IR ) + 1 00097 10 CONTINUE 00098 LLST = LLST*2 00099 20 CONTINUE 00100 ND = LLST*2 - 1 00101 * 00102 RETURN 00103 * 00104 * End of DLASDT 00105 * 00106 END