You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# dot products - note we take tranpose(w)*v, not adjoint(w)*v
56
+
qtAp::ElT
57
+
w̃tṽ::ElT
58
+
wtv::ElT
59
+
60
+
# norms
61
+
normp::ElRT
62
+
normq::ElRT
63
+
ρ::ElRT
64
+
ξ::ElRT
65
+
66
+
γ::Vector{ElRT}
67
+
68
+
D::Matrix{ElT}
69
+
E::Matrix{ElT}
70
+
F::Matrix{ElT}
71
+
F̃lastcol::Vector{ElT}
72
+
G::Matrix{ElT}
73
+
H::Vector{ElT}
74
+
75
+
U::UpperTriangular{ElT, Matrix{ElT}}
76
+
L::Matrix{ElT}
77
+
78
+
# Indices tracking location in block and sequence
79
+
n::Int
80
+
k::Int
81
+
l::Int
82
+
kstar::Int
83
+
lstar::Int
84
+
mk::Vector{Int}
85
+
nl::Vector{Int}
86
+
87
+
# Flag determining if we are in inner block, see [^Freund1994] Alg. 5.2
88
+
innerp::Bool
89
+
innerv::Bool
90
+
91
+
# Estimate of norm(A), see [^Freund1993]
92
+
nA::ElRT
93
+
nA_recompute::ElRT
94
+
95
+
# Logs and options
96
+
log::LookAheadLanczosDecompLog
97
+
opts::LookAheadLanczosDecompOptions
98
+
end
99
+
100
+
"""
101
+
LookAheadLanczosDecomp(A, v, w; kwargs...)
102
+
103
+
Provides an iterable which constructs basis vectors for a Krylov subspace generated by `A` given by two initial vectors `v` and `w`. This implementation follows [^Freund1994], where a coupled two-term recurrence is used to generate both a V-W and a P-Q sequence. Following the reference, the Lanczos sequence is generated by `A` and `transpose(A)`.
104
+
105
+
# Arguments
106
+
- `A`: Operator used to construct Krylov subspace
107
+
- `v`: Initial vector for Krylov subspace generated by `A`
108
+
- `w`: Initial vector for Krylov subspace generated by `transpose(A)`
109
+
110
+
# Keywords
111
+
- `max_iter=size(A, 2)`: Maximum number of iterations
112
+
- `max_block_size=2`: Maximum look-ahead block size to construct. Following [^Freund1994], it is rare for blocks to go beyond size 3. This pre-allocates the block storage for the computation to size `(max_block_size, length(v))`. If a block would be built that exceeds this size, the estimate of `norm(A)` is adjusted to allow the block to close.
113
+
- `log=false`: Flag determining whether to log history in a [`LookAheadLanczosDecompLog`](@ref)
114
+
- `verbose=false`: Flag determining verbosity of output during iteration
115
+
116
+
# References
117
+
[^Freund1993]:
118
+
Freund, R. W., Gutknecht, M. H., & Nachtigal, N. M. (1993). An Implementation of the Look-Ahead Lanczos Algorithm for Non-Hermitian Matrices. SIAM Journal on Scientific Computing, 14(1), 137–158. https://doi.org/10.1137/0914009
119
+
[^Freund1994]:
120
+
Freund, R. W., & Nachtigal, N. M. (1994). An Implementation of the QMR Method Based on Coupled Two-Term Recurrences. SIAM Journal on Scientific Computing, 15(2), 313–337. https://doi.org/10.1137/0915022
using IterativeSolvers; const IS = IterativeSolvers
2
+
using LinearAlgebra
3
+
using SparseArrays
4
+
using Test
5
+
6
+
# Equation references and identities from:
7
+
# Freund, R. W., & Nachtigal, N. M. (1994). An Implementation of the QMR Method Based on Coupled Two-Term Recurrences. SIAM Journal on Scientific Computing, 15(2), 313–337. https://doi.org/10.1137/0915022
0 commit comments