Matrices An appeaser is one who feeds a crocodile—hoping it will eat him last. Winston Churchhill
Types of Sparse Matrices Random Distribution.
Types of Sparse Matrices Cont... Multiple bands Vertical Banding: Diagonal Horizontal
Types of Sparse Matrices Cont... Blocking: Corners Diagonal
Bit Map Compression B Z 5 2 4 9 6 1 3 8 R 1 3 5 6 8 Compressed Matrix Raw Matrix B Z 5 2 4 9 6 1 3 8 R 1 3 5 6 8
Address Map Compression Compressed Matrix Raw Matrix A 1 2 3 4 5 6 7 8 Array Index Z 5 2 4 9 6 1 3 8 R 0 2 4 5 7
Dealing with Empty Rows R must contain place holders into Z. Values are set to next non empty row. Z 5 2 4 9 8 1 3 5 5 5 R
Dealing with Empty Rows When a value is entered in row r Values in Z belonging to r +1 and above are shifted right. Row index in R is also adjusted +1 for rows above r In practice, R would contain a dummy column at the end so the last row is not special cased. 7 Z 5 2 4 9 7 8 1 1 3 5 5 6 R
Orthogonal Linked Lists Data Down Row Col Right Nodes used in the structure Matrix indices. Right & down pointers. Each non-zero entry to the left will be represented by the above node structure. Structure is linked together using the pointer fields
0 1 12 10 5 0 2 0 8 0 6 0 0 6 0 9 0 2 11 0 0 4 5 2 2 2 2 9 4 5 1 9 5 4 6 6 6 1 8 1 3 8 9 8 11 2
Adding [6,4] Find correct row Add Links Find correct Column Add links 0 1 12 10 5 0 2 0 8 0 6 0 0 6 0 9 0 2 11 0 0 4 Adding [6,4] 5 2 2 2 2 9 NEW 6 4 Find correct row Add Links 4 5 1 9 5 4 6 6 6 1 8 1 3 8 9 8 11 2
Relative Compression of Sparse Matrix