@@ -49,24 +49,7 @@ function solve(problem::Problem, algorithm::Algorithm; kwargs...)
4949 state = initialize_state (problem, algorithm; kwargs... )
5050 emit_message (logger, problem, algorithm, state, :Start )
5151
52- # main body of the algorithm
53- while ! is_finished! (problem, algorithm, state)
54- # logging event between convergence check and algorithm step
55- emit_message (logger, problem, algorithm, state, :PreStep )
56-
57- # algorithm step
58- increment! (state)
59- step! (problem, algorithm, state)
60-
61- # logging event between algorithm step and convergence check
62- emit_message (logger, problem, algorithm, state, :PostStep )
63- end
64-
65- # emit message about finished state
66- output = finalize_state! (problem, algorithm, state)
67- emit_message (logger, problem, algorithm, state, :Stop )
68-
69- return output
52+ return _solve_body! (problem, algorithm, state)
7053end
7154
7255@doc """
@@ -87,6 +70,10 @@ function solve!(problem::Problem, algorithm::Algorithm, state::State; kwargs...)
8770 initialize_state! (problem, algorithm, state; kwargs... )
8871 emit_message (logger, problem, algorithm, state, :Start )
8972
73+ return _solve_body! (problem, algorithm, state)
74+ end
75+
76+ function _solve_body! (problem:: Problem , algorithm:: Algorithm , state:: State )
9077 # main body of the algorithm
9178 while ! is_finished! (problem, algorithm, state)
9279 # logging event between convergence check and algorithm step
0 commit comments