Skip to content

Commit 5bcf38c

Browse files
committed
Add an implementation of USYMLQR
1 parent a2b42ee commit 5bcf38c

24 files changed

+769
-23
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ makedocs(
4141
"MINARES" => "examples/minares.md",
4242
"TriCG" => "examples/tricg.md",
4343
"TriMR" => "examples/trimr.md",
44+
"USYMLQR" => "examples/usymlqr.md",
4445
"BICGSTAB" => "examples/bicgstab.md",
4546
"DQGMRES" => "examples/dqgmres.md",
4647
"BLOCK-GMRES" => "examples/block_gmres.md",

docs/src/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ DqgmresWorkspace
3131
GmresWorkspace
3232
UsymlqWorkspace
3333
UsymqrWorkspace
34+
UsymlqrWorkspace
3435
TricgWorkspace
3536
TrimrWorkspace
3637
TrilqrWorkspace

docs/src/examples/usymlqr.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```@example usymlqr
2+
using Krylov, LinearOperators
3+
using LinearAlgebra, Printf, SparseArrays
4+
5+
# Identity matrix.
6+
eye(n::Int) = sparse(1.0 * I, n, n)
7+
8+
# Saddle-point systems
9+
n = m = 5
10+
A = [2^(i/j)*j + (-1)^(i-j) * n*(i-1) for i = 1:n, j = 1:n]
11+
b = ones(n)
12+
D = diagm(0 => [2.0 * i for i = 1:n])
13+
m, n = size(A)
14+
c = -3*b
15+
16+
# [D A] [x] = [b]
17+
# [Aᴴ 0] [y] [c]
18+
opH = BlockDiagonalOperator(inv(D), eye(n))
19+
(x, y, stats) = usymlqr(A, b, c, M=inv(D))
20+
K = [D A; A' zeros(n,n)]
21+
B = [b; c]
22+
r = B - K * [x; y]
23+
resid = sqrt(dot(r, opH * r))
24+
@printf("USYMLQR: Relative residual: %8.1e\n", resid)
25+
```

docs/src/matrix_free.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Some methods only require `A * v` products, whereas other ones also require `A'
4040
| CG, CR, CAR | CGLS, CRLS, CGNE, CRMR |
4141
| SYMMLQ, CG-LANCZOS, MINRES, MINRES-QLP, MINARES | LSLQ, LSQR, LSMR, LNLQ, CRAIG, CRAIGMR |
4242
| DIOM, FOM, DQGMRES, GMRES, FGMRES, BLOCK-GMRES | BiLQ, QMR, BiLQR, USYMLQ, USYMQR, TriLQR |
43-
| CGS, BICGSTAB | TriCG, TriMR |
43+
| CGS, BICGSTAB | TriCG, TriMR, USYMLQR |
4444
| CG-LANCZOS-SHIFT | CGLS-LANCZOS-SHIFT |
4545

4646
!!! info

docs/src/preconditioners.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,16 @@ Methods concerned: [`CGNE`](@ref cgne), [`CRMR`](@ref crmr), [`LNLQ`](@ref lnlq)
111111

112112
### Saddle-point and symmetric quasi-definite systems
113113

114-
[`TriCG`](@ref tricg) and [`TriMR`](@ref trimr) can take advantage of the structure of Hermitian systems $Kz = d$ with the 2x2 block structure
114+
[`TriCG`](@ref tricg), [`TriMR`](@ref trimr) and [`USYMLQR`](@ref usymlqr) can take advantage of the structure of Hermitian systems $Kz = d$ with the 2x2 block structure
115115
```math
116116
\begin{bmatrix} \tau E & \phantom{-}A \\ A^H & \nu F \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} b \\ c \end{bmatrix},
117117
```
118118
| Preconditioners | $E^{-1}$ | $E$ | $F^{-1}$ | $F$ |
119119
|:---------------:|:---------------------:|:--------------------:|:---------------------:|:--------------------:|
120120
| Arguments | `M` with `ldiv=false` | `M` with `ldiv=true` | `N` with `ldiv=false` | `N` with `ldiv=true` |
121121

122+
In the special case of [USYMLQR](@ref usymlqr), $\tau = 1$ and $\nu = 0$.
123+
122124
!!! warning
123125
The preconditioners `M` and `N` must be hermitian and positive definite.
124126

docs/src/processes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ T_{k,k+1} =
294294

295295
The function [`saunders_simon_yip`](@ref saunders_simon_yip(::Any, ::AbstractVector{FC}, ::AbstractVector{FC}, ::Int) where FC <: (Union{Complex{T}, T} where T <: AbstractFloat)) returns $V_{k+1}$, $\beta_1$, $T_{k+1,k}$, $U_{k+1}$, $\bar{\gamma}_1$ and $T_{k,k+1}^H$.
296296

297-
Related methods: [`USYMLQ`](@ref usymlq), [`USYMQR`](@ref usymqr), [`TriLQR`](@ref trilqr), [`TriCG`](@ref tricg) and [`TriMR`](@ref trimr).
297+
Related methods: [`USYMLQ`](@ref usymlq), [`USYMQR`](@ref usymqr), [`USYMLQR`](@ref usymlqr), [`TriLQR`](@ref trilqr), [`TriCG`](@ref tricg) and [`TriMR`](@ref trimr).
298298

299299
!!! note
300300
The Saunders-Simon-Yip is equivalent to the block-Lanczos process applied to $\begin{bmatrix} 0 & A \\ A^H & 0 \end{bmatrix}$ with initial matrix $\begin{bmatrix} b & 0 \\ 0 & c \end{bmatrix}$.

docs/src/solvers/sp_sqd.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ tricg!
1515
trimr
1616
trimr!
1717
```
18+
19+
## USYMLQR
20+
21+
```@docs
22+
usymlqr!
23+
usymlqr
24+
```

