Skip to content

Commit

Permalink
Fix FISTA state init
Browse files Browse the repository at this point in the history
  • Loading branch information
nHackel committed Apr 3, 2024
1 parent d923459 commit 0a7f4d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FISTA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 120 in src/FISTA.jl

View check run for this annotation

Codecov / codecov/patch

src/FISTA.jl#L120

Added line #L120 was not covered by tests
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
Expand Down

0 comments on commit 0a7f4d2

Please sign in to comment.