LinearAlgebra interface

A DirectSolver is a LinearAlgebra.Factorization. The functions below take a CSR matrix; the CUDA extension adds methods for CuSparseMatrixCSR, the AMDGPU extension for ROCSparseMatrixCSR.

LinearAlgebra.cholesky — Method
cholesky(A::CSR, NoPivot(); view = 'F', check = false) -> DirectSolver

LLᵀ (real T, structure "SPD") or LLᴴ (complex T, "HPD") factorization of the sparse matrix A on its backend: a DirectSolver after "analysis" and "factorization" (synchronized), with ir_n_steps = 2 steps of iterative refinement in its solves (the handle layer's default is 0; change it with setparam!). view selects the triangle of A that is read ('L', 'U', 'F'). As in CUDSS.jl a failed factorization does not throw unless check = true (then FactorizationError); otherwise check getparam(solver, "info"). A uniform batch (values of several members in A.nzval, see DirectSolver) is factorized member by member with one analysis.

source
LinearAlgebra.ldlt — Method
ldlt(A::CSR; view = 'F', check = false) -> DirectSolver

LDLᵀ (real T, structure "S") or LDLᴴ (complex T, "H") factorization of the sparse symmetric/Hermitian matrix A on its backend (≅ CUDSS.jl's ldlt): a DirectSolver after "analysis" and "factorization" (synchronized, ir_n_steps = 2 as cholesky), with in-front Bunch–Kaufman pivoting and static perturbation of tiny pivots (read getparam(solver, "npivots") and "inertia"). view as in cholesky. The factorization does not fail ("info" stays 0), so check has no effect; it is accepted for symmetry with cholesky.

source
LinearAlgebra.lu — Method
lu(A::CSR; check = false) -> DirectSolver

L D U factorization (structure "G") of the general sparse matrix A on its backend (≅ CUDSS.jl's lu): a DirectSolver after "analysis" and "factorization" (synchronized, ir_n_steps = 2 as cholesky), on the symmetric pattern of A + Aᵀ with row pivoting inside the fully-summed block of each front and static perturbation of tiny pivots (read getparam(solver, "npivots")). The factorization does not fail ("info" stays 0), so check has no effect. ldiv!/`solve withA;setparam!(solver, "solve_mode", 1)(or2) solves withAᵀ(Aᴴ`).

source
LinearAlgebra.cholesky! — Method
cholesky!(solver::DirectSolver, A; check = false) -> solver

Factorize the new values A (a CSR, SparseMatrixCSC, raw-array triple through update!, or a device sparse matrix of an extension) reusing the analysis of solver: update!, then "factorization" the first time after an analysis (solver.fresh_factorization) and "refactorization" afterwards, synchronized. check as in cholesky.

source
LinearAlgebra.ldlt! — Method
ldlt!(solver::DirectSolver, A; check = false) -> solver

Factorize the new values A reusing the analysis of solver, as cholesky! ("factorization" the first time after an analysis, "refactorization" afterwards, synchronized).

source
LinearAlgebra.lu! — Method
lu!(solver::DirectSolver, A; check = false) -> solver

Factorize the new values A reusing the analysis of solver, as cholesky! ("factorization" the first time after an analysis, "refactorization" afterwards, synchronized).

source
LinearAlgebra.ldiv! — Method
ldiv!(solver::DirectSolver, B) -> B
ldiv!(X, solver::DirectSolver, B) -> X

Solve A X = B with the factorization in solver ("solve", synchronized), in place in B or into X. B, X: vectors, matrices, n × nrhs × nbatch arrays (uniform batch) or MatrixDescriptors on the solver's backend.

source
Base.:\ — Method
solver \ B

ldiv!(similar(B), solver, B) for a vector, matrix or n × nrhs × nbatch array B.

source
LinearAlgebra.diag — Method
diag(solver::DirectSolver)

Diagonal of the factor L (Cholesky) or of D (LDLᵀ/LDLᴴ) in factor order (the "diag" data parameter), a vector on the solver's backend.

source
SparseArrays.nnz — Method
nnz(solver::DirectSolver)

Nonzeros of the factor L (the "lu_nnz" data parameter).

source
LinearAlgebra.logabsdet — Method
logabsdet(solver::DirectSolver) -> (log|det A|, sign)

Cholesky: from the diagonal of the factor, log|det A| = 2 Σ log Lₖₖ, sign = one(T) (A is positive definite). LDLᵀ/LDLᴴ: det A = det D (the permutations cancel, det L = 1), the product of the 1×1 pivots and of the determinants of the 2×2 blocks; sign is ±1 (real or Hermitian) or det D / |det D| (complex symmetric). With perturbed pivots ("npivots" > 0) this is the determinant of A + E. Raises FactorizationError when the factorization failed ("info" ≠ 0) and NotSupportedError for a uniform batch (read the members' diagonals with getparam(solver, "diag")). LU ("G"): det A = ± det D, the sign of the local row interchanges times the product of the pivots (sign is ±1 for real T, a unit complex number otherwise).

source