Skip to content

Commit f3bc587

Browse files
committed
An implementation of USYMLQR
1 parent c3ea5a2 commit f3bc587

24 files changed

+856
-166
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ makedocs(
3838
"MINARES" => "examples/minares.md",
3939
"TriCG" => "examples/tricg.md",
4040
"TriMR" => "examples/trimr.md",
41+
"USYMLQR" => "examples/usymlqr.md",
4142
"BICGSTAB" => "examples/bicgstab.md",
4243
"DQGMRES" => "examples/dqgmres.md",
4344
"BLOCK-GMRES" => "examples/block_gmres.md",

docs/src/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ DqgmresSolver
3232
GmresSolver
3333
UsymlqSolver
3434
UsymqrSolver
35+
UsymlqrSolver
3536
TricgSolver
3637
TrimrSolver
3738
TrilqrSolver

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 = -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=D, ldiv=true)
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ 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
```

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
@@ -34,6 +34,7 @@ include("gpmr.jl")
3434

3535
include("usymlq.jl")
3636
include("usymqr.jl")
37+
include("usymlqr.jl")
3738
include("tricg.jl")
3839
include("trimr.jl")
3940
include("trilqr.jl")

src/block_krylov_solvers.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ const BLOCK_KRYLOV_SOLVERS = Dict(:block_gmres => :BlockGmresSolver)
88
abstract type BlockKrylovSolver{T,FC,SV,SM} end
99

1010
"""
11-
Type for storing the vectors required by the in-place version of BLOCK-GMRES.
11+
Workspace for the in-place version of BLOCK-GMRES.
1212
13-
The outer constructors
13+
The outer constructors:
1414
1515
solver = BlockGmresSolver(m, n, p, memory, SV, SM)
1616
solver = BlockGmresSolver(A, B, memory = 5)
1717
18-
may be used in order to create these vectors.
18+
can be used to initialize this workspace.
1919
`memory` is set to `div(n,p)` if the value given is larger than `div(n,p)`.
2020
`memory` is an optional argument in the second constructor.
2121
"""

0 commit comments

Comments
 (0)