Download presentation
Presentation is loading. Please wait.
1
Sparse Matrix Storage Lecture #3 EEE 574 Dr. Dan Tylavsky
2
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Apply BRR(C)O/U to the following matrix. 1234 1 2 3 4
3
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –It is common to take advantage of symmetry when storing numerically symmetric and incidence symmetric. –When matrices are not symmetric. Any complete representation (i.e., RR(C)U/O) can be used to store asymmetric matrices. –Let’s look at some additional complete storage schemes.
4
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Knuth’s Storage: Used when fast access to elements by row and column is needed. Store indices to each element. Link row elements. Link column elements. Store initial row and column pointers.
5
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Modified Knuth’s Storage: Less storage, but longer time needed for index determination. –Use Knuth’s method with the following changes. Eliminate RIndx & CIndx Arrays Replace row (col.) end link with negative row (col.) indices
6
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –To find (3,1) element: Scan Row 3 and list locations of all elements. Scan column 1 and list locations of all elements. The location which occurs in both lists must be A(3,1); otherwise the (3,1) entry is a zero.
7
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –To find indices of -23.0 Scan row associated with -23 until neg. row index occurs. Scan column associated with -23 until neg. col index occurs.
8
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Teams: What is the (4,5) element of this matrix.
9
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Teams: What are the row and column indices of the -11.0 entry.
10
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Teams: Construct the sparse matrix from the following (Modified Knuth) sparse storage scheme.
11
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Comparison of Static and Dynamic Matrix Sotrage Schemes. Static - Number and location of nonzeros is known apriori. (Data structure set in symbolic program seg.) Dynamic - Number and location of non-zeros is a numerical function of the matrix data or is time varying.
12
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky Advantages of Static and Dynamic Matrix Storage Static 1) Simple storage schemes. 2) Symbolic & numerical processing done separately. 3) Separable symbolic and numerical processing leads to code simpler to create, debug, maintain. Dynamic 1) Can be used where sparsity pattern is a function of numerical content. factorization of indefinite matrices. 2) Can be used where sparsity pattern is a function of time. evolution of a network topology under switching conditions.
13
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky Disadvantages of Static and Dynamic Matrix Storage Static 1) Must know apriori: # of non-zero elements. Position of non-zero elements. Dynamic 1) Intertwining of numerical and symbolic segments leads to complex code creation, debugging and maintenance.
14
The End
15
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Teams: What is the (4,5) element of this matrix.
16
Sparse Matrix Storage © Copyright 1999 Daniel Tylavsky –Teams: Construct the sparse matrix from the following (Modified Knuth) sparse storage scheme.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.