Reference
Contents
Index
LDLFactorizations.LDLFactorization
Base.:-
Base.:\
LDLFactorizations.col_num!
LDLFactorizations.col_symb!
LDLFactorizations.factorized
LDLFactorizations.ldl
LDLFactorizations.ldl_analyze
LDLFactorizations.ldl_factorize!
LinearAlgebra.ldiv!
LinearAlgebra.ldiv!
LDLFactorizations.LDLFactorization
— TypeType that contains the LDLᵀ factorization of a matrix.
The components of the factorization can be accessed via getproperty
:
LDL.L
:L
sparse lower triangular factor of the factorization without the diagonal of ones that is removed to save spaceLDL.D
:D
diagonal matrix of the factorization.
In order to avoid zero pivots during the factorization, the user can regularize the matrix by modifying LDL.r1
for the LDL.n_d
first pivots and LDL.r2
for the other pivots with tolerance LDL.tol
.
Base.:-
— Method-(LDL)
Unary minus operator returns an LDLFactorization
with -LDL.d
.
Base.:\
— Methodx = LDL \ b
If LDL is the LDLᵀ factorization of A, solves $A x = b$.
LDLFactorizations.col_num!
— Methodcol_num!(n, Ap, Ai, Ci, w, Pinv)
Compute the rowval and values of missing elements of the upper triangle of PAPt. Nonzero elements have to verify Pinv[i] ≥ Pinv[j] where i is the row index and j the column index. Those elements are the nonzeros of the lower triangle of A that will be in the upper triangle of PAPt (after permutation)
Arguments
n::Ti
: number of columns of the matrixAp::Vector{Ti}
: colptr of the matrix to factorize (CSC format)Ai::Vector{Ti}
: rowval of the matrix to factorize (CSC format)Ci::Vector{Ti}
: rowval of the lower trianglew::Vector{Ti}
: work arrayPinv::Vector{Ti}
: inverse permutation of P. PAPt is the matrix to factorize (CSC format)
LDLFactorizations.col_symb!
— Methodcol_symb!(n, Ap, Ai, Cp, w, Pinv)
Compute the sparse structure of missing elements of the upper triangle of PAPt. Nonzero elements have to verify Pinv[i] < Pinv[j] where i is the row index and j the column index. Those elements are the nonzeros of the lower triangle of A that will be in the upper triangle of PAPt (after permutation)
Arguments
n::Ti
: number of columns of the matrixAp::Vector{Ti}
: colptr of the matrix to factorize (CSC format)Ai::Vector{Ti}
: rowval of the matrix to factorize (CSC format)Cp::Vector{Ti}
: colptr of the lower triangle (to be modified)w::Vector{Ti}
: work arrayPinv::Vector{Ti}
: inverse permutation of P. PAPt is the matrix to factorize (CSC format)
LDLFactorizations.factorized
— Methodisfact = factorized(LDL)
Returns true if the most recent factorization stored in LDL
LDLFactorization
succeeded.
LDLFactorizations.ldl
— FunctionS = ldl(A, Tf; P = amd(A))
S = ldl(A; P = amd(A))
S = ldl(A)
Compute the LDLᵀ factorization of the matrix A with permutation vector P (uses an AMD permutation by default). Tf
should be the element type of the factors, and is set to eltype(A)
if not provided. This function is equivalent to:
S = ldl_analyze(A)
ldl_factorize!(A, S)
A should either be a upper triangular matrix wrapped with LinearAlgebra's Symmetric / Hermitian type, or a symmetric / hermitian matrix (not wrapped with Symmetric / Hermitian).
Using a non upper triangular matrix wrapped with Symmetric or Hermitian will not give the LDLᵀ factorization of A.
Example
A = sprand(Float64, 10, 10, 0.2)
As = Symmetric(triu(A * A' + I), :U)
LDL = ldl(As) # LDL in Float64
LDL = ldl(As, Float32) # LDL in Float64
LDLFactorizations.ldl_analyze
— FunctionLDL = ldl_analyze(A, Tf; P = amd(A))
LDL = ldl_analyze(A; P = amd(A))
LDL = ldl_analyze(A)
Perform symbolic analysis of the matrix A
with permutation vector P
(uses an AMD permutation by default) so it can be reused. Tf
should be the element type of the factors, and is set to eltype(A)
if not provided. A
should be a upper triangular matrix wrapped with LinearAlgebra's Symmetric / Hermitian type.
Example
A = sprand(Float64, 10, 10, 0.2)
As = Symmetric(triu(A * A' + I), :U)
LDL = ldl_analyze(As) # LDL in Float64
LDL = ldl_analyze(As, Float32) # LDL in Float64
LDLFactorizations.ldl_factorize!
— Functionldl_factorize!(A, S)
Factorize A into the S LDLFactorization
struct.
LinearAlgebra.ldiv!
— Methodldiv!(y, LDL, b)
If LDL is the LDLᵀ factorization of A, solves A x = b
In place.
LinearAlgebra.ldiv!
— Methodldiv!(LDL, b)
If LDL is the LDLᵀ factorization of A, solves A x = b
and overwrites b with x.