1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
|
---
:name: cggevx
:md5sum: 6749d93a340b1974b08908ef409f99e7
:category: :subroutine
:arguments:
- balanc:
:type: char
:intent: input
- jobvl:
:type: char
:intent: input
- jobvr:
:type: char
:intent: input
- sense:
:type: char
:intent: input
- n:
:type: integer
:intent: input
- a:
:type: complex
:intent: input/output
:dims:
- lda
- n
- lda:
:type: integer
:intent: input
- b:
:type: complex
:intent: input/output
:dims:
- ldb
- n
- ldb:
:type: integer
:intent: input
- alpha:
:type: complex
:intent: output
:dims:
- n
- beta:
:type: complex
:intent: output
:dims:
- n
- vl:
:type: complex
:intent: output
:dims:
- ldvl
- n
- ldvl:
:type: integer
:intent: input
- vr:
:type: complex
:intent: output
:dims:
- ldvr
- n
- ldvr:
:type: integer
:intent: input
- ilo:
:type: integer
:intent: output
- ihi:
:type: integer
:intent: output
- lscale:
:type: real
:intent: output
:dims:
- n
- rscale:
:type: real
:intent: output
:dims:
- n
- abnrm:
:type: real
:intent: output
- bbnrm:
:type: real
:intent: output
- rconde:
:type: real
:intent: output
:dims:
- n
- rcondv:
:type: real
:intent: output
:dims:
- n
- work:
:type: complex
:intent: output
:dims:
- MAX(1,lwork)
- lwork:
:type: integer
:intent: input
:option: true
:default: "lsame_(&sense,\"E\") ? 4*n : (lsame_(&sense,\"V\")||lsame_(&sense,\"B\")) ? 2*n*n+2*n : 2*n"
- rwork:
:type: real
:intent: workspace
:dims:
- lrwork
- iwork:
:type: integer
:intent: workspace
:dims:
- "lsame_(&sense,\"E\") ? 0 : n+2"
- bwork:
:type: logical
:intent: workspace
:dims:
- "lsame_(&sense,\"N\") ? 0 : n"
- info:
:type: integer
:intent: output
:substitutions:
ldvr: "lsame_(&jobvr,\"V\") ? n : 1"
lrwork: "((lsame_(&balanc,\"S\")) || (lsame_(&balanc,\"B\"))) ? MAX(1,6*n) : MAX(1,2*n)"
ldvl: "lsame_(&jobvl,\"V\") ? n : 1"
:fortran_help: " SUBROUTINE CGGEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB, ALPHA, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE, ABNRM, BBNRM, RCONDE, RCONDV, WORK, LWORK, RWORK, IWORK, BWORK, INFO )\n\n\
* Purpose\n\
* =======\n\
*\n\
* CGGEVX computes for a pair of N-by-N complex nonsymmetric matrices\n\
* (A,B) the generalized eigenvalues, and optionally, the left and/or\n\
* right generalized eigenvectors.\n\
*\n\
* Optionally, it also computes a balancing transformation to improve\n\
* the conditioning of the eigenvalues and eigenvectors (ILO, IHI,\n\
* LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for\n\
* the eigenvalues (RCONDE), and reciprocal condition numbers for the\n\
* right eigenvectors (RCONDV).\n\
*\n\
* A generalized eigenvalue for a pair of matrices (A,B) is a scalar\n\
* lambda or a ratio alpha/beta = lambda, such that A - lambda*B is\n\
* singular. It is usually represented as the pair (alpha,beta), as\n\
* there is a reasonable interpretation for beta=0, and even for both\n\
* being zero.\n\
*\n\
* The right eigenvector v(j) corresponding to the eigenvalue lambda(j)\n\
* of (A,B) satisfies\n\
* A * v(j) = lambda(j) * B * v(j) .\n\
* The left eigenvector u(j) corresponding to the eigenvalue lambda(j)\n\
* of (A,B) satisfies\n\
* u(j)**H * A = lambda(j) * u(j)**H * B.\n\
* where u(j)**H is the conjugate-transpose of u(j).\n\
*\n\
*\n\n\
* Arguments\n\
* =========\n\
*\n\
* BALANC (input) CHARACTER*1\n\
* Specifies the balance option to be performed:\n\
* = 'N': do not diagonally scale or permute;\n\
* = 'P': permute only;\n\
* = 'S': scale only;\n\
* = 'B': both permute and scale.\n\
* Computed reciprocal condition numbers will be for the\n\
* matrices after permuting and/or balancing. Permuting does\n\
* not change condition numbers (in exact arithmetic), but\n\
* balancing does.\n\
*\n\
* JOBVL (input) CHARACTER*1\n\
* = 'N': do not compute the left generalized eigenvectors;\n\
* = 'V': compute the left generalized eigenvectors.\n\
*\n\
* JOBVR (input) CHARACTER*1\n\
* = 'N': do not compute the right generalized eigenvectors;\n\
* = 'V': compute the right generalized eigenvectors.\n\
*\n\
* SENSE (input) CHARACTER*1\n\
* Determines which reciprocal condition numbers are computed.\n\
* = 'N': none are computed;\n\
* = 'E': computed for eigenvalues only;\n\
* = 'V': computed for eigenvectors only;\n\
* = 'B': computed for eigenvalues and eigenvectors.\n\
*\n\
* N (input) INTEGER\n\
* The order of the matrices A, B, VL, and VR. N >= 0.\n\
*\n\
* A (input/output) COMPLEX array, dimension (LDA, N)\n\
* On entry, the matrix A in the pair (A,B).\n\
* On exit, A has been overwritten. If JOBVL='V' or JOBVR='V'\n\
* or both, then A contains the first part of the complex Schur\n\
* form of the \"balanced\" versions of the input A and B.\n\
*\n\
* LDA (input) INTEGER\n\
* The leading dimension of A. LDA >= max(1,N).\n\
*\n\
* B (input/output) COMPLEX array, dimension (LDB, N)\n\
* On entry, the matrix B in the pair (A,B).\n\
* On exit, B has been overwritten. If JOBVL='V' or JOBVR='V'\n\
* or both, then B contains the second part of the complex\n\
* Schur form of the \"balanced\" versions of the input A and B.\n\
*\n\
* LDB (input) INTEGER\n\
* The leading dimension of B. LDB >= max(1,N).\n\
*\n\
* ALPHA (output) COMPLEX array, dimension (N)\n\
* BETA (output) COMPLEX array, dimension (N)\n\
* On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the generalized\n\
* eigenvalues.\n\
*\n\
* Note: the quotient ALPHA(j)/BETA(j) ) may easily over- or\n\
* underflow, and BETA(j) may even be zero. Thus, the user\n\
* should avoid naively computing the ratio ALPHA/BETA.\n\
* However, ALPHA will be always less than and usually\n\
* comparable with norm(A) in magnitude, and BETA always less\n\
* than and usually comparable with norm(B).\n\
*\n\
* VL (output) COMPLEX array, dimension (LDVL,N)\n\
* If JOBVL = 'V', the left generalized eigenvectors u(j) are\n\
* stored one after another in the columns of VL, in the same\n\
* order as their eigenvalues.\n\
* Each eigenvector will be scaled so the largest component\n\
* will have abs(real part) + abs(imag. part) = 1.\n\
* Not referenced if JOBVL = 'N'.\n\
*\n\
* LDVL (input) INTEGER\n\
* The leading dimension of the matrix VL. LDVL >= 1, and\n\
* if JOBVL = 'V', LDVL >= N.\n\
*\n\
* VR (output) COMPLEX array, dimension (LDVR,N)\n\
* If JOBVR = 'V', the right generalized eigenvectors v(j) are\n\
* stored one after another in the columns of VR, in the same\n\
* order as their eigenvalues.\n\
* Each eigenvector will be scaled so the largest component\n\
* will have abs(real part) + abs(imag. part) = 1.\n\
* Not referenced if JOBVR = 'N'.\n\
*\n\
* LDVR (input) INTEGER\n\
* The leading dimension of the matrix VR. LDVR >= 1, and\n\
* if JOBVR = 'V', LDVR >= N.\n\
*\n\
* ILO (output) INTEGER\n\
* IHI (output) INTEGER\n\
* ILO and IHI are integer values such that on exit\n\
* A(i,j) = 0 and B(i,j) = 0 if i > j and\n\
* j = 1,...,ILO-1 or i = IHI+1,...,N.\n\
* If BALANC = 'N' or 'S', ILO = 1 and IHI = N.\n\
*\n\
* LSCALE (output) REAL array, dimension (N)\n\
* Details of the permutations and scaling factors applied\n\
* to the left side of A and B. If PL(j) is the index of the\n\
* row interchanged with row j, and DL(j) is the scaling\n\
* factor applied to row j, then\n\
* LSCALE(j) = PL(j) for j = 1,...,ILO-1\n\
* = DL(j) for j = ILO,...,IHI\n\
* = PL(j) for j = IHI+1,...,N.\n\
* The order in which the interchanges are made is N to IHI+1,\n\
* then 1 to ILO-1.\n\
*\n\
* RSCALE (output) REAL array, dimension (N)\n\
* Details of the permutations and scaling factors applied\n\
* to the right side of A and B. If PR(j) is the index of the\n\
* column interchanged with column j, and DR(j) is the scaling\n\
* factor applied to column j, then\n\
* RSCALE(j) = PR(j) for j = 1,...,ILO-1\n\
* = DR(j) for j = ILO,...,IHI\n\
* = PR(j) for j = IHI+1,...,N\n\
* The order in which the interchanges are made is N to IHI+1,\n\
* then 1 to ILO-1.\n\
*\n\
* ABNRM (output) REAL\n\
* The one-norm of the balanced matrix A.\n\
*\n\
* BBNRM (output) REAL\n\
* The one-norm of the balanced matrix B.\n\
*\n\
* RCONDE (output) REAL array, dimension (N)\n\
* If SENSE = 'E' or 'B', the reciprocal condition numbers of\n\
* the eigenvalues, stored in consecutive elements of the array.\n\
* If SENSE = 'N' or 'V', RCONDE is not referenced.\n\
*\n\
* RCONDV (output) REAL array, dimension (N)\n\
* If SENSE = 'V' or 'B', the estimated reciprocal condition\n\
* numbers of the eigenvectors, stored in consecutive elements\n\
* of the array. If the eigenvalues cannot be reordered to\n\
* compute RCONDV(j), RCONDV(j) is set to 0; this can only occur\n\
* when the true value would be very small anyway. \n\
* If SENSE = 'N' or 'E', RCONDV is not referenced.\n\
*\n\
* WORK (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))\n\
* On exit, if INFO = 0, WORK(1) returns the optimal LWORK.\n\
*\n\
* LWORK (input) INTEGER\n\
* The dimension of the array WORK. LWORK >= max(1,2*N).\n\
* If SENSE = 'E', LWORK >= max(1,4*N).\n\
* If SENSE = 'V' or 'B', LWORK >= max(1,2*N*N+2*N).\n\
*\n\
* If LWORK = -1, then a workspace query is assumed; the routine\n\
* only calculates the optimal size of the WORK array, returns\n\
* this value as the first entry of the WORK array, and no error\n\
* message related to LWORK is issued by XERBLA.\n\
*\n\
* RWORK (workspace) REAL array, dimension (lrwork)\n\
* lrwork must be at least max(1,6*N) if BALANC = 'S' or 'B',\n\
* and at least max(1,2*N) otherwise.\n\
* Real workspace.\n\
*\n\
* IWORK (workspace) INTEGER array, dimension (N+2)\n\
* If SENSE = 'E', IWORK is not referenced.\n\
*\n\
* BWORK (workspace) LOGICAL array, dimension (N)\n\
* If SENSE = 'N', BWORK is not referenced.\n\
*\n\
* INFO (output) INTEGER\n\
* = 0: successful exit\n\
* < 0: if INFO = -i, the i-th argument had an illegal value.\n\
* = 1,...,N:\n\
* The QZ iteration failed. No eigenvectors have been\n\
* calculated, but ALPHA(j) and BETA(j) should be correct\n\
* for j=INFO+1,...,N.\n\
* > N: =N+1: other than QZ iteration failed in CHGEQZ.\n\
* =N+2: error return from CTGEVC.\n\
*\n\n\
* Further Details\n\
* ===============\n\
*\n\
* Balancing a matrix pair (A,B) includes, first, permuting rows and\n\
* columns to isolate eigenvalues, second, applying diagonal similarity\n\
* transformation to the rows and columns to make the rows and columns\n\
* as close in norm as possible. The computed reciprocal condition\n\
* numbers correspond to the balanced matrix. Permuting rows and columns\n\
* will not change the condition numbers (in exact arithmetic) but\n\
* diagonal scaling will. For further explanation of balancing, see\n\
* section 4.11.1.2 of LAPACK Users' Guide.\n\
*\n\
* An approximate error bound on the chordal distance between the i-th\n\
* computed generalized eigenvalue w and the corresponding exact\n\
* eigenvalue lambda is\n\
*\n\
* chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)\n\
*\n\
* An approximate error bound for the angle between the i-th computed\n\
* eigenvector VL(i) or VR(i) is given by\n\
*\n\
* EPS * norm(ABNRM, BBNRM) / DIF(i).\n\
*\n\
* For further explanation of the reciprocal condition numbers RCONDE\n\
* and RCONDV, see section 4.11 of LAPACK User's Guide.\n\
*\n"
|