![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CTGEXC 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CTGEXC + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ctgexc.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ctgexc.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgexc.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CTGEXC( WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, 00022 * LDZ, IFST, ILST, INFO ) 00023 * 00024 * .. Scalar Arguments .. 00025 * LOGICAL WANTQ, WANTZ 00026 * INTEGER IFST, ILST, INFO, LDA, LDB, LDQ, LDZ, N 00027 * .. 00028 * .. Array Arguments .. 00029 * COMPLEX A( LDA, * ), B( LDB, * ), Q( LDQ, * ), 00030 * $ Z( LDZ, * ) 00031 * .. 00032 * 00033 * 00034 *> \par Purpose: 00035 * ============= 00036 *> 00037 *> \verbatim 00038 *> 00039 *> CTGEXC reorders the generalized Schur decomposition of a complex 00040 *> matrix pair (A,B), using an unitary equivalence transformation 00041 *> (A, B) := Q * (A, B) * Z**H, so that the diagonal block of (A, B) with 00042 *> row index IFST is moved to row ILST. 00043 *> 00044 *> (A, B) must be in generalized Schur canonical form, that is, A and 00045 *> B are both upper triangular. 00046 *> 00047 *> Optionally, the matrices Q and Z of generalized Schur vectors are 00048 *> updated. 00049 *> 00050 *> Q(in) * A(in) * Z(in)**H = Q(out) * A(out) * Z(out)**H 00051 *> Q(in) * B(in) * Z(in)**H = Q(out) * B(out) * Z(out)**H 00052 *> \endverbatim 00053 * 00054 * Arguments: 00055 * ========== 00056 * 00057 *> \param[in] WANTQ 00058 *> \verbatim 00059 *> WANTQ is LOGICAL 00060 *> .TRUE. : update the left transformation matrix Q; 00061 *> .FALSE.: do not update Q. 00062 *> \endverbatim 00063 *> 00064 *> \param[in] WANTZ 00065 *> \verbatim 00066 *> WANTZ is LOGICAL 00067 *> .TRUE. : update the right transformation matrix Z; 00068 *> .FALSE.: do not update Z. 00069 *> \endverbatim 00070 *> 00071 *> \param[in] N 00072 *> \verbatim 00073 *> N is INTEGER 00074 *> The order of the matrices A and B. N >= 0. 00075 *> \endverbatim 00076 *> 00077 *> \param[in,out] A 00078 *> \verbatim 00079 *> A is COMPLEX array, dimension (LDA,N) 00080 *> On entry, the upper triangular matrix A in the pair (A, B). 00081 *> On exit, the updated matrix A. 00082 *> \endverbatim 00083 *> 00084 *> \param[in] LDA 00085 *> \verbatim 00086 *> LDA is INTEGER 00087 *> The leading dimension of the array A. LDA >= max(1,N). 00088 *> \endverbatim 00089 *> 00090 *> \param[in,out] B 00091 *> \verbatim 00092 *> B is COMPLEX array, dimension (LDB,N) 00093 *> On entry, the upper triangular matrix B in the pair (A, B). 00094 *> On exit, the updated matrix B. 00095 *> \endverbatim 00096 *> 00097 *> \param[in] LDB 00098 *> \verbatim 00099 *> LDB is INTEGER 00100 *> The leading dimension of the array B. LDB >= max(1,N). 00101 *> \endverbatim 00102 *> 00103 *> \param[in,out] Q 00104 *> \verbatim 00105 *> Q is COMPLEX array, dimension (LDZ,N) 00106 *> On entry, if WANTQ = .TRUE., the unitary matrix Q. 00107 *> On exit, the updated matrix Q. 00108 *> If WANTQ = .FALSE., Q is not referenced. 00109 *> \endverbatim 00110 *> 00111 *> \param[in] LDQ 00112 *> \verbatim 00113 *> LDQ is INTEGER 00114 *> The leading dimension of the array Q. LDQ >= 1; 00115 *> If WANTQ = .TRUE., LDQ >= N. 00116 *> \endverbatim 00117 *> 00118 *> \param[in,out] Z 00119 *> \verbatim 00120 *> Z is COMPLEX array, dimension (LDZ,N) 00121 *> On entry, if WANTZ = .TRUE., the unitary matrix Z. 00122 *> On exit, the updated matrix Z. 00123 *> If WANTZ = .FALSE., Z is not referenced. 00124 *> \endverbatim 00125 *> 00126 *> \param[in] LDZ 00127 *> \verbatim 00128 *> LDZ is INTEGER 00129 *> The leading dimension of the array Z. LDZ >= 1; 00130 *> If WANTZ = .TRUE., LDZ >= N. 00131 *> \endverbatim 00132 *> 00133 *> \param[in] IFST 00134 *> \verbatim 00135 *> IFST is INTEGER 00136 *> \endverbatim 00137 *> 00138 *> \param[in,out] ILST 00139 *> \verbatim 00140 *> ILST is INTEGER 00141 *> Specify the reordering of the diagonal blocks of (A, B). 00142 *> The block with row index IFST is moved to row ILST, by a 00143 *> sequence of swapping between adjacent blocks. 00144 *> \endverbatim 00145 *> 00146 *> \param[out] INFO 00147 *> \verbatim 00148 *> INFO is INTEGER 00149 *> =0: Successful exit. 00150 *> <0: if INFO = -i, the i-th argument had an illegal value. 00151 *> =1: The transformed matrix pair (A, B) would be too far 00152 *> from generalized Schur form; the problem is ill- 00153 *> conditioned. (A, B) may have been partially reordered, 00154 *> and ILST points to the first row of the current 00155 *> position of the block being moved. 00156 *> \endverbatim 00157 * 00158 * Authors: 00159 * ======== 00160 * 00161 *> \author Univ. of Tennessee 00162 *> \author Univ. of California Berkeley 00163 *> \author Univ. of Colorado Denver 00164 *> \author NAG Ltd. 00165 * 00166 *> \date November 2011 00167 * 00168 *> \ingroup complexGEcomputational 00169 * 00170 *> \par Contributors: 00171 * ================== 00172 *> 00173 *> Bo Kagstrom and Peter Poromaa, Department of Computing Science, 00174 *> Umea University, S-901 87 Umea, Sweden. 00175 * 00176 *> \par References: 00177 * ================ 00178 *> 00179 *> [1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the 00180 *> Generalized Real Schur Form of a Regular Matrix Pair (A, B), in 00181 *> M.S. Moonen et al (eds), Linear Algebra for Large Scale and 00182 *> Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218. 00183 *> \n 00184 *> [2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified 00185 *> Eigenvalues of a Regular Matrix Pair (A, B) and Condition 00186 *> Estimation: Theory, Algorithms and Software, Report 00187 *> UMINF - 94.04, Department of Computing Science, Umea University, 00188 *> S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. 00189 *> To appear in Numerical Algorithms, 1996. 00190 *> \n 00191 *> [3] B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software 00192 *> for Solving the Generalized Sylvester Equation and Estimating the 00193 *> Separation between Regular Matrix Pairs, Report UMINF - 93.23, 00194 *> Department of Computing Science, Umea University, S-901 87 Umea, 00195 *> Sweden, December 1993, Revised April 1994, Also as LAPACK working 00196 *> Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1, 00197 *> 1996. 00198 *> 00199 * ===================================================================== 00200 SUBROUTINE CTGEXC( WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, 00201 $ LDZ, IFST, ILST, INFO ) 00202 * 00203 * -- LAPACK computational routine (version 3.4.0) -- 00204 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00205 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00206 * November 2011 00207 * 00208 * .. Scalar Arguments .. 00209 LOGICAL WANTQ, WANTZ 00210 INTEGER IFST, ILST, INFO, LDA, LDB, LDQ, LDZ, N 00211 * .. 00212 * .. Array Arguments .. 00213 COMPLEX A( LDA, * ), B( LDB, * ), Q( LDQ, * ), 00214 $ Z( LDZ, * ) 00215 * .. 00216 * 00217 * ===================================================================== 00218 * 00219 * .. Local Scalars .. 00220 INTEGER HERE 00221 * .. 00222 * .. External Subroutines .. 00223 EXTERNAL CTGEX2, XERBLA 00224 * .. 00225 * .. Intrinsic Functions .. 00226 INTRINSIC MAX 00227 * .. 00228 * .. Executable Statements .. 00229 * 00230 * Decode and test input arguments. 00231 INFO = 0 00232 IF( N.LT.0 ) THEN 00233 INFO = -3 00234 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN 00235 INFO = -5 00236 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN 00237 INFO = -7 00238 ELSE IF( LDQ.LT.1 .OR. WANTQ .AND. ( LDQ.LT.MAX( 1, N ) ) ) THEN 00239 INFO = -9 00240 ELSE IF( LDZ.LT.1 .OR. WANTZ .AND. ( LDZ.LT.MAX( 1, N ) ) ) THEN 00241 INFO = -11 00242 ELSE IF( IFST.LT.1 .OR. IFST.GT.N ) THEN 00243 INFO = -12 00244 ELSE IF( ILST.LT.1 .OR. ILST.GT.N ) THEN 00245 INFO = -13 00246 END IF 00247 IF( INFO.NE.0 ) THEN 00248 CALL XERBLA( 'CTGEXC', -INFO ) 00249 RETURN 00250 END IF 00251 * 00252 * Quick return if possible 00253 * 00254 IF( N.LE.1 ) 00255 $ RETURN 00256 IF( IFST.EQ.ILST ) 00257 $ RETURN 00258 * 00259 IF( IFST.LT.ILST ) THEN 00260 * 00261 HERE = IFST 00262 * 00263 10 CONTINUE 00264 * 00265 * Swap with next one below 00266 * 00267 CALL CTGEX2( WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, LDZ, 00268 $ HERE, INFO ) 00269 IF( INFO.NE.0 ) THEN 00270 ILST = HERE 00271 RETURN 00272 END IF 00273 HERE = HERE + 1 00274 IF( HERE.LT.ILST ) 00275 $ GO TO 10 00276 HERE = HERE - 1 00277 ELSE 00278 HERE = IFST - 1 00279 * 00280 20 CONTINUE 00281 * 00282 * Swap with next one above 00283 * 00284 CALL CTGEX2( WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, LDZ, 00285 $ HERE, INFO ) 00286 IF( INFO.NE.0 ) THEN 00287 ILST = HERE 00288 RETURN 00289 END IF 00290 HERE = HERE - 1 00291 IF( HERE.GE.ILST ) 00292 $ GO TO 20 00293 HERE = HERE + 1 00294 END IF 00295 ILST = HERE 00296 RETURN 00297 * 00298 * End of CTGEXC 00299 * 00300 END