Page 111 - Compact Numerical Methods For Computers
P. 111
100 Compact numerical methods for computers
Algorithm 9. Bauer-Reinsch inversion of a positive definite symmetric matrix (cont.)
for j := (q+2) to m do {STEP 8}
begin
avector[j-i] := avector[j]+t*X[j-q];
end; {loop on j}
end; {loop on i} {STEP 9}
q := q-1; avector[m] := 1.0/s; {STEP 10}
for i := 2 to n do avector[q+i] := X[i]; {STEP 11}
end {if s>0.0} {STEP 12}
else
singmat := true; {s<=0.0 and we cannot proceed}
end; {if (not singmat)}
end, {loop on k}
end; {alg09.pas == Bauer Reinsch inversion brspdm}
This completes the inversion, the original matrix having been overwritten by its inverse.
Example 8.1. The behaviour of the Bauer-Reinsch Gauss-Jordan inversion
Since the result of the algorithm is identical in form to the input, re-entering the
procedure will compute the inverse of the inverse, which should be the same as
the original matrix. The following output was obtained by applying the Bauer-
Reinsch algorithm in this fashion to the Frank and Moler matrices (see appendix
1) on a Data General NOVA having a 23-bit mantissa.
NEW NEW
LOAD ENHBRT LOAD ENHBRT
LOAD ENHMT4 LOAD ENHMT5
RUN RUN
ENHBRG AUG 19 75 ENHBRG AUG 19 75
BAUER REINSCH BAUER REINSCH
ORDER? 5 ORDER? 5
FRANK MATRIX MOLER MATRIX
1 1
1 2 -1 2
1 2 3 -1 0 3
1 2 3 4 -1 0 1 4
1 2 3 4 5 -1 0 1 2 5
INVERSE INVERSE
ROW 1 ROW 1
2 86
ROW 2 ROW 2
-1 2 43 22
ROW 3 ROW 3
0 -1 2 22 11 6
ROW 4 ROW 4
-1 2 12 6 3 2
ROW 5 ROW 5
0 0 0 -1 1 8 4 2 1 1