| |||||||||
A sparse matrix is a matrix populated primarily with zeros, having very few nonzero elements.
This property is especially interesting when computer programs are used to solve mathematical problems involving matrices. If the matrices are large and sparse, storing all those zeroes may require much memory. Special data structures storing only the nonzero elements of sparse matrices have thus been developed to reduce the memory needs. Special algorithms implement matrix operations on matrices stored in this way.
For example, a BMP image having only 2 colors, with one of them dominant (say a file that stores signature) can be encoded as a sparse matrix that contains only row no and col no of non-dominant color.