Skip to content

Commit 1abfe57

Browse files
fix reproducibility with TR
1 parent ca4d66c commit 1abfe57

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/TR_alg.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ function TR(
159159
χ::X,
160160
options::ROSolverOptions{R};
161161
x0::AbstractVector{R} = f.meta.x0,
162-
subsolver_logger::Logging.AbstractLogger = Logging.SimpleLogger(),
163-
subsolver = R2,
162+
subsolver = R2Solver,
164163
subsolver_options = ROSolverOptions(ϵa = options.ϵa),
165164
selected::AbstractVector{<:Integer} = 1:(f.meta.nvar),
166165
kwargs...
@@ -182,6 +181,7 @@ function TR(
182181
γ = options.γ,
183182
α = options.α,
184183
β = options.β,
184+
subsolver = R2Solver,
185185
kwargs...
186186
)
187187
return stats
@@ -252,8 +252,10 @@ function SolverCore.solve!(
252252
@. l_bound_m_x .= max.(l_bound_m_x, -Δk)
253253
@. u_bound_m_x .= min.(u_bound_m_x, Δk)
254254
set_bounds!(ψ, l_bound_m_x, u_bound_m_x)
255+
set_bounds!(solver.subsolver.ψ, l_bound_m_x, u_bound_m_x)
255256
else
256257
set_radius!(ψ, Δk)
258+
set_radius!(solver.subsolver.ψ, Δk)
257259
end
258260

259261
# initialize parameters
@@ -365,7 +367,9 @@ function SolverCore.solve!(
365367
@. l_bound_m_x .= max.(l_bound_m_x, -∆_effective)
366368
@. u_bound_m_x .= min.(u_bound_m_x, ∆_effective)
367369
set_bounds!(ψ, l_bound_m_x, u_bound_m_x)
370+
set_bounds!(solver.subsolver.ψ, l_bound_m_x, u_bound_m_x)
368371
else
372+
set_radius!(solver.subsolver.ψ, ∆_effective)
369373
set_radius!(ψ, ∆_effective)
370374
end
371375

@@ -432,6 +436,7 @@ function SolverCore.solve!(
432436
@. l_bound_m_x = l_bound - xk
433437
@. u_bound_m_x = u_bound - xk
434438
set_bounds!(ψ, l_bound_m_x, u_bound_m_x)
439+
set_bounds!(solver.subsolver.ψ, l_bound_m_x, u_bound_m_x)
435440
end
436441
fk = fkn
437442
hk = hkn

0 commit comments

Comments
 (0)