Graphics Programs Reference
In-Depth Information
Therefore,
⎡
⎣
⎤
⎦
2
00
L
=
−
110
1
−
31
The result can easilybe verifiedbyperforming the multiplication
LL
T
.
EXAMPLE 2.7
Solve
AX
|
|
=
B
with Doolittle's decomposition and compute
A
, where
⎡
⎣
⎤
⎦
⎡
⎣
⎤
⎦
3
−
1
4
6
4
32
7
−
A
=
−
2 0 5
72
B
=
−
2
−
5
Solution
In the programbelow the coefficient matrix
A
is first decomposedbycalling
LUdec
. Then
LUsol
is used to compute the solution one vectorat a time.
% Example 2.7 (Doolittle's decomposition)
A=[3-14;-205;72-2];
B=[6-4;32;7-5];
A = LUdec(A);
det = prod(diag(A))
fori=1:size(B,2)
X(:,i) = LUsol(A,B(:,i));
end
X
Here are the results:
>> det =
-77
X=
1.0000
-1.0000
1.0000
1.0000
1.0000
0.0000
EXAMPLE 2.8
Test the function
choleski
by decomposing
⎡
⎣
⎤
⎦
.
−
.
.
.
1
44
0
36
5
52
0
00
−
0
.
36
10
.
33
−
7
.
78
0
.
00
A
=
5
.
52
−
7
.
78
28
.
40
9
.
00
0
.
00
0
.
00
9
.
00 61
.
00
Search WWH ::
Custom Search