Sparse matrix: Difference between revisions

Content deleted Content added
Banded: Added a fact that there could be zero elements not holding conditions of bandwidths.
Tags: Reverted Visual edit
Banded: Description of banded matrix in plain language
 
(4 intermediate revisions by 3 users not shown)
Line 25:
===Banded===
{{main article|Band matrix}}
A [[band matrix]] is a special class of sparse matrix where the non-zero elements are concentrated near the main diagonal. A band matrix is characterised by its lower and upper bandwidths, which refer to the number of diagonals below and above (respectively) the [[main diagonal]] between which all of the non-zero entries are contained.
An important special type of sparse matrices is [[band matrix]], defined as follows. The [[lower bandwidth of a matrix]] {{math|'''A'''}} is the smallest number {{math|''p''}} such that the entry {{math|''a''<sub>''i'',''j''</sub>}} vanishes whenever {{math|''i'' > ''j'' + ''p''}}. (The converse of this condition does not necessarily hold; there can be zero elements not satisfying this condition, but elements satisfying the condition are zero.) Similarly, the [[Band matrix#upper bandwidth|upper bandwidth]] is the smallest number {{math|''p''}} such that {{math|1=''a''<sub>''i'',''j''</sub> = 0}} whenever {{math|''i'' < ''j'' − ''p''}} {{harv|Golub|Van Loan|1996|loc=§1.2.1}}. For example, a [[tridiagonal matrix]] has lower bandwidth {{math|1}} and upper bandwidth {{math|1}}. As another example, the following sparse matrix has lower and upper bandwidth both equal to 3. Notice that zeros are represented with dots for clarity.
 
An important special type of sparse matrices is [[band matrix]]Formally, defined as follows. Thethe [[lower bandwidth of a matrix]] {{math|'''A'''}} is the smallest number {{math|''p''}} such that the entry {{math|''a''<sub>''i'',''j''</sub>}} vanishes whenever {{math|''i'' > ''j'' + ''p''}}. (The converse of this condition does not necessarily hold; there can be zero elements not satisfying this condition, but elements satisfying the condition are zero.) Similarly, the [[Band matrix#upper bandwidth|upper bandwidth]] is the smallest number {{math|''p''}} such that {{math|1=''a''<sub>''i'',''j''</sub> = 0}} whenever {{math|''i'' < ''j'' − ''p''}} {{harv|Golub|Van Loan|1996|loc=§1.2.1}}. For example, a [[tridiagonal matrix]] has lower bandwidth {{math|1}} and upper bandwidth {{math|1}}. As another example, the following sparse matrix has lower and upper bandwidth both equal to 3. Notice that zeros are represented with dots for clarity.
<math display="block">\begin{bmatrix}
X & X & X & \cdot & \cdot & \cdot & \cdot & \\
Line 41 ⟶ 43:
 
====Diagonal====
A verydiagonal efficientmatrix structureis for anthe extreme case of banda matricesbanded matrix, thewith zero upper and lower bandwidth. A ''[[diagonal matrix]]'', iscan be stored efficiently toby storestoring just the entries in the [[main diagonal]] as a [[one-dimensional array]], so a diagonal {{math|''n'' × ''n''}} matrix requires only {{math|''n''}} entries in memory.
 
===Symmetric===