docs/src/storage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ Each table summarizes the storage requirements of Krylov methods recommended to
9393

9494
#### Saddle-point and Hermitian quasi-definite systems
9595

96-
| Methods | [`TriCG`](@ref tricg) | [`TriMR`](@ref trimr) |
97-
|:--------:|:---------------------:|:---------------------:|
98-
| Storage | $6n + 6m$ | $8n + 8m$ |
96+
| Methods | [`TriCG`](@ref tricg) | [`TriMR`](@ref trimr) | [`USYMLQR`](@ref usymlqr) |
97+
|:--------:|:---------------------:|:---------------------:|:-------------------------:|
98+
| Storage | $6n + 6m$ | $8n + 8m$ | $7n + 6m$ |
9999

100100
#### Generalized saddle-point and non-Hermitian partitioned systems
101101

src/Krylov.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ include("gpmr.jl")
4040

4141
include("usymlq.jl")
4242
include("usymqr.jl")
43+
include("usymlqr.jl")
4344
include("tricg.jl")
4445
include("trimr.jl")
4546
include("trilqr.jl")

src/interface.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ for (workspace, krylov, args, def_args, optargs, def_optargs, kwargs, def_kwargs
9797
(:FgmresWorkspace , :fgmres , args_fgmres , def_args_fgmres , optargs_fgmres , def_optargs_fgmres , kwargs_fgmres , def_kwargs_fgmres )
9898
(:FomWorkspace , :fom , args_fom , def_args_fom , optargs_fom , def_optargs_fom , kwargs_fom , def_kwargs_fom )
9999
(:GpmrWorkspace , :gpmr , args_gpmr , def_args_gpmr , optargs_gpmr , def_optargs_gpmr , kwargs_gpmr , def_kwargs_gpmr )
100+
(:UsymlqrWorkspace , :usymlqr , args_usymlqr , def_args_usymlqr , optargs_usymlqr , def_optargs_usymlqr , kwargs_usymlqr , def_kwargs_usymlqr )
100101
(:CgLanczosShiftWorkspace , :cg_lanczos_shift , args_cg_lanczos_shift , def_args_cg_lanczos_shift , (), (), kwargs_cg_lanczos_shift , def_kwargs_cg_lanczos_shift )
101102
(:CglsLanczosShiftWorkspace, :cgls_lanczos_shift, args_cgls_lanczos_shift, def_args_cgls_lanczos_shift, (), (), kwargs_cgls_lanczos_shift, def_kwargs_cgls_lanczos_shift)
102103
]

0 commit comments

Comments
 (0)