bandsolve {aspline} | R Documentation |
Main function to solve efficiently and quickly a symmetric bandlinear system. Theses systems are solved much faster than standards system, dropping from complexity O(n³) to O(0.5*nk²), where k is the number of sub diagonal.
bandsolve(A, b = NULL, inplace = FALSE)
A |
Band square matrix in rotated form. The rotated form can be obtained with the function as.rotated: it's the visual rotation by 90 degrees of the matrix, where subdiagonal are discarded. |
b |
right hand side of the equation. Can be either a vector or a matrix. If not supplied, the function return the inverse of A. |
inplace |
Should results overwrite pre-existing data? Default set to false. |
Solution of the linear problem.
A = diag(4)
A[2,3] = 2
A[3,2] = 2
R = mat2rot(A)
solve(A)
bandsolve(R)
set.seed(100)
n = 1000
D0 = rep(1.25, n)
D1 = rep(-0.5, n-1)
b = rnorm(n)