File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ using NLPModels
8
8
9
9
include (" logger.jl" )
10
10
include (" stats.jl" )
11
+ include (" solver.jl" )
11
12
12
13
end
Original file line number Diff line number Diff line change
1
+ export AbstractSolver, AbstractOptimizationSolver, solve!
2
+
3
+ " Abstract type from which JSO solvers derive."
4
+ abstract type AbstractSolver end
5
+
6
+ abstract type AbstractOptimizationSolver <: AbstractSolver end
7
+
8
+ """
9
+ solve!(solver, model; kwargs...)
10
+ solve!(solver, model, stats; kwargs...)
11
+
12
+ Apply `solver` to `model`.
13
+
14
+ # Arguments
15
+
16
+ - `solver::AbstractOptimizationSolver`: solver structure to hold all storage necessary for a solve
17
+ - `model::AbstractNLPModel`: the model solved, see `NLPModels.jl`
18
+ - `stats::GenericExecutionStats`: stats structure to hold solution information.
19
+
20
+ The first invocation allocates and returns a new `GenericExecutionStats`.
21
+ The second one fills out a preallocated stats structure and allows for efficient re-solves.
22
+
23
+ The `kwargs` are passed to the solver.
24
+
25
+ # Return Value
26
+
27
+ - `stats::GenericExecutionStats`: stats structure holding solution information.
28
+ """
29
+ function solve! (solver:: AbstractOptimizationSolver , model:: AbstractNLPModel ; kwargs... )
30
+ stats = GenericExecutionStats (model)
31
+ solve! (solver, model, stats; kwargs... )
32
+ end
33
+
34
+ function solve! (
35
+ :: AbstractOptimizationSolver ,
36
+ :: AbstractNLPModel ,
37
+ :: GenericExecutionStats ;
38
+ kwargs... ,
39
+ ) end
You can’t perform that action at this time.
0 commit comments