2.4 Partitioned Matrices In real world problems, systems can have huge numbers of equations and un- knowns. Thousands of equations and hundreds of thousands of variables are not uncommon. Standard computation techniques are inefficient in such cases, so we need to develop techniques which exploit the internal structure of the matrices. In most cases, the matrices of interest have lots of zeros: they are sparse . For example, consider a fluid dynamics problem such as computing equilibrum tmperatures. It is solved by placing a fine grid over a region of interest and ana- lyzing the situation at each grid point. The data at each point only effects the data at neighboring points, and we know the data at the edges of the grid. In the grid 30 o x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x 15 10 o 0 o x 16 x 17 x 18 x 19 x 20 x 21 x 22 x 23 x 24 x 25 20 o there is an equation for each of the 25 internal grid points; thus 25 equations in 25 unknowns, but each equation has at most 5 variables. A sparse coefficient matrix results: 1
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • • 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 • • • Partitioning a matrix: Splitting it up into smaller matrices. Consider 2 1 − 3 5 7 0 1 4 − 1 2 A = 3 − 2 1 1 5 0 4 0 1 − 3 Example 1: One way to partition A : 2 1 − 3 5 7 0 1 4 − 1 2 3 − 2 1 1 5 0 4 0 1 − 3 which is recorded � 2 1 � − 3 � � 5 7 A 11 = , A 12 = 0 1 4 − 1 2 � 3 − 2 � 1 1 � � 5 A 21 = , A 22 = 0 4 0 1 − 3
3 Example 2: Another way to partition A : 2 1 − 3 5 7 0 1 4 − 1 2 3 − 2 1 1 5 0 4 0 1 − 3 Example 3: Another way to partition A : 2 1 − 3 5 7 0 1 4 − 1 2 3 − 2 1 1 5 0 4 0 1 − 3 Example 4: Another way to partition A : 2 1 − 3 5 7 0 1 4 − 1 2 3 − 2 1 1 5 0 4 0 1 − 3 Operations with Partitioned Matrices Addition: if 2 m × n matrices are partitioned in the same way, add corresponding blocks. Scalar Multiplication: multiply each block by the scalar. Matrix Multiplication: to multiply two partitioned matrices A and B , the column partition of A must match the row partition of B (the partition is conformable .) Use the usual row-column rule considering each block as a single entry. Example 5 – Partition 1: 2 1 − 3 5 7 � A 11 A 12 � 0 1 4 − 1 2 A = = 3 − 2 1 1 5 A 21 A 22 0 4 0 1 − 3
4 1 − 2 1 � B 1 − 1 2 0 � B = 5 0 − 1 = B 2 6 3 − 4 0 3 − 1 16 − 38 − 8 � A 11 B 1 + A 12 B 2 � 13 − 1 2 AB = = A 21 B 1 + A 22 B 2 16 − 28 3 2 14 − 7 Example 5 – Partition 2: 2 1 − 3 5 7 0 1 4 − 1 2 A = 3 − 2 1 1 5 0 4 0 1 − 3 1 − 2 1 − 1 2 0 � � B = B 1 B 2 B 3 5 0 − 1 = 6 3 − 4 0 3 − 1 � � AB = AB 1 AB 2 AB 3 This is the definition of matrix multiplication: the columns of AB are A multiplied by the columns of B . Example 5 – Partition 3: 2 1 − 3 5 7 A 1 0 1 4 − 1 2 A 2 A = = A 3 3 − 2 1 1 5 A 4 0 4 0 1 − 3
5 1 − 2 1 − 1 2 0 B = 5 0 − 1 6 3 − 4 0 3 − 1 A 1 B A 2 B AB = A 3 B A 4 B Another understanding of matrix multiplication: the rows of AB are the rows of A multiplied by B . Example 5 – Partition 4: 2 1 − 3 5 7 0 1 4 − 1 2 � � A = A 1 A 2 A 3 A 4 A 5 = 3 − 2 1 1 5 0 4 0 1 − 3 1 − 2 1 B 1 − 1 2 0 B 2 B = 5 0 − 1 = B 3 6 3 − 4 B 4 B 5 0 3 − 1 AB = A 1 B 1 + A 2 B 2 + A 3 B 3 + A 4 B 4 + A 5 B 5 This is called expressing AB as a sum of outer products , and it turns out to be a nifty way of decomposing the product AB . Why partition matrices? Example 6: Consider multiplying � A O � � C � I I B O D
Recommend
More recommend