Title: Chapter 11 Gaussian Elimination (I)
1Chapter 11 Gaussian Elimination (I)
Reference book David Kincaid, Numerical Analysis
2OutLine
- Basic operation of matrix- representation-
three elementary matrices - Example of Gaussian Elimination (GE)
- Formal description of GE
- MATLAB usage
3Matrix notation in MATLAB
6
-2
2
4
12
-8
6
10
3
-13
9
3
-6
4
1
-18
4Matrix-vector product
Inner-product based
6
-2
2
4
x1
6 x1 (-2) x2 2 x3 4 x4
12
-8
6
10
x2
12 x1 (-8) x2 6 x3 10 x4
3
-13
9
3
x3
3 x1 (-13) x2 9 x3 3 x4
-6
4
1
-18
x4
(-6) x1 4 x2 1 x3 (-18) x4
outer-product based
6
-2
2
4
x1
6
-2
2
4
12
-8
6
10
x2
12
-8
6
10
x1
x2
x3
x4
3
-13
9
3
x3
3
-13
9
3
-6
4
1
-18
x4
-6
4
1
-18
5Matrix-vector product MATLAB implementation
matvec.m
Inner-product based
outer-product based
Question which one is better
6Column-major nature in MATLAB
physical index 1D
6
1
2
12
3
3
Question how does column-major affect
inner-product based matrix-vector product and
outer-product based matrix-vector product?
-6
4
-2
Logical index 2D
5
-8
6
6
-2
2
4
-13
7
12
-8
6
10
4
8
3
-13
9
3
2
9
-6
4
1
-18
6
10
9
11
1
12
13
4
10
14
3
15
-18
16
7Matrix representation outer-product
is outer-product representation
where
8Elementary matrix 1
(1) The interchange of two rows in A
Define permutation matrix
How to explain?
Question 1 why
Question 2 how to easily obtain
9Concatenation of permutation matrices
such that
such that
Question
implies
Direct calculation
10Elementary matrix 2
(2) Multiplying one row by a nonzero constant
Define scaling matrix
How to explain?
since
11Elementary matrix 3
(3) Adding to one row a multiple of another
Define GE (Gaussian Elimination) matrix
How to explain?
outer-product representation
12Use MATLAB notation
13Concatenation of GE matrices
such that
Suppose
such that
Question
14OutLine
- Basic operation of matrix
- Example of Gaussian Elimination (GE)- forward
elimination to upper triangle form- backward
substitution - Formal description of GE
- MATLAB usage
156
-2
2
4
x1
12
12
-8
6
10
x2
34
3
-13
9
3
x3
27
-6
4
1
-18
x4
-38
12
-8
6
10
34
6
-2
2
4
x1
12
0
-4
2
2
x2
10
6
-2
2
4
12
3
-13
9
3
x3
27
-6
4
1
-18
x4
-38
0
-4
2
2
10
3
-13
9
3
27
6
-2
2
4
x1
12
0
-4
2
2
x2
10
6
-2
2
4
12
0
-12
8
1
x3
21
-6
4
1
-18
x4
-38
0
-12
8
1
21
16-38
-6
4
1
-18
6
-2
2
4
x1
12
0
-4
2
2
x2
10
6
-2
2
4
12
0
-12
8
1
x3
21
0
2
3
-14
x4
-26
0
2
3
-14
-26
6
-2
2
4
x1
12
First row does not change thereafter
0
-4
2
2
x2
10
0
-12
8
1
x3
21
0
2
3
-14
x4
-26
-12
8
1
21
6
-2
2
4
x1
12
0
-4
2
2
x2
10
-4
2
2
10
0
0
2
-5
x3
-9
0
2
3
-14
x4
-26
0
2
-5
-9
172
3
-14
-26
6
-2
2
4
x1
12
0
-4
2
2
x2
10
-4
2
2
10
0
0
2
-5
x3
-9
0
0
4
-13
x4
-21
0
4
-13
-21
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
0
2
-5
x3
-9
0
0
4
-13
x4
-21
4
-13
-21
6
-2
2
4
x1
12
0
-4
2
2
x2
10
2
-5
-9
0
0
2
-5
x3
-9
0
-3
-3
0
0
0
-3
x4
-3
18Backward substitution inner-product-based
6
-2
2
4
x1
12
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
-4
2
2
x2
10
0
0
2
-5
x3
-9
0
0
2
-5
x3
-9
0
0
0
-3
x4
-3
x4
6
-2
2
4
x1
12
6
-2
2
4
x1
12
x2
0
-4
2
2
x2
10
x3
x3
x4
x4
19Backward substitution outer-product-based
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
0
2
-5
x3
-9
0
0
0
-3
x4
-3
6
-2
2
4
x1
12
8
0
-4
2
2
x2
10
x4
8
0
0
2
-5
x3
-9
-4
6
-2
2
x1
8
12
x3
8
0
-4
2
x2
12
x2
6
-2
x1
12
6
20OutLine
- Basic operation of matrix
- Example of Gaussian Elimination (GE)
- Formal description of GE- component-wise and
column-wise representation- recursive structure - MATLAB usage
216
-2
2
4
x1
12
12
-8
6
10
x2
34
3
-13
9
3
x3
27
-6
4
1
-18
x4
-38
6
-2
2
4
x1
12
0
-4
2
2
x2
10
3
-13
9
3
x3
27
-6
4
1
-18
x4
-38
6
-2
2
4
x1
12
6
-2
2
4
x1
12
12
-8
6
10
x2
34
12
-8
6
10
x2
34
0
-12
8
1
x3
21
3
-13
9
3
x3
27
-6
4
1
-18
x4
-38
0
2
3
-14
x4
-26
22Eliminate first column component-wise
6
-2
2
4
x1
12
6
-2
2
4
x1
12
12
-8
6
10
x2
34
0
-4
2
2
x2
10
3
-13
9
3
x3
27
0
-12
8
1
x3
21
-6
4
1
-18
x4
-38
0
2
3
-14
x4
-26
where
Exercise check
by MATLAB
23Eliminate first column column-wise
define
and
then
Exercise check
by MATLAB
Notation
24Eliminate second column component-wise
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
-12
8
1
x3
21
0
2
3
-14
x4
-26
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
0
2
-5
x3
-9
0
2
3
-14
x4
-26
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
0
2
-5
x3
-9
0
0
4
-13
x4
-21
25Eliminate second column column-wise
define
Exercise check
, why? Give a simple explanation.
Exercise check
Notation
26Eliminate third column component-wise
6
-2
2
4
x1
12
0
-4
2
2
x2
10
0
0
2
-5
x3
-9
0
0
4
-13
x4
-21
6
-2
2
4
x1
12
0
-4
2
2
x2
10
define
0
0
2
-5
x3
-9
0
0
0
-3
x4
-3
then
27LU-decomposition
Notation
LU-decomposition
Exercise check
Question Do you have any effective method to
write down matrix
Question why dont we care about right hand side
vector
28Problems about LU-decomposition
Question 1 what condition does LU-decomposition
fail?
Question 2 does any invertible matrix has
LU-decomposition?
Question 3 How to measure goodness of
LU-decomposition?
Question 4 what is order of performance of
LU-decomposition (operation count)?
Question 5 How to parallelize LU-decomposition?
Question 6 How to implement LU-decomposition
with help of GPU?
29OutLine
- Basic operation of matrix
- Example of Gaussian Elimination (GE)
- Formal description of GE
- MATLAB usage- website resource- help
command- M-file
30MATLAB website
http//www.mathworks.com/access/helpdesk/help/tech
doc/matlab.html
31MATLAB create matrix
32MATLAB LU-factorization
33Start MATLAB 2008
34Command help documentation
! in C
35Loop in MATLAB
36Decision-making in MATLAB
37IO in MATLAB
38LU-factorization in MATLAB
39M-file in MATLAB
matvec.m
Description of function matvec, write
specificaiton of input parameter
Consistency check
Inner-product based
40Move to working directory
working directory
M-file
41Execute M-file
Construct matrix
Execute M-file, like function call in C-language
42Exercise forward / backward substitution
Forward substitution
since
backward substitution
since
Write MATLAB code to do forward substitution and
backward substitution
43Exercise LU-decomposition
LU-decomposition
You should find recursive structure of the
decomposition