-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3292 from JuliaReach/schillic/solvers
Outsource solver code to separate file
- Loading branch information
Showing
5 changed files
with
38 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# default LP solver for floating-point numbers | ||
function default_lp_solver(::Type{<:AbstractFloat}) | ||
JuMP.optimizer_with_attributes(() -> GLPK.Optimizer(method=GLPK.SIMPLEX)) | ||
end | ||
|
||
# default LP solver for rational numbers | ||
function default_lp_solver(::Type{<:Rational}) | ||
JuMP.optimizer_with_attributes(() -> GLPK.Optimizer(method=GLPK.EXACT)) | ||
end | ||
|
||
# default LP solver given two possibly different numeric types | ||
function default_lp_solver(M::Type{<:Number}, N::Type{<:Number}) | ||
return default_lp_solver(promote_type(M, N)) | ||
end | ||
|
||
# check for Polyhedra backend (fallback method) | ||
function _is_polyhedra_backend(backend) | ||
return false | ||
end | ||
|
||
# default LP solver for Polyhedra (fallback method) | ||
# NOTE: exists in parallel to `default_lp_solver` because we use different | ||
# interfaces (see #1493) | ||
function default_lp_solver_polyhedra(N, kwargs...) | ||
require(@__MODULE__, :Polyhedra; fun_name="default_lp_solver_polyhedra") | ||
error("no default solver for numeric type $N") | ||
end |