Skip to content
Merged
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
11 changes: 6 additions & 5 deletions src/R2_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ function R2!(
ξ = hk - mks + max(1, abs(hk)) * 10 * eps()

if ξ ≥ 0 && k == 1
ϵ += ϵr * sqrt(ξ) # make stopping test absolute and relative
ϵ += ϵr * sqrt(ξ) # make stopping test absolute and relative
end

if (ξ < 0 && sqrt(-ξ) ≤ neg_tol) || (ξ ≥ 0 && sqrt(ξ) ≤ ϵ)
if (ξ < 0 && sqrt(-ξ) ≤ neg_tol) || (ξ ≥ 0 && sqrt(ξ) ≤ ϵ)
optimal = true
continue
end
Expand All @@ -310,7 +310,8 @@ function R2!(
if (verbose > 0) && (k % ptf == 0)
#! format: off
σ_stat = (η2 ≤ ρk < Inf) ? "↘" : (ρk < η1 ? "↗" : "=")
@info @sprintf "%6d %8.1e %8.1e %7.1e %8.1e %7.1e %7.1e %7.1e %1s" k fk hk sqrt(ξ) ρk σk norm(xk) norm(s) σ_stat
@info @sprintf "%6d %8.1e %8.1e %7.1e %8.1e %7.1e %7.1e %7.1e %1s" k fk hk sqrt(ξ/ν) ρk σk norm(xk) norm(s) σ_stat

#! format: on
end

Expand Down Expand Up @@ -347,9 +348,9 @@ function R2!(
@info @sprintf "%6d %8.1e %8.1e" k fk hk
elseif optimal
#! format: off
@info @sprintf "%6d %8.1e %8.1e %7.1e %8s %7.1e %7.1e %7.1e" k fk hk sqrt(ξ) "" σk norm(xk) norm(s)
@info @sprintf "%6d %8.1e %8.1e %7.1e %8s %7.1e %7.1e %7.1e" k fk hk sqrt(ξ) "" σk norm(xk) norm(s)
#! format: on
@info "R2: terminating with √ξ = $(sqrt(ξ))"
@info "R2: terminating with √ξ/√ν = $(sqrt(ξ))"
end
end

Expand Down