Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Oct 14, 2024
1 parent ab21254 commit 82779c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/src/examples/usymlqr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@example usymlqr
using Krylov, LinearOperators, LDLFactorizations
using Krylov, LinearOperators
using LinearAlgebra, Printf, SparseArrays
# Identity matrix.
Expand All @@ -15,13 +15,11 @@ c = -b
# [D A] [x] = [b]
# [Aᴴ 0] [y] [c]
llt_D = cholesky(D)
opD⁻¹ = LinearOperator(Float64, 5, 5, true, true, (y, v) -> ldiv!(y, llt_D, v))
opH⁻¹ = BlockDiagonalOperator(opD⁻¹, eye(n))
(x, y, stats) = usymlqr(A, b, c, M=opD⁻¹, sp=true)
opH = BlockDiagonalOperator(inv(D), eye(n))
(x, y, stats) = usymlqr(A, b, c, M=D, ldiv=true)
K = [D A; A' zeros(n,n)]
B = [b; c]
r = B - K * [x; y]
resid = sqrt(dot(r, opH⁻¹ * r))
resid = sqrt(dot(r, opH * r))
@printf("USYMLQR: Relative residual: %8.1e\n", resid)
```
1 change: 1 addition & 0 deletions src/usymlqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ kwargs_usymlqr = (:transfer_to_usymcg, :M, :N, :ldiv, :atol, :rtol, :itmax, :tim
kdisplay(iter, verbose) && @printf(iostream, "%4d %7.1e %7.1e %7.1e\n", iter, αₖ, βₖ, γₖ)

# Stopping criterion.
rNorm = β₁
solved = rNorm ε
tired = iter itmax
status = "unknown"
Expand Down

0 comments on commit 82779c9

Please sign in to comment.