@@ -106,7 +106,6 @@ mutable struct LookAheadLanczosDecomp{OpT, OptT, VecT, MatT, ElT, ElRT}
106
106
107
107
# Estimate of norm(A), see [^Freund1993]
108
108
nA:: ElRT
109
- nA_recompute:: ElRT
110
109
111
110
# Logs and options
112
111
log:: LookAheadLanczosDecompLog
@@ -227,7 +226,7 @@ function LookAheadLanczosDecomp(
227
226
D, E, Flastcol, Flastrow, F̃lastcol, G, H,
228
227
U, L,
229
228
n, k, l, kstar, lstar, mk, nl,
230
- false , false , nA, nA,
229
+ false , false , nA,
231
230
ld_log,
232
231
LookAheadLanczosDecompOptions (
233
232
max_iter,
@@ -311,7 +310,7 @@ function _update_PQ_sequence!(ld)
311
310
# Alg. 5.2.3
312
311
_update_Flastrow! (ld)
313
312
# Alg. 5.2.4
314
- ld. innerp = inner_ok && _is_singular (ld. E)
313
+ ld. innerp = inner_ok && ! isempty (ld . E) && _is_singular (last ( blocks ( ld. E)) )
315
314
# Alg. 5.2.5
316
315
_update_U! (ld, ld. innerp)
317
316
# Alg. 5.2.6
@@ -374,7 +373,7 @@ function _update_VW_sequence!(ld)
374
373
# Alg. 5.2.16
375
374
_update_Flastcol! (ld)
376
375
# Alg. 5.2.17
377
- ld. innerv = inner_ok && _is_singular (ld. D[ld . nl[ld . l] : end , ld . nl[ld . l] : end ] )
376
+ ld. innerv = inner_ok && _is_singular (last ( blocks ( ld. D)) )
378
377
# Alg. 5.2.18
379
378
_update_L! (ld, ld. innerv)
380
379
# Alg. 5.2.19
@@ -436,7 +435,6 @@ function _update_D!(ld)
436
435
# Eq. 3.15, (D Γ)ᵀ = (D Γ)
437
436
# D[n, n] = wtv
438
437
439
- # TODO : closed block
440
438
if isone (ld. n) || _VW_block_size (ld) == 1
441
439
_start_new_block! (ld. D, ld. wtv)
442
440
else
@@ -464,7 +462,6 @@ function _update_Flastrow!(ld)
464
462
# Note: D is at D_n, L is at L_{n-1}
465
463
# Eq. 5.2 (w/ indices advanced):
466
464
# F_{n} = D_{n}L[1:n, 1:n] + l[n+1, n]D_{n}[1:n, n+1][0 ... 0 1]
467
- # TODO : block
468
465
if ! isone (ld. n) # We only need to do this if we are constructing a block
469
466
ld. Flastrow = reshape (ld. D[end : end , :] * ld. L, :)
470
467
ld. F̃lastcol = ld. Flastrow .* ld. γ[1 : end - 1 ] ./ ld. γ[end ]
@@ -589,7 +586,9 @@ function _append_PQ!(ld)
589
586
end
590
587
591
588
# 5.2.4, 5.2.17
592
- _is_singular (A) = ! isempty (A) && minimum (svdvals (A)) < eps (real (eltype (A)))
589
+ # Freund, R. W., Gutknecht, M. H., & Nachtigal, N. M. (1993). An Implementation of the Look-Ahead Lanczos Algorithm for Non-Hermitian Matrices Part I. SIAM Journal on Scientific Computing, 14(1), 137–158. https://doi.org/10.1137/0914009
590
+ # suggests eps()^(1/3)
591
+ _is_singular (A) = ! isempty (A) && minimum (svdvals (A)) < eps (real (eltype (A)))^ (1 / 3 )
593
592
594
593
function _update_E! (ld)
595
594
# E = QtAP
0 commit comments