Solves the symmetric, positive definite tri-diagonal linear system Ax = b. |
||
Syntax |
x = LSolveSPDT(diag, offdiag, b) |
|
Arguments |
Name |
Description |
diag |
A vector of the main diagonal elements. |
|
offdiag |
A vector of the lower or upper off-diagonal elements. |
|
b |
The right-hand side row vector or a matrix. If it is a matrix, each row is considered a separate vector and the system is solved separately for each row, resulting in multiple solutions. The number of columns must be equal to the row/column size of the square matrix A. |
|
Output |
Name |
Description |
x |
The solution(s) to the system(s). It has the same dimensions as the right-hand side argument b. For each column in b, there is a solution in the corresponding column in x |
|
Example |
Solve a banded linear system Ax=b. |
|
Syntax |
||
A = [40,2,3;2,40,4;3,4,40];// symmetric positive definite tri-diagonal b = [ 1,2;11,22;21,42]; // the right hand side diag = [40,40,40]; offdiag = [2,4]; x = LSolveSPDT(diag,offdiag,b); |
||
ResultThe solution to the system. |
||
[Matrix] 3 x 2 x = 0.013797 0.027595 0.22405 0.44815 0.50259 1.0052 |
||
Comments |
LSolveT calls dptsv from LAPACK. |
|
See Also: |