Skip to content

Commit a2dc6c2

Browse files
committed
refatctor stopping criterion and is_finished.
1 parent 8d2ef32 commit a2dc6c2

2 files changed

Lines changed: 265 additions & 134 deletions

File tree

src/interface/interface.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ function initialize_state! end
1717
@doc "$(_doc_init_state)"
1818
initialize_state!(::Problem, ::Algorithm, ::State; kwargs...)
1919

20-
@doc """
21-
is_finished(problem::Problem, algorithm::Algorithm, state::State) -> Bool
22-
23-
Return `true` if the [`Algorithm`](@ref) solving the [`Problem`](@ref) at the current [`State`](@ref) is finished.
24-
"""
25-
function is_finished(problem::Problem, algorithm::Algorithm, state::State)
26-
scs = get_stopping_criterion_state(state)
27-
sc = get_stopping_criterion(algorithm)
28-
return scs(problem, algorithm, state, sc)
29-
end
30-
3120
# has to be defined before used in solve but is documented alphabetically after
3221

3322
@doc """
@@ -55,7 +44,7 @@ All keyword arguments are passed to the [`initialize_state!`](@ref)`(problem, al
5544
"""
5645
function solve!(problem::Problem, algorithm::Algorithm, state::State; kwargs...)
5746
initialize_state!(problem, algorithm, state; kwargs...)
58-
while !is_finished(problem, algorithm, state)
47+
while !is_finished!(problem, algorithm, state)
5948
increment!(state)
6049
step!(problem, algorithm, state)
6150
end

0 commit comments

Comments
 (0)