1SGGBAL(1) LAPACK routine (version 3.2) SGGBAL(1)
2
3
4
6 SGGBAL - balances a pair of general real matrices (A,B)
7
9 SUBROUTINE SGGBAL( JOB, N, A, LDA, B, LDB, ILO, IHI, LSCALE, RSCALE,
10 WORK, INFO )
11
12 CHARACTER JOB
13
14 INTEGER IHI, ILO, INFO, LDA, LDB, N
15
16 REAL A( LDA, * ), B( LDB, * ), LSCALE( * ), RSCALE( * ),
17 WORK( * )
18
20 SGGBAL balances a pair of general real matrices (A,B). This involves,
21 first, permuting A and B by similarity transformations to isolate ei‐
22 genvalues in the first 1 to ILO$-$1 and last IHI+1 to N elements on the
23 diagonal; and second, applying a diagonal similarity transformation to
24 rows and columns ILO to IHI to make the rows and columns as close in
25 norm as possible. Both steps are optional. Balancing may reduce the
26 1-norm of the matrices, and improve the accuracy of the computed eigen‐
27 values and/or eigenvectors in the generalized eigenvalue problem A*x =
28 lambda*B*x.
29
31 JOB (input) CHARACTER*1
32 Specifies the operations to be performed on A and B:
33 = 'N': none: simply set ILO = 1, IHI = N, LSCALE(I) = 1.0 and
34 RSCALE(I) = 1.0 for i = 1,...,N. = 'P': permute only;
35 = 'S': scale only;
36 = 'B': both permute and scale.
37
38 N (input) INTEGER
39 The order of the matrices A and B. N >= 0.
40
41 A (input/output) REAL array, dimension (LDA,N)
42 On entry, the input matrix A. On exit, A is overwritten by
43 the balanced matrix. If JOB = 'N', A is not referenced.
44
45 LDA (input) INTEGER
46 The leading dimension of the array A. LDA >= max(1,N).
47
48 B (input/output) REAL array, dimension (LDB,N)
49 On entry, the input matrix B. On exit, B is overwritten by
50 the balanced matrix. If JOB = 'N', B is not referenced.
51
52 LDB (input) INTEGER
53 The leading dimension of the array B. LDB >= max(1,N).
54
55 ILO (output) INTEGER
56 IHI (output) INTEGER ILO and IHI are set to integers such
57 that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j =
58 1,...,ILO-1 or i = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1
59 and IHI = N.
60
61 LSCALE (output) REAL array, dimension (N)
62 Details of the permutations and scaling factors applied to the
63 left side of A and B. If P(j) is the index of the row inter‐
64 changed with row j, and D(j) is the scaling factor applied to
65 row j, then LSCALE(j) = P(j) for J = 1,...,ILO-1 = D(j)
66 for J = ILO,...,IHI = P(j) for J = IHI+1,...,N. The order
67 in which the interchanges are made is N to IHI+1, then 1 to
68 ILO-1.
69
70 RSCALE (output) REAL array, dimension (N)
71 Details of the permutations and scaling factors applied to the
72 right side of A and B. If P(j) is the index of the column
73 interchanged with column j, and D(j) is the scaling factor
74 applied to column j, then LSCALE(j) = P(j) for J =
75 1,...,ILO-1 = D(j) for J = ILO,...,IHI = P(j) for J =
76 IHI+1,...,N. The order in which the interchanges are made is N
77 to IHI+1, then 1 to ILO-1.
78
79 WORK (workspace) REAL array, dimension (lwork)
80 lwork must be at least max(1,6*N) when JOB = 'S' or 'B', and at
81 least 1 when JOB = 'N' or 'P'.
82
83 INFO (output) INTEGER
84 = 0: successful exit
85 < 0: if INFO = -i, the i-th argument had an illegal value.
86
88 See R.C. WARD, Balancing the generalized eigenvalue problem,
89 SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
90
91
92
93 LAPACK routine (version 3.2) November 2008 SGGBAL(1)