We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@PierreMartinon We could replace
CTDirect.jl/src/solve.jl
Lines 131 to 143 in 5a2105a
by
abstract type AbstractSolverBackend end struct IpoptBackend <: AbstractSolverBackend end struct MadNLPBackend <: AbstractSolverBackend end weakdeps = Dict(IpoptBackend => :NLPModelsIpopt, MadNLPBackend => :MadNLP) function solve_docp(solver_tag::T, args...; kwargs...) where {T <: AbstractSolverBackend} throw(ExtensionError(weakdeps[T])) end
The text was updated successfully, but these errors were encountered:
@PierreMartinon We could replace CTDirect.jl/src/solve.jl Lines 131 to 143 in 5a2105a abstract type SolverTag end struct IpoptTag <: SolverTag end struct MadNLPTag <: SolverTag end function solve_docp(solver_tag, args...; kwargs...) if typeof(solver_tag) == IpoptTag throw(ExtensionError(:NLPModelsIpopt)) elseif typeof(solver_tag) == MadNLPTag throw(ExtensionError(:MadNLP)) else error("Unknown solver type", typeof(solver_tag)) end end by abstract type AbstractSolverBackend end struct IpoptBackend <: AbstractSolverBackend end struct MadNLPBackend <: AbstractSolverBackend end weakdeps = Dict(IpoptBackend => :NLPModelsIpopt, MadNLPBackend => :MadNLP) function solve_docp(solver_tag::T, args...; kwargs...) where {T <: AbstractSolverBackend} throw(ExtensionError(weakdeps[T])) end
This looks so neat and classy OO
Sorry, something went wrong.
PierreMartinon
ocots
No branches or pull requests
@PierreMartinon We could replace
CTDirect.jl/src/solve.jl
Lines 131 to 143 in 5a2105a
by
The text was updated successfully, but these errors were encountered: