Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lobpcg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function ortho(X; tol=1e-10)
# see https://arxiv.org/pdf/1809.11085.pdf for a nice analysis
# We are not being very clever here; but this should very rarely happen so it should be OK
α = 10000
n_bad = 0
nbad = 0
while true
O += α*eps(real(eltype(X)))*norm(X)^2*I
α *= 10
Expand Down Expand Up @@ -123,7 +123,6 @@ function ortho(X, Y, BY; tol=1e-10)
# eps(), the loop will terminate, even if BY'Y != 0
growth_factor*eps(real(eltype(X))) < tol && break


niter > 10 && error("Ortho is failing badly, this should never happen")
niter += 1
end
Expand All @@ -148,6 +147,7 @@ function LOBPCG(A, X, B=I, precon=I, tol=1e-10, maxiter=100; ortho_tol=2eps(real
buf_X = zero(X)
buf_P = zero(X)

X = ortho(X, tol=ortho_tol)[1]
AX = A*X
# full_X/AX/BX will always store the full (including locked) X.
# X/AX/BX only point to the active part
Expand Down