diff --git a/Project.toml b/Project.toml index dc26fa2a..ee9971f6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,18 +1,16 @@ name = "Gurobi" uuid = "2e9cd046-0924-5485-92f1-d5272153d98b" repo = "https://github.com/jump-dev/Gurobi.jl" -version = "0.10.3" +version = "1.0.0" [deps] -CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [compat] -CEnum = "0.3, 0.4" -MathOptInterface = "~0.10" -julia = "1.3" +MathOptInterface = "1" +julia = "1.6" [extras] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/README.md b/README.md index dfbfe9a7..60ecd215 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,3 @@ -**Gurobi.jl underwent a major rewrite between versions 0.8.1 and 0.9.0. Users of -JuMP should see no breaking changes, but if you used the lower-level C API -(e.g., for callbacks), you will need to update your code accordingly. For a full -description of the changes, read [this discourse post](https://discourse.julialang.org/t/ann-upcoming-breaking-changes-to-cplex-jl-and-gurobi-jl/47814).** - -**To revert to the old API, use:** -```julia -import Pkg -Pkg.add(Pkg.PackageSpec(name = "Gurobi", version = v"0.8")) -``` -**Then restart Julia for the change to take effect.** - # Gurobi.jl [![Build Status](https://github.com/jump-dev/Gurobi.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/Gurobi.jl/actions?query=workflow%3ACI) diff --git a/scripts/deprecate.jl b/scripts/deprecate.jl deleted file mode 100644 index f7e8a2d4..00000000 --- a/scripts/deprecate.jl +++ /dev/null @@ -1,54 +0,0 @@ -# This file was used to create the list of deprecations when moving from v0.8.1 -# to v0.9.0. - -using Gurobi - -io = open("deprecated_functions.jl", "w") -print(io, """ -const _DEPRECATED_ERROR_MESSAGE = \"\"\" -The C API of Gurobi.jl has been rewritten to expose the complete C API, and -all old functions have been removed. - -For example: - - model = Gurobi.Optimizer() - stat = Gurobi.get_status_code(model.inner) - -is now: - - model = Gurobi.Optimizer() - valueP = Ref{Cint}() - ret = GRBgetintattr(model, "Status", valueP) - if ret != 0 - # Do something because the call failed - end - stat = valueP[] - -The new API is more verbose, but the names and function arguments are now -identical to the C API, documentation for which is available at: -https://www.gurobi.com/documentation/9.0/refman/c_api_details.html - -To revert to the old API, use: - - import Pkg - Pkg.add(Pkg.PackageSpec(name = \"Gurobi\", version = v\"0.8.1\")) - -Then restart Julia for the change to take effect. -\"\"\" -""") - -exported_names = Base.names(Gurobi; all = false) -for name in Base.names(Gurobi; all = true) - foo = getfield(Gurobi, name) - if !(foo isa Function) - continue - elseif any(startswith.(Ref(string(foo)), ["#", "@", "_"])) - continue - end - println(io, "$(foo)(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE)") - if name in exported_names - println(io, "export $(foo)") - end - println(io) -end -close(io) diff --git a/src/Gurobi.jl b/src/Gurobi.jl index a6cecdf6..11bc1bfd 100644 --- a/src/Gurobi.jl +++ b/src/Gurobi.jl @@ -22,8 +22,6 @@ else """) end -using CEnum - const _GUROBI_VERSION = if libgurobi == "julia_registryci_automerge" VersionNumber(9, 5, 1) else @@ -44,15 +42,12 @@ function _is_patch(x::VersionNumber, reference::VersionNumber) end if _is_patch(_GUROBI_VERSION, v"9.0") - include("gen90/ctypes.jl") include("gen90/libgrb_common.jl") include("gen90/libgrb_api.jl") elseif _is_patch(_GUROBI_VERSION, v"9.1") - include("gen91/ctypes.jl") include("gen91/libgrb_common.jl") include("gen91/libgrb_api.jl") elseif _is_patch(_GUROBI_VERSION, v"9.5") - include("gen95/ctypes.jl") include("gen95/libgrb_common.jl") include("gen95/libgrb_api.jl") else @@ -84,13 +79,8 @@ include("MOI_wrapper/MOI_indicator_constraint.jl") # Gurobi exports all `GRBXXX` symbols. If you don't want all of these symbols in # your environment, then use `import Gurobi` instead of `using Gurobi`. -for sym in names(@__MODULE__, all=true) - sym_string = string(sym) - if startswith(sym_string, "GRB") - @eval export $sym - end +for sym in filter(s -> startswith("$s", "GRB"), names(@__MODULE__, all = true)) + @eval export $sym end -include("deprecated_functions.jl") - end diff --git a/src/MOI_wrapper/MOI_wrapper.jl b/src/MOI_wrapper/MOI_wrapper.jl index 6b7ef4b2..d2d94eee 100644 --- a/src/MOI_wrapper/MOI_wrapper.jl +++ b/src/MOI_wrapper/MOI_wrapper.jl @@ -121,6 +121,34 @@ Base.unsafe_convert(::Type{Ptr{Cvoid}}, env::Env) = env.ptr_env::Ptr{Cvoid} const _HASH = CleverDicts.key_to_index const _INVERSE_HASH = x -> CleverDicts.index_to_key(MOI.VariableIndex, x) +""" + Optimizer( + env::Union{Nothing,Env} = nothing; + enable_interrupts::Bool = true, + ) + +Create a new Optimizer object. + +You can share Gurobi `Env`s between models by passing an instance of `Env` +as the first argument. + +In order to enable interrupts via `CTRL+C`, a no-op callback is added to the +model by default. In most cases, this has negligible effect on solution +times. However, you can disable it (at the cost of not being able to +interrupt a solve) by passing `enable_interrupts = false`. + +Set optimizer attributes using `MOI.RawOptimizerAttribute` or +`JuMP.set_optimizer_atttribute`. + +## Example + +```julia +using JuMP, Gurobi +const env = Gurobi.Env() +model = JuMP.Model(() -> Gurobi.Optimizer(env; enable_interrupts=false)) +set_optimizer_attribute(model, "OutputFlag", 0) +``` +""" mutable struct Optimizer <: MOI.AbstractOptimizer # The low-level Gurobi model. inner::Ptr{Cvoid} @@ -232,54 +260,15 @@ mutable struct Optimizer <: MOI.AbstractOptimizer conflict::Cint - """ - Optimizer( - env::Union{Nothing,Env} = nothing; - enable_interrupts::Bool = true, - ) - - Create a new Optimizer object. - - You can share Gurobi `Env`s between models by passing an instance of `Env` - as the first argument. - - In order to enable interrupts via `CTRL+C`, a no-op callback is added to the - model by default. In most cases, this has negligible effect on solution - times. However, you can disable it (at the cost of not being able to - interrupt a solve) by passing `enable_interrupts = false`. - - Set optimizer attributes using `MOI.RawOptimizerAttribute` or - `JuMP.set_optimizer_atttribute`. - - ## Example - - using JuMP, Gurobi - const env = Gurobi.Env() - model = JuMP.Model(() -> Gurobi.Optimizer(env; enable_interrupts=false)) - set_optimizer_attribute(model, "OutputFlag", 0) - """ function Optimizer( env::Union{Nothing,Env} = nothing; enable_interrupts::Bool = true, - kwargs..., ) model = new() model.inner = C_NULL model.env = env === nothing ? Env() : env model.enable_interrupts = enable_interrupts model.params = Dict{String,Any}() - if length(kwargs) > 0 - @warn("""Passing optimizer attributes as keyword arguments to - Gurobi.Optimizer is deprecated. Use - MOI.set(model, MOI.RawOptimizerAttribute("key"), value) - or - JuMP.set_optimizer_attribute(model, "key", value) - instead. - """) - end - for (name, value) in kwargs - model.params[string(name)] = value - end model.silent = false model.variable_info = CleverDicts.CleverDict{MOI.VariableIndex,_VariableInfo}( @@ -293,7 +282,6 @@ mutable struct Optimizer <: MOI.AbstractOptimizer model.quadratic_constraint_info = Dict{Int,_ConstraintInfo}() model.sos_constraint_info = Dict{Int,_ConstraintInfo}() model.indicator_constraint_info = Dict{Int,_ConstraintInfo}() - model.callback_variable_primal = Float64[] MOI.empty!(model) finalizer(model) do m diff --git a/src/deprecated_functions.jl b/src/deprecated_functions.jl deleted file mode 100644 index 1fa80f14..00000000 --- a/src/deprecated_functions.jl +++ /dev/null @@ -1,550 +0,0 @@ -const _DEPRECATED_ERROR_MESSAGE = """ -The C API of Gurobi.jl has been rewritten to expose the complete C API, and -all old functions have been removed. For more information, see the Discourse -announcement: https://discourse.julialang.org/t/ann-upcoming-breaking-changes-to-cplex-jl-and-gurobi-jl - -Here is a brief summary of the changes. - -* Constants have changed. For example `CB_MIPNODE` is now `GRB_CB_MIPNODE` - to match the C API. -* Function names have changed. For example `free_env(env)` is now - `GRBfreeenv(env)`. -* For users of `Gurobi.Optimizer()`, `model.inner` is now a pointer to the C - model, instead of a `Gurobi.Model` object. However, conversion means that - you should always pass `model` instead of `model.inner` to the low-level - functions. For example: - ```julia - model = direct_model(Gurobi.Optimizer()) - grb_model = backend(model) # grb_model is Gurobi.Optimizer - # Old - Gurobi.tune_model(grb_model.inner) - # New - GRBtunemodel(grb_model) - ``` -* Some functions have been removed entirely. For example: - ```julia - using JuMP, Gurobi - model = direct_model(Gurobi.Optimizer()) - optimize!(model) - grb_model = backend(model) - stat = Gurobi.get_status_code(grb_model.inner) - ``` - is now: - ```julia - using JuMP, Gurobi - model = direct_model(Gurobi.Optimizer()) - optimize!(model) - valueP = Ref{Cint}() - grb_model = backend(model) - ret = GRBgetintattr(grb_model, "Status", valueP) - if ret != 0 - # Do something because the call failed - end - stat = valueP[] - ``` - -The new API is more verbose, but the names and function arguments are now -identical to the C API, documentation for which is available at: -https://www.gurobi.com/documentation/9.0/refman/c_api_details.html - -To revert to the old API, use: - - import Pkg - Pkg.add(Pkg.PackageSpec(name = "Gurobi", version = v"0.8.1")) - -Then restart Julia for the change to take effect. -""" -add_bvar!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_bvar! - -add_bvars!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_bvars! - -add_constr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_constr! - -add_constrs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_constrs! - -add_constrs_t!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_constrs_t! - -add_cvar!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_cvar! - -add_cvars!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_cvars! - -add_diag_qpterms!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -add_ivar!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_ivar! - -add_ivars!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_ivars! - -add_qconstr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_qconstr! - -add_qpterms!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_qpterms! - -add_rangeconstr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_rangeconstr! - -add_rangeconstrs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_rangeconstrs! - -add_rangeconstrs_t!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_rangeconstrs_t! - -add_sos!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_sos! - -add_var!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_var! - -add_vars!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export add_vars! - -c_api_setobjectiven(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -cbcut(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbcut - -cbget(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -cbget_barrier_compl(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_barrier_compl - -cbget_barrier_dualinf(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_barrier_dualinf - -cbget_barrier_dualobj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_barrier_dualobj - -cbget_barrier_itrcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_barrier_itrcnt - -cbget_barrier_priminf(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_barrier_priminf - -cbget_barrier_primobj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_barrier_primobj - -cbget_mip_cutcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_cutcnt - -cbget_mip_itrcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_itrcnt - -cbget_mip_nodcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_nodcnt - -cbget_mip_nodlft(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_nodlft - -cbget_mip_objbnd(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_objbnd - -cbget_mip_objbst(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_objbst - -cbget_mip_solcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mip_solcnt - -cbget_mipnode_nodcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipnode_nodcnt - -cbget_mipnode_objbnd(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipnode_objbnd - -cbget_mipnode_objbst(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipnode_objbst - -cbget_mipnode_rel(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipnode_rel - -cbget_mipnode_solcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipnode_solcnt - -cbget_mipnode_status(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipnode_status - -cbget_mipsol_nodcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipsol_nodcnt - -cbget_mipsol_obj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipsol_obj - -cbget_mipsol_objbnd(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipsol_objbnd - -cbget_mipsol_objbst(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipsol_objbst - -cbget_mipsol_rel(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -cbget_mipsol_sol(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipsol_sol - -cbget_mipsol_solcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_mipsol_solcnt - -cbget_pre_bndchg(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_pre_bndchg - -cbget_pre_coechg(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_pre_coechg - -cbget_pre_coldel(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_pre_coldel - -cbget_pre_rowdel(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_pre_rowdel - -cbget_pre_senchg(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_pre_senchg - -cbget_runtime(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_runtime - -cbget_spx_dualinf(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_spx_dualinf - -cbget_spx_ispert(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_spx_ispert - -cbget_spx_itrcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_spx_itrcnt - -cbget_spx_objval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_spx_objval - -cbget_spx_priminf(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cbget_spx_priminf - -cblazy(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export cblazy - -cbsolution(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -cchar(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -check_moi_callback_validity(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -checkvalue(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -chg_coeffs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export chg_coeffs! - -computeIIS(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export computeIIS - -compute_conflict(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -copy(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -# export copy # Don't export this copy. - -cvec(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -cvecx(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -default_moi_callback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -del_constrs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export del_constrs! - -del_sos!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -del_vars!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export del_vars! - -delq!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -delqconstrs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -eval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -fixed_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export fixed_model - -free_env(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export free_env - -free_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -fvec(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -fvecx(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_barrier_iter_count(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_basis(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_charattrarray(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_charattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_charattrelement(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_charattrlist(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_charattrlist!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_constrmatrix(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export get_constrmatrix - -get_constrs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dbl_param(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dblattr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dblattrarray(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dblattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dblattrelement(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dblattrlist(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_dblattrlist!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_error_msg(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_int_param(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_intattr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_intattrarray(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_intattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_intattrelement(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_intattrlist(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_intattrlist!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_iter_count(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_multiobj_c(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_multiobj_n(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_multiobj_priority(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_multiobj_weight(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_node_count(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_objbound(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_objval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export get_objval - -get_optiminfo(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export get_optiminfo - -get_runtime(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_sol_count(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_solution(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export get_solution - -get_sos(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_sos_matrix(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_status(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export get_status - -get_status_code(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_str_param(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_strattr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_strattrarray(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_strattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_strattrelement(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -get_tune_result!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export get_tune_result! - -getcoeff(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -getcoeff!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -getlibversion(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -getparam(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export getparam - -getq(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -getqconstr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -gurobi_callback_wrapper(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -gurobi_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export gurobi_model - -include(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -is_mip(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export is_mip - -is_qcp(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export is_qcp - -is_qp(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export is_qp - -is_valid(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -ivec(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -loadbasis(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -lowerbounds(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export lowerbounds - -mastercallback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -model_name(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export model_name - -model_sense(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export model_sense - -model_type(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export model_type - -num_binvars(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -num_cnzs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_cnzs - -num_constrs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_constrs - -num_intvars(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -num_qcnzs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_qcnzs - -num_qconstrs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_qconstrs - -num_qnzs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_qnzs - -num_sos(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_sos - -num_vars(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export num_vars - -objcoeffs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export objcoeffs - -optimize(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export optimize - -presolve_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export presolve_model - -read(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -# export read # Don't export this read - -read_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export read_model - -reset_model!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export reset_model! - -set_callback_func!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export set_callback_func! - -set_charattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_charattrelement!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_charattrlist!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_dbl_param!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_dblattr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_dblattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_dblattrelement!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_dblattrlist!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_int_param!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_intattr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_intattrarray!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_intattrelement!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_intattrlist!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_multiobj!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_multiobj_c!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_multiobj_n!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_multiobj_priority!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_multiobj_weight!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_objcoeffs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export set_objcoeffs! - -set_sense!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export set_sense! - -set_str_param!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_strattr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -set_strattrelement!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -setmathprogcallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -setparam!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export setparam! - -setparams!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export setparams! - -sparse_transpose(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -terminate(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -tune_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export tune_model - -update_model!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export update_model! - -updatemodel!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) - -upperbounds(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export upperbounds - -write_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export write_model - -GurobiSolver(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) -export GurobiSolver - diff --git a/src/gen90/ctypes.jl b/src/gen90/ctypes.jl deleted file mode 100644 index 436e6ad0..00000000 --- a/src/gen90/ctypes.jl +++ /dev/null @@ -1,7 +0,0 @@ -## TODO: pending https://github.com/JuliaLang/julia/issues/29420 -# this one is suggested in the issue, but it looks like time_t and tm are two different things? -# const Ctime_t = Base.Libc.TmStruct - -const Ctm = Base.Libc.TmStruct -const Ctime_t = UInt -const Cclock_t = UInt diff --git a/src/gen91/ctypes.jl b/src/gen91/ctypes.jl deleted file mode 100644 index 436e6ad0..00000000 --- a/src/gen91/ctypes.jl +++ /dev/null @@ -1,7 +0,0 @@ -## TODO: pending https://github.com/JuliaLang/julia/issues/29420 -# this one is suggested in the issue, but it looks like time_t and tm are two different things? -# const Ctime_t = Base.Libc.TmStruct - -const Ctm = Base.Libc.TmStruct -const Ctime_t = UInt -const Cclock_t = UInt diff --git a/src/gen95/ctypes.jl b/src/gen95/ctypes.jl deleted file mode 100644 index 436e6ad0..00000000 --- a/src/gen95/ctypes.jl +++ /dev/null @@ -1,7 +0,0 @@ -## TODO: pending https://github.com/JuliaLang/julia/issues/29420 -# this one is suggested in the issue, but it looks like time_t and tm are two different things? -# const Ctime_t = Base.Libc.TmStruct - -const Ctm = Base.Libc.TmStruct -const Ctime_t = UInt -const Cclock_t = UInt diff --git a/test/runtests.jl b/test/runtests.jl index ccfc2ca2..67a0282d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -12,9 +12,3 @@ const GRB_ENV = Gurobi.Env() include(joinpath("MOI", file)) end end - -@testset "Deprecated functions" begin - err = ErrorException(Gurobi._DEPRECATED_ERROR_MESSAGE) - @test_throws err get_status() - @test_throws err Gurobi.get_status_code() -end