I have been trying my luck with using the conjugate gradient method to solve a sparse symmetric positive definite system of equations. I found IterativeSolvers.jl, Krylov.jl and KrylovMethods.jl, of which the first seems to be the most active and well documented. IterativeSolvers.jl also supports supplying a preconditioner assuming that it respects the following interface:

```
These preconditioners should support the operations
- `A_ldiv_B!(y, P, x)` computes `P \ x` in-place of `y`;
- `A_ldiv_B!(P, x)` computes `P \ x` in-place of `x`;
- and `P \ x`
```

The docstring of `A_ldiv_B!`

highlights that `P`

must be a factorization object, not a matrix. All of this is great.

Being the most popular general-purpose preconditioner (AFAIK), I thought of trying an incomplete Cholesky factor. A simple search got me to the `cldlt`

function of IncompleteSelectedInversion.jl (recommended in IterativeSolvers docs) and the `lldl`

function of LLDL.jl. These implement an incomplete LDL’ factorization instead, but I am not complaining! The former package returns a sparse lower triangular matrix as a `SparseMatrixCSC{Float64,Int64}`

with the strict lower triangle hosting the strict lower triangle of `L`

, and the diagonal is the diagonal of `D`

. The latter returns a tuple of:

- A sparse strictly lower triangular matrix as a
`SparseMatrixCSC{Float64,Int64}`

hosting the strict lower triangle of`L`

, - A vector of the diagonal elements of
`D`

, and - The diagonal shift value used (not important for me).

Unfortunately none of these outputs can be just plugged in the `A_ldiv_B!`

function because they are not factors, so I cannot use them as preconditioners in the `cg`

function of IterativeSolvers.

Now, I can apply the preconditioner myself in some linear operator and pass that instead to `cg`

, then post-process the output, but I think such an important procedure should be more streamlined than this. So I guess my question is how to create my own `Factorization`

subtype instance using the information provided by the incomplete LDL’ factorization functions? Calling the constructor `Base.SparseArrays.CHOLMOD.Factor{Float64}`

naively doesn’t just work, and reading a bit of cholmod.jl didn’t really help.

Edit: I could obviously subtype `Factorization`

and implement the above functions myself in a PR or something. But I am asking if such a thing already exists.