Subroutine */
| 265 | } /* cgebak_ */ |
| 266 | |
| 267 | /* Subroutine */ int cgebal_(char *job, integer *n, complex *a, integer *lda, |
| 268 | integer *ilo, integer *ihi, real *scale, integer *info) |
| 269 | { |
| 270 | /* System generated locals */ |
| 271 | integer a_dim1, a_offset, i__1, i__2, i__3; |
| 272 | real r__1, r__2; |
| 273 | |
| 274 | /* Local variables */ |
| 275 | static real c__, f, g; |
| 276 | static integer i__, j, k, l, m; |
| 277 | static real r__, s, ca, ra; |
| 278 | static integer ica, ira, iexc; |
| 279 | extern logical lsame_(char *, char *); |
| 280 | extern /* Subroutine */ int cswap_(integer *, complex *, integer *, |
| 281 | complex *, integer *); |
| 282 | static real sfmin1, sfmin2, sfmax1, sfmax2; |
| 283 | extern integer icamax_(integer *, complex *, integer *); |
| 284 | extern doublereal slamch_(char *); |
| 285 | extern /* Subroutine */ int csscal_(integer *, real *, complex *, integer |
| 286 | *), xerbla_(char *, integer *); |
| 287 | extern logical sisnan_(real *); |
| 288 | static logical noconv; |
| 289 | |
| 290 | |
| 291 | /* |
| 292 | -- LAPACK routine (version 3.2.2) -- |
| 293 | -- LAPACK is a software package provided by Univ. of Tennessee, -- |
| 294 | -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
| 295 | June 2010 |
| 296 | |
| 297 | |
| 298 | Purpose |
| 299 | ======= |
| 300 | |
| 301 | CGEBAL balances a general complex matrix A. This involves, first, |
| 302 | permuting A by a similarity transformation to isolate eigenvalues |
| 303 | in the first 1 to ILO-1 and last IHI+1 to N elements on the |
| 304 | diagonal; and second, applying a diagonal similarity transformation |
| 305 | to rows and columns ILO to IHI to make the rows and columns as |
| 306 | close in norm as possible. Both steps are optional. |
| 307 | |
| 308 | Balancing may reduce the 1-norm of the matrix, and improve the |
| 309 | accuracy of the computed eigenvalues and/or eigenvectors. |
| 310 | |
| 311 | Arguments |
| 312 | ========= |
| 313 | |
| 314 | JOB (input) CHARACTER*1 |
| 315 | Specifies the operations to be performed on A: |
| 316 | = 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0 |
| 317 | for i = 1,...,N; |
| 318 | = 'P': permute only; |
| 319 | = 'S': scale only; |
| 320 | = 'B': both permute and scale. |
| 321 | |
| 322 | N (input) INTEGER |
| 323 | The order of the matrix A. N >= 0. |
| 324 |