Matrix OrderingCertain sparse matrix techniques try to reorder the matrix so that elements are grouped into blocks. The computation then works on each block using dense matrix techniques. One simple way to order a matrix into blocks involves sorting according to the sum of elements on each row. This will be demonstrated in this example. First, generate a symmetric random sparse matrix. In[1]:=  |
In order to make plots of the matrix, the LinearAlgebra`MatrixManipulation` package is loaded. In[5]:=  |
Here is a plot of the matrix. In[6]:=  |
Now compute a permutation of the matrix and then apply it to the matrix. This topic is discussed in Matrix Permutations. In[7]:=  |
Here is a plot of the reordered matrix; the effect of the reordering can be seen. In[9]:=  |
Here is a much larger matrix with no structure and many random elements. In[10]:=  |
This is a plot of the original matrix. In[16]:=  |
This plot of the reordered matrix shows that there are many rows and columns with no elements. In[17]:=  |
|