Skip to content

Commit be29a75

Browse files
MaxenceGollierdpo
authored andcommitted
fix bounds initialization
1 parent 9fa6397 commit be29a75

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/LMTR_alg.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,11 @@ function SolverCore.solve!(
234234
s = solver.s
235235
has_bnds = solver.has_bnds
236236
if has_bnds
237-
l_bound = solver.l_bound
238-
u_bound = solver.u_bound
239-
l_bound_m_x = solver.l_bound_m_x
240-
u_bound_m_x = solver.u_bound_m_x
237+
l_bound_m_x, u_bound_m_x = solver.l_bound_m_x, solver.u_bound_m_x
238+
l_bound, u_bound = solver.l_bound, solver.u_bound
239+
update_bounds!(l_bound_m_x, u_bound_m_x, false, l_bound, u_bound, xk, Δk)
240+
set_bounds!(ψ, l_bound_m_x, u_bound_m_x)
241+
set_bounds!(solver.subsolver.ψ, l_bound_m_x, u_bound_m_x)
241242
end
242243

243244
# initialize parameters
@@ -309,7 +310,7 @@ function SolverCore.solve!(
309310
sqrt_ξ1_νInv = ξ1 0 ? sqrt(ξ1 / ν) : sqrt(-ξ1 / ν)
310311
solved = (ξ1 < 0 && sqrt_ξ1_νInv neg_tol) || (ξ1 0 && sqrt_ξ1_νInv atol)
311312
(ξ1 < 0 && sqrt_ξ1_νInv > neg_tol) &&
312-
error("LM: prox-gradient step should produce a decrease but ξ1 = $(ξ1)")
313+
error("LMTR: prox-gradient step should produce a decrease but ξ1 = $(ξ1)")
313314
atol += rtol * sqrt_ξ1_νInv # make stopping test absolute and relative
314315
sub_atol += rtol * sqrt_ξ1_νInv
315316

test/test_bounds.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ for (h, h_name) ∈ ((NormL0(λ), "l0"), (NormL1(λ), "l1"))
6666
NormLinf(1.0),
6767
options,
6868
x0 = x0,
69-
subsolver = TRDH,
70-
subsolver_options = subsolver_options,
69+
subsolver = TRDHSolver,
7170
)
7271
@test typeof(LMTR_out.solution) == typeof(bpdn_nls2.meta.x0)
7372
@test length(LMTR_out.solution) == bpdn_nls2.meta.nvar

0 commit comments

Comments
 (0)