Reference

Contents

Index

LDLFactorizations.LDLFactorizationType

Type 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 space
  • LDL.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.

source
Base.:-Method
-(LDL)

Unary minus operator returns an LDLFactorization with -LDL.d.

source
Base.:\Method
x = LDL \ b

If LDL is the LDLᵀ factorization of A, solves $A x = b$.

source
LDLFactorizations.col_num!Method
col_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 matrix
  • Ap::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 triangle
  • w::Vector{Ti}: work array
  • Pinv::Vector{Ti}: inverse permutation of P. PAPt is the matrix to factorize (CSC format)
source
LDLFactorizations.col_symb!Method
col_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 matrix
  • Ap::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 array
  • Pinv::Vector{Ti}: inverse permutation of P. PAPt is the matrix to factorize (CSC format)
source
LDLFactorizations.ldlFunction
S = 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
source
LDLFactorizations.ldl_analyzeFunction
LDL = 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
source
LinearAlgebra.ldiv!Method
ldiv!(LDL, b)

If LDL is the LDLᵀ factorization of A, solves A x = b and overwrites b with x.

source