| factorize_lu | R Documentation |
Compute an LU factorization once and reuse it for different right-hand sides.
factorize_lu(a, pivot = 1L, ordering = 1L)
## S3 method for class 'sanic_lu'
solve(a, b, ...)
a |
For |
pivot |
Pivoting scheme for dense matrices, as in
|
ordering |
Ordering scheme for sparse matrices, as in
|
b |
Numeric vector or matrix of right-hand sides. If missing, compute the inverse. Sparse right-hand sides are converted to dense matrices. |
... |
Unused; additional arguments are rejected. |
The factorization owns its data: changing or removing a does not
affect subsequent solves. Dense LU uses partial pivoting by default;
pivot = 2 uses full pivoting and checks for singularity. As with
solve_lu(), partial pivoting assumes an invertible matrix and does not
perform a rank check. Sparse LU ignores pivot.
Factorizations are session-local external pointers. They cannot be reused
after serialization (for example, with saveRDS()) or in another R
process; recreate them from the original matrix instead.
factorize_lu() returns an object of class sanic_lu. Its
solve() method returns a numeric matrix, including for vector
right-hand sides. Omitting b computes the inverse.
A <- matrix(c(4, 1, 2, 3), 2)
f <- factorize_lu(A)
solve(f, c(1, 2))
solve(f, cbind(c(1, 2), c(3, 4)))
solve(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.