matrix3 - Advanced List Structures Sparse Matrices (3)...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction An m x n matrix (table) is said to be sparse if “many” of its elements are zero (empty). A matrix which is not sparse is dense . The boundary between a dense and a sparse matrix is not precisely defined. Diagonal and tridiagonal n x n matrices are sparse since they have O(n) nonzero terms and O(n 2 ) zero terms. Is an n x n triangular (either upper or lower) matrix sparse? A triangular matrix will have at least n(n-1)/2 zero terms and at most n(n+1)/2 nonzero terms. For the representation schemes that we are about to examine to be competitive over the standard two-dimensional array representation, it will turn out that the number of nonzero terms will need to be less than n 2 /3 and in some cases less than n 2 /5 . Thus, in the context of the representation schemes we are about to see, a triangular matrix is considered to be dense rather than sparse. Sparse matrices which are either diagonal or tridiagonal have sufficient structure in their nonzero regions to allow fairly simple representation schemes Sparse Matrices - 1 Advanced List Structures – Sparse Matrices (3) Definition: A matrix M is diagonal iff M(i, j) = 0 for i j. Definition: A matrix M is tridiagonal iff M(i, j) = 0 for |i – j| > 1. [Both of these special matrices are special cases of the more general square band matrix in which the non-zero elements are on a band which is centered about the main diagonal.] Considering matrix M to be a 6 x 6 matrix, for purposes of an example, we have: 2 0 0 0 0 0 4 2 0 0 0 0 0 1 0 0 0 0 1 3 1 0 0 0 0 0 4 0 0 0 0 4 5 2 0 0 0 0 0 6 0 0 0 0 2 9 4 0 0 0 0 0 5 0 0 0 0 6 3 3 0 0 0 0 0 3 0 0 0 0 1 2 Diagonal Matrix Tridiagonal Matrix
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
to be developed whose space requirements equal the size of the nonzero region. We are not concerned with these simple cases, rather our focus will be on sparse matrices with irregular or unstructured nonzero regions. Irregular Sparse Matrices An irregular sparse matrix has a nonzero region in which no discernable pattern exists. Without regularity in the nonzero region it is highly unlikely that a standard representation, such as a two-dimensional array, would provide an efficient representation of the matrix. On the other hand, if there is a high degree of regularity or structure in the nonzero region, then an efficient representation structure of the nonzero region can typically be developed using standard linked lists that will require space equal in size to the nonzero region. We will not examine these highly regular sparse matrices, our concern is finding a suitable representation scheme for an irregular sparse matrix. Consider the following irregular 4 x 8 sparse matrix. 0 0 0 2
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/13/2011.

Page1 / 8

matrix3 - Advanced List Structures Sparse Matrices (3)...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online