Professional Documents
Culture Documents
a11 · · · a1n b1
· · ·
Ax = b, A= · · , b= ·
· · ·
an1 · · · ann bn
will be presented. Here A is a given n × n matrix, and b is a given vector.
We assume in addition that A and b are real, although this restriction is
inessential in most of the methods. In contrast to the iterative methods
(Chapter 8), the direct methods discussed here produce the solution in
finitely many steps, assuming computations without roundoff errors.
This problem is closely related to that of computing the inverse A−1 of
the matrix A provided this inverse exists. For if A−1 is known, the solution
x of Ax = b can be obtained by matrix vector multiplication, x = A−1 b.
Conversely, the ith column āi of A−1 = [ā1 , . . . , ān ] is the solution of the
linear system Ax = ei , where ei = (0, . . . , 0, 1, 0, . . . 0)T is the ith unit
vector.
A general introduction to numerical linear algebra is given in Golub
and van Loan (1983) and Stewart (1973). algol programs are found in
Wilkinson and Reinsch (1971), fortran programs in Dongarra, Bunch,
Moler, and Stewart (1979) (linpack), and in Andersen et al. (1992) (la-
pack).
(4.1.1) Ax = b ,
4.1 Gaussian Elimination. The Triangular Decomposition of a Matrix 191
which corresponds to the full system given in (4.1.1). The first step of the
Gaussian elimination process leads to a matrix (A , b ) of the form
a a12 ... a1n b1
11
0 a22 ... a2n b2
(4.1.2) (A , b ) = .. .. .. .. ,
. . . .
0 an2 . . . ann bn
and this step can be described formally as follows:
(4.1.3)
(a) Determine an element ar1 = 0 and proceed with (b); if no such r exists,
A is singular; set (A , b ) := (A, b); stop.
(b) Interchange rows r and 1 of (A, b). The result is the matrix (Ā, b̄).
(c) For i = 2, 3, . . . , n, subtract the multiple
of row 1 from row i of the matrix (Ā, b̄). The desired matrix (A , b ) is
obtained as the result.
The transition (A, b) → (Ā, b̄) → (A , b ) can be described by using
matrix multiplications:
(4.1.4) (Ā, b̄) = P1 (A, b), (A , b ) = G1 (Ā, b̄) = G1 P1 (A, b),
is made; that is, among all candidate elements the one of largest absolute
value is selected. (It is assumed in making this choice however — see Sec-
tion 4.5 — that the matrix A is “equilibrated”, that is, that the orders of
magnitudes of the elements of A are “roughly equal”.) This sort of pivot
selection is called partial pivot selection (or partial pivoting), in contrast
to complete pivot selection (or complete pivoting), in which the search for
4.1 Gaussian Elimination. The Triangular Decomposition of a Matrix 193
a pivot is not restricted to the first column; that is, (a) and (b) in (4.1.3)
are replaced by (a ) and (b ):
(a ) Determine r and s so that
ars = max aij
i,j
and continue with (b ) if ars = 0. Otherwise A is singular; set
(A , b ) := (A, b); stop.
(b ) Interchange rows 1 and r of (A, b), as well as columns 1 and s. Let the
resulting matrix be (Ā, b̄).
After the first elimination step, the resulting matrix has the form (4.1.2):
a11 aT b1
(A , b ) =
0 Ã b̃
with an (n − 1)-row matrix Ã. The next elimination step consists simply
of applying the process described in (4.1.3) for (A, b) to the smaller matrix
(Ã, b̃). Carrying on in this fashion, a sequence of matrices
(A, b) := (A(0) , b(0) ) → (A(1) , b(1) ) → · · · → (A(n−1) , b(n−1) ) =: (R, c),
is obtained which begins with the given matrix (A, b) (4.1.1) and ends with
the desired matrix (R, c). In this sequence the jth intermediate matrix
(A(j) , b(j) ) has the form
(4.1.6)
∗ ··· ∗ ∗ ··· ∗ ∗
. . .. .. .. ..
. . . . .
0 ∗ ∗ ··· ∗ ∗
A
(j)
A
(j)
b
(j)
11 12 1
(A(j) , b(j) ) = =
0 ··· 0 ∗ ··· ∗ ∗
(j) (j)
0 A22 b2
. ..
. .. .. ..
. . . . .
0 ··· 0 ∗ ··· ∗ ∗
(j)
with a j-row upper triangular matrix A11 . (A(j) , b(j) ) is obtained from
(A(j−1) , b(j−1) ) by applying (4.1.3) on the (n − j + 1) × (n − j + 2) matrix
(j−1) (j−1) (j) (j) (j)
(A22 , b2 ). The elements of A11 , A12 , b1 do not change from this
step on; hence they agree with the corresponding elements of (R, c). As in
the first step, (4.1.4) and (4.1.5), the ensuing steps can be described using
matrix multiplication. As can be readily seen
In the jth elimination step (A(j−1) , b(j−1) ) → (A(j) , b(j) ) the elements below
the diagonal in the jth column are annihilated. In the implementation of
this algorithm on a computer, the locations which were occupied by these
elements can now be used for the storage of the important quantities lij ,
i ≥ j + 1, of Gj ; that is, we work with a matrix of the form
r11 r12 ··· r1j r1,j+1 ··· r1n c1
.. .. ..
λ21 r22 ··· r2j
. . .
.. .. .. ..
λ31 λ32 . . . .
. ..
T (j) =
.
. . rjj rj,j+1 ··· rj,n cj
.
. .. (j) (j) (j)
. . λj+1,j aj+1,j+1 ··· aj+1,n bj+1
.
. .. .. .. .. ..
. . . . . .
(j) (j) (j)
λn1 λn2 ··· λn1 an,j+1 ··· an,n bn
Here the subdiagonal elements λk+1,k , λk+2,k , . . ., λnk of the kth column
are a certain permutation of the elements lk+1,k , . . ., ln,k in Gk (4.1.8).
Based on this arrangement, the jth step T (j−1) → T (j) , j = 1, 2, . . . ,
n − 1, can be described as follows (for simplicity the elements of T (j−1) are
denoted by tik , and those of T (j) by tik , 1 ≤ i ≤ n, 1 ≤ k ≤ n + 1):
(a) Partial pivot selection: Determine r so that
trj = maxtij .
i≥j
which are contained in the final matrix T (n−1) = (tik ), provide a triangular
decomposition of the matrix P A:
(4.1.9) LR = P A.
since in all of the minor steps (b) nothing is interchanged. Now, because of
(4.1.7),
R = Gn−1 · · · G1 A,
therefore
(4.1.10) G−1 −1
1 · · · Gn−1 R = A.
Since
196 4 Systems of Linear Equations
1 0
..
.
1
G−1
j =
lj+1,j 1
..
.
..
.
0 ln,j 1
it is easily verified that
1 0
l21 1
G−1 −1 −1 = L.
1 G2 · · · Gn−1 = .. .. ..
. . .
ln1 · · · ln,n−1 1
Example.
3 1 6 x1 2
2 1 3 x2 = 7 ,
1 1 1 x3 4
3∗ 1 6 2 3 1 6 2 3 1 6 2
2 1 17 1 2 10
2 1 3 7→ 3 3
−1 3 → 3 3
−1 3 .
1 2∗ 10 2 1 ∗
1 1 1 4 3 3
−1 3 3 2
− 12 4
Its solution is
x3 = −8,
x2 = 32 ( 10
3
+ x3 ) = −7,
x1 = 13 (2 − x2 − 6x3 ) = 19.
Further
1 0 0 3 1 6
P = 0 0 1 , PA = 1 1 1 ,
0 1 0 2 1 3
and the matrix P A has the triangular decomposition P A = LR with
1 0 0 3 1 6
L= 1
3
1 0, R = 0 2
3
−1 .
2 1
3 2
1 0 0 − 12
4.1 Gaussian Elimination. The Triangular Decomposition of a Matrix 197
Lu = P b, Rx = u
rik , i ≤ k,
lik , i≥k (lii = 1);
that is, for all i, k = 1, 2, . . . , n
min(i,k)
(4.1.11) aik = lij rjk (lii = 1).
j=1
The order in which the lij , rjk are to be computed remains open. The
following versions are common:
In the Crout method the n × n matrix A = LR is partiotioned as
follows:
1
3
5
7
2 4 6 8 9
198 4 Systems of Linear Equations
"
1
2. ai1 = lij rj1 , li1 := ai1 /r11 , i = 2, 3, . . . , n,
j=1
"
2
3. a2i = l2j rji , r2i := a2i − l21 r1i , i = 2, 3, . . . , n, etc.
j=1
1
2 3
4 5
6 7
8 9
each scalar product as a whole. For these organizational reasons, direct tri-
angular decomposition must be preferred if one chooses to accumulate the
scalar products in double-precision arithmetic in order to reduce round-
off errors (without storing double-precision intermediate results). Further,
these methods of triangular decomposition require about n3 /3 operations
(1 operation = 1 multiplication + 1 addition). Thus, they also offer a simple
way of evaluating the determinant of a matrix A: From (4.1.9) it follows,
since det(P ) = ±1, det(L) = 1, that
Up to its sign, det(A) is exactly the product of the pivot elements. (It
should be noted that the direct evaluation of the formula
n
det(A) = sign(µ1 , . . . , µn )a1µ1 a2µ2 · · · anµn
µ1 ,...,µn =1
µi =µk für i=k
requires n! n3 /3 operations.)
In the case that P = I, the pivot elements rii are representable as
quotients of the determinants of the principal submatrices of A. If, in the
representation LR = A, the matrices are partitioned as follows:
L11 0 R11 R12 A11 A21
= ,
L21 L22 0 R22 A12 A22
∗ ··· ∗ 0
... . . . ..
.
.. ..
∗ . .
A=
.. ..
, aij = 0 for |i − j| ≥ m,
. . ∗ 1
.. .. ..
. . . m
0 ∗ ··· ∗
200 4 Systems of Linear Equations
m
and in each column of L there are at most m elements different from zero. In
contrast, the inverses A−1 of band matrices are usually filled with nonzero
entries.
Thus, if m n, using the triangular decomposition of A to solve
Ax = b results in a considerable saving in computation and storage over
using A−1 . Additional savings are possible by making use of the symmetry
of A if A is a positive definite matrix (see Sections 4.3 and 4.A).
(4.2.1) LRāi = P ei ,
where ei is the ith coordinate vector. If the simple structure of the right-
hand side of (4.2.1), P ei , is taken into account, then the n equation systems
(4.2.1) (i = 1, . . . , n) can be solved in about 23 n3 operations. Adding
the cost of producing the decomposition gives a total of n3 operations
to determaine A−1 . The Gauss-Jordan method requires this amount of
work, too, and offers advantages only of an organizational nature. The
Gauss-Jordan method is obtained if one attempts to invert the mapping
x → Ax = y, x ∈ IRn , y ∈ IRn , determined by A in a systematic manner.
Consider the system Ax = y: