Skip to content

Commit ab5b058

Browse files
committed
remove useless assignments
1 parent 0ca6b5e commit ab5b058

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

src/algorithms/drls.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ update_direction_state!(iter::DRLSIteration, state::DRLSState) =
147147

148148
function Base.iterate(iter::DRLSIteration{R,Tx,Tf}, state::DRLSState) where {R,Tx,Tf}
149149
# retrieve merit and set threshold
150-
DRE_x = state.merit
151-
threshold = iter.dre_sign * DRE_x - iter.c / iter.gamma * norm(state.res)^2
150+
threshold = iter.dre_sign * state.merit - iter.c / iter.gamma * norm(state.res)^2
152151

153152
set_next_direction!(iter, state)
154153

src/algorithms/panoc.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,9 @@ function Base.iterate(iter::PANOCIteration{R,Tx,Tf}, state::PANOCState) where {R
193193
state.f_Ax = state.f_Ax_d
194194

195195
# retrieve merit and set threshold
196-
FBE_x = state.merit
197196
sigma = iter.beta * (0.5 / state.gamma) * (1 - iter.alpha)
198-
tol = 10 * eps(R) * (1 + abs(FBE_x))
199-
threshold = FBE_x - sigma * norm(state.res)^2 + tol
197+
tol = 10 * eps(R) * (1 + abs(state.merit))
198+
threshold = state.merit - sigma * norm(state.res)^2 + tol
200199

201200
state.y .= state.x .- state.gamma .* state.At_grad_f_Ax
202201
state.g_z = prox!(state.z, iter.g, state.y, state.gamma)

src/algorithms/panocplus.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ function Base.iterate(iter::PANOCplusIteration{R}, state::PANOCplusState) where
175175
state.res_prev .= state.res
176176

177177
# retrieve merit and set threshold
178-
FBE_x = state.merit
179178
sigma = iter.beta * (0.5 / state.gamma) * (1 - iter.alpha)
180-
tol = 10 * eps(R) * (1 + abs(FBE_x))
181-
threshold = FBE_x - sigma * norm(state.res)^2 + tol
179+
tol = 10 * eps(R) * (1 + abs(state.merit))
180+
threshold = state.merit - sigma * norm(state.res)^2 + tol
181+
FBE_x = f_model(iter, state) + state.g_z
182182

183183
tau_backtracks = 0
184184
can_update_direction = true

src/algorithms/zerofpr.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ function Base.iterate(iter::ZeroFPRIteration{R}, state::ZeroFPRState) where {R}
193193
mul!(state.Ad, iter.A, state.d)
194194

195195
# retrieve merit and set threshold
196-
FBE_x = state.merit
197196
sigma = iter.beta * (0.5 / state.gamma) * (1 - iter.alpha)
198-
tol = 10 * eps(R) * (1 + abs(FBE_x))
199-
threshold = FBE_x - sigma * norm(state.res)^2 + tol
197+
tol = 10 * eps(R) * (1 + abs(state.merit))
198+
threshold = state.merit - sigma * norm(state.res)^2 + tol
199+
FBE_x = f_model(iter, state) + state.g_xbar
200200

201201
for k = 1:iter.max_backtracks
202202
state.x .= state.xbar_prev .+ state.tau .* state.d

0 commit comments

Comments
 (0)