backsolve and forwardsolve solve a system
of linear equations where the coefficient matrix
is upper or lower triangular.
solve solves a linear system or computes the inverse
of a matrix if the right-hand-side is missing.solve(a, b, ...)backsolve(r, x, ...)forwardsolve(l, x, ...)
spam.spam or spam.chol.method returned by the function
chol.A %*% x = b by first computing the Cholesky decomposition A =
t(R)%*%R), then solving t(R)%*%y = b for y, and
finally solving R%*%x = y for x.
solve combines chol, a Cholesky decomposition of a
symmetric positive definite sparse matrix, with forwardsolve and
then backsolve.forwardsolve and backsolve solve a system of linear
equations where the coefficient matrix is lower (forwardsolve) or
upper (backsolve) triangular. Usually, the triangular matrix is
result from a chol call and it is not required to transpose it
for forwardsolve. Note that arguments of the default
methods k, upper.tri and transpose do not have any
effects here.
If the right-hand-side in solve is missing it will compute
the inverse of a matrix. For details about the specific Cholsesky
decomposition, see chol.
Recall that the Cholesky factors are from ordered matrices.