| Title: | Sparse LU Decomposition via SuiteSparse |
|---|---|
| Description: | Provides an interface to the SuiteSparse UMFPACK LU factorisation routines for sparse matrices stored in compressed column format. Implements the algorithm described in Davis (2004) <doi:10.1145/992200.992206>. |
| Authors: | Kevin Michael Frick [aut, cre], Timothy A. Davis [ctb] (affiliation: SuiteSparse Project, contribution: SuiteSparse libraries and collaborators listed in dir(system.file("doc", "SuiteSparse", package = "Matrix"), pattern = "License", full.names = TRUE, recursive = TRUE)) |
| Maintainer: | Kevin Michael Frick <[email protected]> |
| License: | GPL-3 |
| Version: | 0.3.0 |
| Built: | 2026-06-04 11:19:46 UTC |
| Source: | https://github.com/kmfrick/sparselu |
Compute an LU factorisation of a sparse matrix stored in compressed column storage using the SuiteSparse UMFPACK routines.
sparseLU(Ap, Ai, Ax)sparseLU(Ap, Ai, Ax)
Ap |
Integer vector of column pointers indexing into |
Ai |
Integer vector of row indices for each non-zero element. |
Ax |
Numeric vector of the non-zero values. |
The column pointers Ap and row indices Ai must use zero-based indexing as required by the SuiteSparse UMFPACK interface.
A named list with components L, U, P, and Q describing the LU factorisation returned by UMFPACK.
Ap <- c(0L, 2L, 3L, 5L) Ai <- c(0L, 2L, 1L, 0L, 2L) Ax <- c(1, 4, 3, 2, 5) sparseLU(Ap, Ai, Ax)Ap <- c(0L, 2L, 3L, 5L) Ai <- c(0L, 2L, 1L, 0L, 2L) Ax <- c(1, 4, 3, 2, 5) sparseLU(Ap, Ai, Ax)
Solve the sparse linear system using the SuiteSparse UMFPACK LU factorisation.
sparseLU_solve(Ap, Ai, Ax, b)sparseLU_solve(Ap, Ai, Ax, b)
Ap |
Integer vector of column pointers indexing into |
Ai |
Integer vector of row indices for each non-zero element. |
Ax |
Numeric vector of the non-zero values. |
b |
Numeric vector containing the right-hand side of the linear system. |
The sparse matrix is provided in compressed column storage using zero-based indexing in Ap and Ai, matching the expectations of the SuiteSparse UMFPACK interface.
Numeric vector with the solution to the system.
Ap <- c(0L, 2L, 3L, 5L) Ai <- c(0L, 2L, 1L, 0L, 2L) Ax <- c(1, 4, 3, 2, 5) b <- c(1, 2, 3) sparseLU_solve(Ap, Ai, Ax, b)Ap <- c(0L, 2L, 3L, 5L) Ai <- c(0L, 2L, 1L, 0L, 2L) Ax <- c(1, 4, 3, 2, 5) b <- c(1, 2, 3) sparseLU_solve(Ap, Ai, Ax, b)