Skip to content

Commit 2820f45

Browse files
committed
fix PANOCplus merit update
1 parent 95e89b7 commit 2820f45

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/algorithms/panocplus.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ function Base.iterate(iter::PANOCplusIteration{R}, state::PANOCplusState) where
183183

184184
tau_backtracks = 0
185185
can_update_direction = true
186+
FBE_x_new = R(0)
186187

187188
while true
188189

@@ -230,8 +231,6 @@ function Base.iterate(iter::PANOCplusIteration{R}, state::PANOCplusState) where
230231

231232
FBE_x_new = f_Az_upp + state.g_z
232233
if FBE_x_new <= threshold || tau_backtracks >= iter.max_backtracks
233-
# update merit with averaging rule
234-
state.merit = (1 - iter.monotonicity) * state.merit + iter.monotonicity * FBE_x_new
235234
break
236235
end
237236
state.tau = tau_backtracks >= iter.max_backtracks - 1 ? R(0) : state.tau / 2
@@ -241,6 +240,9 @@ function Base.iterate(iter::PANOCplusIteration{R}, state::PANOCplusState) where
241240

242241
update_direction_state!(iter, state)
243242

243+
# update merit with averaging rule
244+
state.merit = (1 - iter.monotonicity) * state.merit + iter.monotonicity * FBE_x_new
245+
244246
return state, state
245247

246248
end

0 commit comments

Comments
 (0)