1DGGBAL(1) LAPACK routine (version 3.1) DGGBAL(1)
2
3
4
6 DGGBAL - a pair of general real matrices (A,B)
7
9 SUBROUTINE DGGBAL( 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 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), LSCALE( * ),
17 RSCALE( * ), WORK( * )
18
20 DGGBAL 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.
26
27 Balancing may reduce the 1-norm of the matrices, and improve the accu‐
28 racy of the computed eigenvalues and/or eigenvectors in the generalized
29 eigenvalue problem A*x = lambda*B*x.
30
31
33 JOB (input) CHARACTER*1
34 Specifies the operations to be performed on A and B:
35 = 'N': none: simply set ILO = 1, IHI = N, LSCALE(I) = 1.0 and
36 RSCALE(I) = 1.0 for i = 1,...,N. = 'P': permute only;
37 = 'S': scale only;
38 = 'B': both permute and scale.
39
40 N (input) INTEGER
41 The order of the matrices A and B. N >= 0.
42
43 A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
44 On entry, the input matrix A. On exit, A is overwritten by
45 the balanced matrix. If JOB = 'N', A is not referenced.
46
47 LDA (input) INTEGER
48 The leading dimension of the array A. LDA >= max(1,N).
49
50 B (input/output) DOUBLE PRECISION array, dimension (LDB,N)
51 On entry, the input matrix B. On exit, B is overwritten by
52 the balanced matrix. If JOB = 'N', B is not referenced.
53
54 LDB (input) INTEGER
55 The leading dimension of the array B. LDB >= max(1,N).
56
57 ILO (output) INTEGER
58 IHI (output) INTEGER ILO and IHI are set to integers such
59 that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j =
60 1,...,ILO-1 or i = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1
61 and IHI = N.
62
63 LSCALE (output) DOUBLE PRECISION array, dimension (N)
64 Details of the permutations and scaling factors applied to the
65 left side of A and B. If P(j) is the index of the row inter‐
66 changed with row j, and D(j) is the scaling factor applied to
67 row j, then LSCALE(j) = P(j) for J = 1,...,ILO-1 = D(j)
68 for J = ILO,...,IHI = P(j) for J = IHI+1,...,N. The order
69 in which the interchanges are made is N to IHI+1, then 1 to
70 ILO-1.
71
72 RSCALE (output) DOUBLE PRECISION array, dimension (N)
73 Details of the permutations and scaling factors applied to the
74 right side of A and B. If P(j) is the index of the column
75 interchanged with column j, and D(j) is the scaling factor
76 applied to column j, then LSCALE(j) = P(j) for J =
77 1,...,ILO-1 = D(j) for J = ILO,...,IHI = P(j) for J =
78 IHI+1,...,N. The order in which the interchanges are made is N
79 to IHI+1, then 1 to ILO-1.
80
81 WORK (workspace) REAL array, dimension (lwork)
82 lwork must be at least max(1,6*N) when JOB = 'S' or 'B', and at
83 least 1 when JOB = 'N' or 'P'.
84
85 INFO (output) INTEGER
86 = 0: successful exit
87 < 0: if INFO = -i, the i-th argument had an illegal value.
88
90 See R.C. WARD, Balancing the generalized eigenvalue problem,
91 SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
92
93
94
95
96 LAPACK routine (version 3.1) November 2006 DGGBAL(1)