@@ -106,7 +106,6 @@ mutable struct LookAheadLanczosDecomp{OpT, OptT, VecT, MatT, ElT, ElRT}
106106
107107 # Estimate of norm(A), see [^Freund1993]
108108 nA:: ElRT
109- nA_recompute:: ElRT
110109
111110 # Logs and options
112111 log:: LookAheadLanczosDecompLog
@@ -227,7 +226,7 @@ function LookAheadLanczosDecomp(
227226 D, E, Flastcol, Flastrow, F̃lastcol, G, H,
228227 U, L,
229228 n, k, l, kstar, lstar, mk, nl,
230- false , false , nA, nA,
229+ false , false , nA,
231230 ld_log,
232231 LookAheadLanczosDecompOptions (
233232 max_iter,
@@ -311,7 +310,7 @@ function _update_PQ_sequence!(ld)
311310 # Alg. 5.2.3
312311 _update_Flastrow! (ld)
313312 # 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)) )
315314 # Alg. 5.2.5
316315 _update_U! (ld, ld. innerp)
317316 # Alg. 5.2.6
@@ -374,7 +373,7 @@ function _update_VW_sequence!(ld)
374373 # Alg. 5.2.16
375374 _update_Flastcol! (ld)
376375 # 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)) )
378377 # Alg. 5.2.18
379378 _update_L! (ld, ld. innerv)
380379 # Alg. 5.2.19
@@ -436,7 +435,6 @@ function _update_D!(ld)
436435 # Eq. 3.15, (D Γ)ᵀ = (D Γ)
437436 # D[n, n] = wtv
438437
439- # TODO : closed block
440438 if isone (ld. n) || _VW_block_size (ld) == 1
441439 _start_new_block! (ld. D, ld. wtv)
442440 else
@@ -464,7 +462,6 @@ function _update_Flastrow!(ld)
464462 # Note: D is at D_n, L is at L_{n-1}
465463 # Eq. 5.2 (w/ indices advanced):
466464 # 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
468465 if ! isone (ld. n) # We only need to do this if we are constructing a block
469466 ld. Flastrow = reshape (ld. D[end : end , :] * ld. L, :)
470467 ld. F̃lastcol = ld. Flastrow .* ld. γ[1 : end - 1 ] ./ ld. γ[end ]
@@ -589,7 +586,9 @@ function _append_PQ!(ld)
589586end
590587
591588# 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 )
593592
594593function _update_E! (ld)
595594 # E = QtAP
0 commit comments