Skip to content

Commit

Permalink
Remove the condition mk = -Inf
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedLaghdafHABIBOULLAH authored and dpo committed Jan 17, 2025
1 parent 3126504 commit 0eb8c3f
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/R2DH.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ function R2DH(
time_hist = zeros(maxIter+1)
FHobj_hist = fill!(Vector{R}(undef, Mmonotone - 1), R(-Inf))
Complex_hist = zeros(Int, maxIter+1)
k_prox = 0
if verbose > 0
#! format: off
@info @sprintf "%6s %8s %8s %7s %8s %7s %7s %7s %1s" "iter" "f(x)" "h(x)" "√(ξ/ν)" "ρ" "σ" "‖x‖" "‖s‖" ""
Expand All @@ -200,7 +199,6 @@ function R2DH(
tired = maxIter > 0 && k maxIter || elapsed_time > maxTime

while !(optimal || tired)
k_prox += 1
# model with diagonal hessian
φ(d) = ∇fk' * d + (d' * (Dkσk .* d)) / 2
mk(d) = φ(d) + ψ(d)
Expand All @@ -212,24 +210,14 @@ function R2DH(
end
mks = mk(s)

if mks == -Inf
σk = σk * γ
Dkσk .= D.d .+ σk
DNorm = norm(D.d, Inf)
ν = 1 / ((DNorm + σk) * (1 + θ))
@. mν∇fk = -ν * ∇fk
continue
end

k = k + 1
elapsed_time = time() - start_time
Fobj_hist[k] = fk
Hobj_hist[k] = hk
time_hist[k] = elapsed_time
Mmonotone > 1 && (FHobj_hist[mod(k-1, Mmonotone - 1) + 1] = fk + hk)

Complex_hist[k] += k_prox
k_prox = 0
Complex_hist[k] += 1
xkn .= xk .+ s
fkn = f(xkn)
hkn = h(xkn[selected])
Expand Down

0 comments on commit 0eb8c3f

Please sign in to comment.