From 0a7f4d2ecf9e7636f175f84286f9edc88caff2c8 Mon Sep 17 00:00:00 2001 From: nHackel Date: Wed, 3 Apr 2024 17:28:04 +0200 Subject: [PATCH] Fix FISTA state init --- src/FISTA.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FISTA.jl b/src/FISTA.jl index 110c4dc9..8e54b90e 100644 --- a/src/FISTA.jl +++ b/src/FISTA.jl @@ -115,20 +115,23 @@ end (re-) initializes the FISTA iterator """ -function init!(solver::FISTA, state::FISTAState{rt, vecT}, b::vecT; x0 = 0, theta=1) where {rt, vecT} +function init!(solver::FISTA, state::FISTAState{rT, vecT}, b::vecT; x0 = 0, theta=1) where {rT, vecT} if solver.A === nothing state.x₀ .= b else mul!(state.x₀, adjoint(solver.A), b) end + state.iteration = 0 state.norm_x₀ = norm(state.x₀) state.x .= x0 state.xᵒˡᵈ .= 0 # makes no difference in 1st iteration what this is set to + state.res[:] .= rT(Inf) state.theta = theta state.thetaᵒˡᵈ = theta + state.rel_res_norm = rT(Inf) # normalization of regularization parameters solver.reg = normalize(solver, solver.normalizeReg, solver.reg, solver.A, state.x₀) end