![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b SLASDT 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download SLASDT + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slasdt.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slasdt.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slasdt.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE SLASDT( N, LVL, ND, INODE, NDIML, NDIMR, MSUB ) 00022 * 00023 * .. Scalar Arguments .. 00024 * INTEGER LVL, MSUB, N, ND 00025 * .. 00026 * .. Array Arguments .. 00027 * INTEGER INODE( * ), NDIML( * ), NDIMR( * ) 00028 * .. 00029 * 00030 * 00031 *> \par Purpose: 00032 * ============= 00033 *> 00034 *> \verbatim 00035 *> 00036 *> SLASDT creates a tree of subproblems for bidiagonal divide and 00037 *> conquer. 00038 *> \endverbatim 00039 * 00040 * Arguments: 00041 * ========== 00042 * 00043 *> \param[in] N 00044 *> \verbatim 00045 *> N is INTEGER 00046 *> On entry, the number of diagonal elements of the 00047 *> bidiagonal matrix. 00048 *> \endverbatim 00049 *> 00050 *> \param[out] LVL 00051 *> \verbatim 00052 *> LVL is INTEGER 00053 *> On exit, the number of levels on the computation tree. 00054 *> \endverbatim 00055 *> 00056 *> \param[out] ND 00057 *> \verbatim 00058 *> ND is INTEGER 00059 *> On exit, the number of nodes on the tree. 00060 *> \endverbatim 00061 *> 00062 *> \param[out] INODE 00063 *> \verbatim 00064 *> INODE is INTEGER array, dimension ( N ) 00065 *> On exit, centers of subproblems. 00066 *> \endverbatim 00067 *> 00068 *> \param[out] NDIML 00069 *> \verbatim 00070 *> NDIML is INTEGER array, dimension ( N ) 00071 *> On exit, row dimensions of left children. 00072 *> \endverbatim 00073 *> 00074 *> \param[out] NDIMR 00075 *> \verbatim 00076 *> NDIMR is INTEGER array, dimension ( N ) 00077 *> On exit, row dimensions of right children. 00078 *> \endverbatim 00079 *> 00080 *> \param[in] MSUB 00081 *> \verbatim 00082 *> MSUB is INTEGER 00083 *> On entry, the maximum row dimension each subproblem at the 00084 *> bottom of the tree can be of. 00085 *> \endverbatim 00086 * 00087 * Authors: 00088 * ======== 00089 * 00090 *> \author Univ. of Tennessee 00091 *> \author Univ. of California Berkeley 00092 *> \author Univ. of Colorado Denver 00093 *> \author NAG Ltd. 00094 * 00095 *> \date November 2011 00096 * 00097 *> \ingroup auxOTHERauxiliary 00098 * 00099 *> \par Contributors: 00100 * ================== 00101 *> 00102 *> Ming Gu and Huan Ren, Computer Science Division, University of 00103 *> California at Berkeley, USA 00104 *> 00105 * ===================================================================== 00106 SUBROUTINE SLASDT( N, LVL, ND, INODE, NDIML, NDIMR, MSUB ) 00107 * 00108 * -- LAPACK auxiliary routine (version 3.4.0) -- 00109 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00110 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00111 * November 2011 00112 * 00113 * .. Scalar Arguments .. 00114 INTEGER LVL, MSUB, N, ND 00115 * .. 00116 * .. Array Arguments .. 00117 INTEGER INODE( * ), NDIML( * ), NDIMR( * ) 00118 * .. 00119 * 00120 * ===================================================================== 00121 * 00122 * .. Parameters .. 00123 REAL TWO 00124 PARAMETER ( TWO = 2.0E+0 ) 00125 * .. 00126 * .. Local Scalars .. 00127 INTEGER I, IL, IR, LLST, MAXN, NCRNT, NLVL 00128 REAL TEMP 00129 * .. 00130 * .. Intrinsic Functions .. 00131 INTRINSIC INT, LOG, MAX, REAL 00132 * .. 00133 * .. Executable Statements .. 00134 * 00135 * Find the number of levels on the tree. 00136 * 00137 MAXN = MAX( 1, N ) 00138 TEMP = LOG( REAL( MAXN ) / REAL( MSUB+1 ) ) / LOG( TWO ) 00139 LVL = INT( TEMP ) + 1 00140 * 00141 I = N / 2 00142 INODE( 1 ) = I + 1 00143 NDIML( 1 ) = I 00144 NDIMR( 1 ) = N - I - 1 00145 IL = 0 00146 IR = 1 00147 LLST = 1 00148 DO 20 NLVL = 1, LVL - 1 00149 * 00150 * Constructing the tree at (NLVL+1)-st level. The number of 00151 * nodes created on this level is LLST * 2. 00152 * 00153 DO 10 I = 0, LLST - 1 00154 IL = IL + 2 00155 IR = IR + 2 00156 NCRNT = LLST + I 00157 NDIML( IL ) = NDIML( NCRNT ) / 2 00158 NDIMR( IL ) = NDIML( NCRNT ) - NDIML( IL ) - 1 00159 INODE( IL ) = INODE( NCRNT ) - NDIMR( IL ) - 1 00160 NDIML( IR ) = NDIMR( NCRNT ) / 2 00161 NDIMR( IR ) = NDIMR( NCRNT ) - NDIML( IR ) - 1 00162 INODE( IR ) = INODE( NCRNT ) + NDIML( IR ) + 1 00163 10 CONTINUE 00164 LLST = LLST*2 00165 20 CONTINUE 00166 ND = LLST*2 - 1 00167 * 00168 RETURN 00169 * 00170 * End of SLASDT 00171 * 00172 END