Skip to content

Commit a8d9bd8

Browse files
committed
add AbstractOptimizationSolver type
1 parent 39f7fee commit a8d9bd8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/solver.jl

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export AbstractSolver, solve!
33
"Abstract type from which JSO solvers derive."
44
abstract type AbstractSolver end
55

6+
abstract type AbstractOptimizationSolver <: AbstractSolver end
7+
68
"""
79
solve!(solver, model; kwargs...)
810
solve!(solver, model, stats; kwargs...)
@@ -11,7 +13,7 @@ Apply `solver` to `model`.
1113
1214
# Arguments
1315
14-
- `solver::AbstractSolver`: solver structure to hold all storage necessary for a solve
16+
- `solver::AbstractOptimizationSolver`: solver structure to hold all storage necessary for a solve
1517
- `model::AbstractNLPModel`: the model solved, see `NLPModels.jl`
1618
- `stats::GenericExecutionStats`: stats structure to hold solution information.
1719
@@ -20,9 +22,14 @@ The second one fills out a preallocated stats structure and allows for efficient
2022
2123
The `kwargs` are passed to the solver.
2224
"""
23-
function solve!(solver::AbstractSolver, model::AbstractNLPModel; kwargs...)
25+
function solve!(solver::AbstractOptimizationSolver, model::AbstractNLPModel; kwargs...)
2426
stats = GenericExecutionStats(:unknown, model)
2527
solve!(solver, model, stats; kwargs...)
2628
end
2729

28-
function solve!(::AbstractSolver, ::AbstractNLPModel, ::GenericExecutionStats; kwargs...) end
30+
function solve!(
31+
::AbstractOptimizationSolver,
32+
::AbstractNLPModel,
33+
::GenericExecutionStats;
34+
kwargs...,
35+
) end

0 commit comments

Comments
 (0)