Creates a compressed diagonal storage matrix corresponding to a symmetric banded matrix. |
||
Syntax |
M = SymBandMatrix(size, k) |
|
Arguments |
Name |
Description |
size |
The size of each dimension of the original square matrix. |
|
k |
Number of sub- and super-diagonals in the lower or upper band of the original matrix. This should include zero entry off-diagonals that sit in between non-zero off-diagonals. |
|
Output |
Name |
Description |
M |
The corresponding compressed diagonal storage matrix initialized with zeros. The number of rows of M is k+1 and the number of columns equals size. |
|
Example |
Construct the compressed matrix format of A, where A is a 3x3 symmetric matrix with one sub- and super-diagonal. |
|
|
Syntax |
|
|
k = 1 // off diagonals M = SymBandMatrix(3,k); // The Compact Storage matrix |
|
|
Result |
|
|
M = [Matrix] 2 x 3 0 0 0 0 0 0 |
|
See Also: |