Skip to content

Commit

Permalink
Add more examples with the preconditioners
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Sep 15, 2022
1 parent bcbc6aa commit db3520f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/src/preconditioners.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,38 @@ using ILUZero, Krylov
Pᵣ = ilu0(A)
x, stats = bicgstab(A, b, N=Pᵣ, ldiv=true) # right preconditioning
```

```julia
using LDLFactorizations, Krylov

M = ldl(E)
N = ldl(F)

# [E A] [x] = [b]
# [Aᴴ F] [y] [c]
x, y, stats = tricg(A, b, c, M=M, N=N, ldiv=true)
```

```julia
using SuiteSparse, Krylov
import LinearAlgebra.ldiv!

M = cholesky(E)

# ldiv! is not implemented for the sparse Cholesky factorization (SuiteSparse.CHOLMOD)
ldiv!(y::Vector{T}, F::SuiteSparse.CHOLMOD.Factor{T}, x::Vector{T}) where T = (y .= F \ x)

# [E A] [x] = [b]
# [Aᴴ 0] [y] [c]
x, y, stats = trimr(A, b, c, M=M, sp=true, ldiv=true)
```

```julia
using Krylov

C = lu(M)

# [M A] [x] = [b]
# [B 0] [y] [c]
x, y, stats = gpmr(A, B, b, c, C=C, gsp=true, ldiv=true)
```

0 comments on commit db3520f

Please sign in to comment.