1DGEBAL(1) LAPACK routine (version 3.2) DGEBAL(1)
2
3
4
6 DGEBAL - balances a general real matrix A
7
9 SUBROUTINE DGEBAL( JOB, N, A, LDA, ILO, IHI, SCALE, INFO )
10
11 CHARACTER JOB
12
13 INTEGER IHI, ILO, INFO, LDA, N
14
15 DOUBLE PRECISION A( LDA, * ), SCALE( * )
16
18 DGEBAL balances a general real matrix A. This involves, first, permut‐
19 ing A by a similarity transformation to isolate eigenvalues in the
20 first 1 to ILO-1 and last IHI+1 to N elements on the diagonal; and sec‐
21 ond, applying a diagonal similarity transformation to rows and columns
22 ILO to IHI to make the rows and columns as close in norm as possible.
23 Both steps are optional.
24 Balancing may reduce the 1-norm of the matrix, and improve the accuracy
25 of the computed eigenvalues and/or eigenvectors.
26
28 JOB (input) CHARACTER*1
29 Specifies the operations to be performed on A:
30 = 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0 for
31 i = 1,...,N; = 'P': permute only;
32 = 'S': scale only;
33 = 'B': both permute and scale.
34
35 N (input) INTEGER
36 The order of the matrix A. N >= 0.
37
38 A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
39 On entry, the input matrix A. On exit, A is overwritten by
40 the balanced matrix. If JOB = 'N', A is not referenced. See
41 Further Details. LDA (input) INTEGER The leading dimension
42 of the array A. LDA >= max(1,N).
43
44 ILO (output) INTEGER
45 IHI (output) INTEGER ILO and IHI are set to integers such
46 that on exit A(i,j) = 0 if i > j and j = 1,...,ILO-1 or I =
47 IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1 and IHI = N.
48
49 SCALE (output) DOUBLE PRECISION array, dimension (N)
50 Details of the permutations and scaling factors applied to A.
51 If P(j) is the index of the row and column interchanged with
52 row and column j and D(j) is the scaling factor applied to row
53 and column j, then SCALE(j) = P(j) for j = 1,...,ILO-1 =
54 D(j) for j = ILO,...,IHI = P(j) for j = IHI+1,...,N. The
55 order in which the interchanges are made is N to IHI+1, then 1
56 to ILO-1.
57
58 INFO (output) INTEGER
59 = 0: successful exit.
60 < 0: if INFO = -i, the i-th argument had an illegal value.
61
63 The permutations consist of row and column interchanges which put the
64 matrix in the form
65 ( T1 X Y )
66 P A P = ( 0 B Z )
67 ( 0 0 T2 )
68 where T1 and T2 are upper triangular matrices whose eigenvalues lie
69 along the diagonal. The column indices ILO and IHI mark the starting
70 and ending columns of the submatrix B. Balancing consists of applying a
71 diagonal similarity transformation inv(D) * B * D to make the 1-norms
72 of each row of B and its corresponding column nearly equal. The output
73 matrix is
74 ( T1 X*D Y )
75 ( 0 inv(D)*B*D inv(D)*Z ).
76 ( 0 0 T2 )
77 Information about the permutations P and the diagonal matrix D is
78 returned in the vector SCALE.
79 This subroutine is based on the EISPACK routine BALANC.
80 Modified by Tzu-Yi Chen, Computer Science Division, University of
81 California at Berkeley, USA
82
83
84
85 LAPACK routine (version 3.2) November 2008 DGEBAL(1)