diff --git a/.gitignore b/.gitignore index f938d73a..956c10f6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ *.log *.cov Manifest.toml - +scripts/*.h diff --git a/.travis.yml b/.travis.yml index 8f76a0e6..8266668d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ os: - linux julia: - 1.0 -- 1.1 -- 1.3 +- 1 notifications: email: false branches: diff --git a/Project.toml b/Project.toml index 72eaa85c..ae6ef144 100644 --- a/Project.toml +++ b/Project.toml @@ -1,26 +1,22 @@ name = "CPLEX" uuid = "a076750e-1247-5638-91d2-ce28b192dca0" repo = "https://github.com/jump-dev/CPLEX.jl" -version = "0.6.6" +version = "0.7.0" [deps] +CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] -Compat = "2, 3" +CEnum = "0.3, 0.4" MathOptInterface = "0.9.14" -MathProgBase = "~0.5.0, ~0.6, ~0.7" julia = "1" [extras] -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Compat", "Pkg", "Random", "Test"] +test = ["Random", "Test"] diff --git a/README.md b/README.md index f7433f99..8d3b3f9a 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,30 @@ +**CPLEX.jl underwent a major rewrite between versions 0.6.6 and 0.7.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.** + +**To revert to the old API, use:** +```julia +import Pkg +Pkg.add(Pkg.PackageSpec(name = "CPLEX", version = v"0.6")) +``` +**Then restart Julia for the change to take effect.** + # CPLEX.jl -`CPLEX.jl` is an interface to the [IBM® ILOG® CPLEX® Optimization -Studio](https://www.ibm.com/products/ilog-cplex-optimization-studio). It -provides an interface to the low-level C API, as well as an implementation of -the solver-independent -[`MathProgBase`](https://github.com/JuliaOpt/MathProgBase.jl) and -[`MathOptInterface`](https://github.com/jump-dev/MathOptInterface.jl) API's. +CPLEX.jl is a wrapper for the [IBM® ILOG® CPLEX® Optimization +Studio](https://www.ibm.com/products/ilog-cplex-optimization-studio) -You cannot use `CPLEX.jl` without having purchased and installed a copy of CPLEX +You cannot use CPLEX.jl without having purchased and installed a copy of CPLEX Optimization Studio from [IBM](http://www.ibm.com/). However, CPLEX is available for free to [academics and students](http://ibm.biz/Bdzvqw). -This package is available free of charge and in no way replaces or alters any -functionality of IBM's CPLEX Optimization Studio product. +CPLEX.jl has two components: + - a thin wrapper around the complete C API + - an interface to [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl) + +The C API can be accessed via `CPLEX.CPXxx` functions, where the names and +arguments are identical to the C API. See the [CPLEX documentation](https://www.gurobi.com/documentation/9.0/refman/c_api_details.html) +for details. *Note: This wrapper is maintained by the JuMP community and is not officially supported by IBM. However, we thank IBM for providing us with a @@ -21,42 +33,109 @@ interested in official support for CPLEX in Julia, let them know!.* ## Installation -First, you must obtain a copy of the CPLEX software and a license. Then, set the -appropriate environment variable and run `Pkg.add("CPLEX")`. - +First, obtain a license of CPLEX and install CPLEX solver, following the +instructions on [IBM's website](http://www.gurobi.com). Then, set the +`CPLEX_STUDIO_BINARIES` environment variable as appropriate and run +`Pkg.add("CPLEX")`, then `Pkg.build("CPLEX")`. For example: ```julia -# Linux -ENV["CPLEX_STUDIO_BINARIES"] = "/path/to/cplex/bin/x86-64_linux" - -# OSX -ENV["CPLEX_STUDIO_BINARIES"] = "/path/to/cplex/bin/x86-64_osx" +# On Windows, this might be +ENV["CPLEX_STUDIO_BINARIES"] = "C:\\Program Files\\CPLEX_Studio1210\\cplex\\bin\\x86-64_win\\" +import Pkg +Pkg.add("CPLEX") +Pkg.build("CPLEX") -# Windows -ENV["CPLEX_STUDIO_BINARIES"] = "C:/IBM/CPLEX_Studio128/cplex/bin/x64_win64" +# On OSX, this might be +ENV["CPLEX_STUDIO_BINARIES"] = "/Applications/CPLEX_Studio1210/cplex/bin/x86-64_osx/" +import Pkg +Pkg.add("CPLEX") +Pkg.build("CPLEX") +# On Unix, this might be +ENV["CPLEX_STUDIO_BINARIES"] = "/opt/CPLEX_Studio1210/cplex/bin/x86-64_linux/" import Pkg Pkg.add("CPLEX") +Pkg.build("CPLEX") ``` - -## Help! I got `LoadError: Unable to locate CPLEX installation` - -Which version of CPLEX are you trying to install? Currently, CPLEX.jl only -supports 12.8, 12.9, and 12.10 given recent changes to -[the API](https://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.9.0/ilog.odms.studio.help/CPLEX/ReleaseNotes/topics/releasenotes1290/removed.html). - -If you want to support newer versions of CPLEX not listed above, [file an -issue](https://github.com/jump-dev/CPLEX.jl/issues/new) with the version -number you'd like to support. Some steps need to be taken (like checking for -new or renamed parameters) before CPLEX.jl can support new versions. +**Note: your path may differ. Check which folder you installed CPLEX in, and +update the path accordingly.** ## Use with JuMP -You can use CPLEX with JuMP via the `CPLEX.Optimizer()` solver. -Set solver parameters using `set_optimizer_attribute` from `JuMP`: +We highly recommend that you use the *CPLEX.jl* package with higher level +packages such as [JuMP.jl](https://github.com/jump-dev/JuMP.jl). +This can be done using the ``CPLEX.Optimizer`` object. Here is how to create a +*JuMP* model that uses CPLEX as the solver. ```julia +using JuMP, CPLEX + model = Model(CPLEX.Optimizer) set_optimizer_attribute(model, "CPX_PARAM_EPINT", 1e-8) ``` -Parameters match those of the C API in the [CPLEX documentation](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/introListAlpha.html). +Parameters match those of the C API in the [CPLEX documentation](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/introListAlpha.html). + +## Callbacks + +Here is an example using CPLEX's solver-specific callbacks. + +```julia +using JuMP, CPLEX, Test + +model = direct_model(CPLEX.Optimizer()) +set_silent(model) + +# This is very, very important!!! Only use callbacks in single-threaded mode. +MOI.set(model, MOI.NumberOfThreads(), 1) + +@variable(model, 0 <= x <= 2.5, Int) +@variable(model, 0 <= y <= 2.5, Int) +@objective(model, Max, y) +cb_calls = Clong[] +function my_callback_function(cb_data::CPLEX.CallbackContext, context_id::Clong) + # You can reference variables outside the function as normal + push!(cb_calls, context_id) + # You can select where the callback is run + if context_id != CPX_CALLBACKCONTEXT_CANDIDATE + return + end + # You can query CALLBACKINFO items + valueP = Ref{Cdouble}() + ret = CPXcallbackgetinfodbl(cb_data, CPXCALLBACKINFO_BEST_BND, valueP) + @info "Best bound is currently: $(valueP[])" + # As well as any other C API + x_p = Vector{Cdouble}(undef, 2) + obj_p = Ref{Cdouble}() + ret = CPXcallbackgetincumbent(cb_data, x_p, 0, 1, obj_p) + if ret == 0 + @info "Objective incumbent is: $(obj_p[])" + @info "Incumbent solution is: $(x_p)" + # Use CPLEX.column to map between variable references and the 1-based + # column. + x_col = CPLEX.column(cb_data, index(x)) + @info "x = $(x_p[x_col])" + else + # Unable to query incumbent. + end + + # Before querying `callback_value`, you must call: + CPLEX.load_callback_variable_primal(cb_data, context_id) + x_val = callback_value(cb_data, x) + y_val = callback_value(cb_data, y) + # You can submit solver-independent MathOptInterface attributes such as + # lazy constraints, user-cuts, and heuristic solutions. + if y_val - x_val > 1 + 1e-6 + con = @build_constraint(y - x <= 1) + MOI.submit(model, MOI.LazyConstraint(cb_data), con) + elseif y_val + x_val > 3 + 1e-6 + con = @build_constraint(y + x <= 3) + MOI.submit(model, MOI.LazyConstraint(cb_data), con) + end +end +MOI.set(model, CPLEX.CallbackFunction(), my_callback_function) +optimize!(model) +@test termination_status(model) == MOI.OPTIMAL +@test primal_status(model) == MOI.FEASIBLE_POINT +@test value(x) == 1 +@test value(y) == 2 +``` diff --git a/deps/build.jl b/deps/build.jl index 51e56f80..8d7a8bfa 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,12 +1,12 @@ using Libdl -const depsfile = joinpath(dirname(@__FILE__), "deps.jl") -if isfile(depsfile) - rm(depsfile) +const _DEPS_FILE = joinpath(dirname(@__FILE__), "deps.jl") +if isfile(_DEPS_FILE) + rm(_DEPS_FILE) end function write_depsfile(path) - open(depsfile, "w") do f + open(_DEPS_FILE, "w") do f println(f, "const libcplex = \"$(escape_string(path))\"") end end @@ -32,7 +32,7 @@ function try_local_installation() # the path (directly the callable library or # the CPLEX executable) or from # an environment variable. cpxvers = [ - "128", "1280", "129", "1290", "1210", "12100" + "1210", "12100" ] base_env = "CPLEX_STUDIO_BINARIES" @@ -56,19 +56,47 @@ function try_local_installation() # Perform the actual search in the potential places. for l in libnames d = Libdl.dlopen_e(l) - d == C_NULL && continue + if d == C_NULL + continue + end write_depsfile(Libdl.dlpath(d)) @info("Using CPLEX found in location `$(l)`") return end - error( - "Unable to locate CPLEX installation. Note this must be downloaded " * - "separately. See the CPLEX.jl README for further instructions." - ) + error(""" + Unable to locate CPLEX installation. Note this must be downloaded separately. + + You should set the `CPLEX_STUDIO_BINARIES` environment variable to point to + the install location then try again. For example (updating the path to the + correct location if needed): + + ``` + # On Windows, this might be + ENV["CPLEX_STUDIO_BINARIES"] = "C:\\\\Program Files\\\\CPLEX_Studio1210\\\\cplex\\\\bin\\\\x86-64_win\\\\" + import Pkg + Pkg.add("CPLEX") + Pkg.build("CPLEX") + + # On OSX, this might be + ENV["CPLEX_STUDIO_BINARIES"] = "/Applications/CPLEX_Studio1210/cplex/bin/x86-64_osx/" + import Pkg + Pkg.add("CPLEX") + Pkg.build("CPLEX") + + # On Unix, this might be + ENV["CPLEX_STUDIO_BINARIES"] = "/opt/CPLEX_Studio1210/cplex/bin/x86-64_linux/" + import Pkg + Pkg.add("CPLEX") + Pkg.build("CPLEX") + ``` + + See the CPLEX.jl README at https://github.com/jump-dev/CPLEX.jl for further + instructions. + """) end function try_travis_installation() - url = ENV["SECRET_CPLEX_URL"] + url = ENV["SECRET_CPLEX_URL_12100"] local_filename = joinpath(@__DIR__, "libcplex.so") download(url, local_filename) write_depsfile(local_filename) diff --git a/scripts/Project.toml b/scripts/Project.toml new file mode 100644 index 00000000..f4262519 --- /dev/null +++ b/scripts/Project.toml @@ -0,0 +1,5 @@ +[deps] +Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31" + +[compat] +Clang = "0.12" diff --git a/scripts/clang.jl b/scripts/clang.jl new file mode 100644 index 00000000..5a8eae5c --- /dev/null +++ b/scripts/clang.jl @@ -0,0 +1,77 @@ +# TODO(odow): +# +# This script can be used to build the C interface to CPLEX. However, it +# requires you to manually do the following steps first: +# +# 1) Copy cplex.h from CPLEX into this /scripts directory +# 2) Copy cpxconst.h from CPLEX into this /scripts directory +# +# You should also check for an updated version of Clang.jl, and update if one is +# available. + +import Clang + +const LIBCPX_HEADERS = [ + joinpath(@__DIR__, "cplex.h"), + joinpath(@__DIR__, "cpxconst.h"), +] + +const GEN_DIR = joinpath(dirname(@__DIR__), "src", "gen") + +wc = Clang.init( + headers = LIBCPX_HEADERS, + output_file = joinpath(GEN_DIR, "libcpx_api.jl"), + common_file = joinpath(GEN_DIR, "libcpx_common.jl"), + clang_args = String[ + "-I" * header for header in Clang.find_std_headers() + ], + header_wrapped = (root, current) -> root == current, + header_library = x -> "libcplex", + clang_diagnostics = true, +) + +run(wc) + +function manual_corrections_common() + filename = joinpath(GEN_DIR, "libcpx_common.jl") + lines = readlines(filename; keep = true) + for (i, line) in enumerate(lines) + if occursin("CPXINT_MAX", line) + lines[i] = replace(line, "= INT_MAX" => "= $(typemax(Cint))") + elseif occursin("CPXINT_MIN", line) + lines[i] = replace(line, "= INT_MIN" => "= $(typemin(Cint))") + elseif occursin("= version", line) + lines[i] = replace(line, "= version" => "= nothing") + elseif occursin("= NAN", line) + lines[i] = replace(line, "= NAN" => "= NaN") + elseif occursin("# Skipping Typedef: CXType_FunctionProto ", line) + lines[i] = replace( + replace( + line, + "# Skipping Typedef: CXType_FunctionProto " => "const " + ), + '\n' => " = Ptr{Cvoid}\n" + ) + end + end + open(filename, "w") do io + print.(Ref(io), lines) + end +end +manual_corrections_common() + +function manual_corrections_api() + filename = joinpath(GEN_DIR, "libcpx_api.jl") + lines = readlines(filename; keep = true) + for (i, line) in enumerate(lines) + if occursin("Cstring", line) + lines[i] = replace(line, "Cstring" => "Ptr{Cchar}") + end + end + open(filename, "w") do io + print.(Ref(io), lines) + end +end +manual_corrections_api() + +rm(joinpath(GEN_DIR, "LibTemplate.jl")) diff --git a/scripts/deprecate.jl b/scripts/deprecate.jl new file mode 100644 index 00000000..e22cf880 --- /dev/null +++ b/scripts/deprecate.jl @@ -0,0 +1,64 @@ +# This file was used to create the list of deprecations when moving from v0.6.6 +# to v0.7.0. + +using CPLEX + +io = open("deprecated_functions.jl", "w") +print(io, """ +const _DEPRECATED_ERROR_MESSAGE = \"\"\" +The C API of CPLEX.jl has been rewritten to expose the complete C API, and +all old functions have been removed. + +For example: + + is_point = CPLEX.cbcandidateispoint(cb_data) + +is now: + + is_point_P = Ref{Cint}() + CPXcallbackcandidateispoint(cb_data, is_point_P) + if ret != 0 + # Do something because the call failed + end + is_point = is_point_P[] + +For users of `CPLEX.Optimizer`, `model.inner` has been replaced by the fields +`model.env` and `model.lp`, which correspond to the environment and problem +pointers at the C API level. + +For example: + + stat = CPLEX.get_status(model.inner) + +is now: + + stat = CPXgetstat(model.env, model.lp) + +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.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/refcallablelibrary/groups/homepagecallable.html + +To revert to the old API, use: + + import Pkg + Pkg.add(Pkg.PackageSpec(name = \"CPLEX\", version = v\"0.6\")) + +Then restart Julia for the change to take effect. +\"\"\" +""") + +exported_names = Base.names(CPLEX; all = false) +for name in Base.names(CPLEX; all = true) + foo = getfield(CPLEX, 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/CPLEX.jl b/src/CPLEX.jl index f6553660..5bf631c0 100644 --- a/src/CPLEX.jl +++ b/src/CPLEX.jl @@ -1,113 +1,72 @@ -__precompile__() - module CPLEX - using Libdl - @static if Sys.isapple() - Libdl.dlopen("libstdc++",Libdl.RTLD_GLOBAL) - end +const _DEPS_FILE = joinpath(dirname(@__DIR__), "deps", "deps.jl") +if isfile(_DEPS_FILE) + include(_DEPS_FILE) +else + error("CPLEX not properly installed. Please run Pkg.build(\"CPLEX\")") +end - if isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl")) - include("../deps/deps.jl") - else - error("CPLEX not properly installed. Please run Pkg.build(\"CPLEX\")") - end +using CEnum +import SparseArrays + +include("gen/ctypes.jl") +include("gen/libcpx_common.jl") +include("gen/libcpx_api.jl") + +const _CPLEX_VERSION = let + status_p = Ref{Cint}() + env = CPXopenCPLEX(status_p) + p = CPXversion(env) + version_string = unsafe_string(p) + CPXcloseCPLEX(Ref(env)) + VersionNumber(parse.(Int, split(version_string, ".")[1:3])...) +end + +if !(v"12.10.0" <= _CPLEX_VERSION < v"12.11") + error(""" + You have installed version $_CPLEX_VERSION of CPLEX, which is not supported + by CPLEX.jl. We require CPLEX version 12.10. - ### imports - import Base: convert, unsafe_convert, show, copy + After installing CPLEX 12.10, run: - # Standard LP interface - using MathProgBase.SolverInterface + import Pkg + Pkg.rm("CPLEX") + Pkg.add("CPLEX") - # exported functions - # export is_valid, - # set_logfile, - # get_error_msg, - # read_model, - # write_model, - # get_sense, - # set_sense!, - # get_obj, - # set_obj!, - # set_warm_start!, - # free_problem, - # close_CPLEX, - # get_param_type, - # set_param!, - # get_param, - # add_vars!, - # add_var!, - # get_varLB, - # set_varLB!, - # get_varUB, - # set_varUB!, - # set_vartype!, - # get_vartype, - # num_var, - # add_constrs!, - # add_constrs_t!, - # add_rangeconstrs!, - # add_rangeconstrs_t!, - # num_constr, - # get_constr_senses, - # set_constr_senses!, - # get_rhs, - # set_rhs!, - # get_constrLB, - # get_constrUB, - # set_constrLB!, - # set_constrUB!, - # get_nnz, - # get_constr_matrix, - # set_sos!, - # add_qpterms!, - # add_diag_qpterms!, - # add_qconstr!, - # optimize!, - # get_objval, - # get_solution, - # get_reduced_costs, - # get_constr_duals, - # get_constr_solution, - # get_infeasibility_ray, - # get_unbounded_ray, - # get_status, - # get_status_code, - # setcallbackcut, - # cbcut, - # cblazy, - # cbget_mipnode_rel, - # cbget_mipsol_sol, - # cplex_model + Make sure you set the environment variable `CPLEX_STUDIO_BINARIES` following + the instructions in the CPLEX.jl README, which is available at + https://github.com/jump-dev/CPLEX.jl. - using SparseArrays - using LinearAlgebra + If you have a newer version of CPLEX installed, changes may need to be made + to the Julia code. Please open an issue at + https://github.com/jump-dev/CPLEX.jl. + """) +end + +include("MOI/MOI_wrapper.jl") +include("MOI/MOI_callbacks.jl") +include("MOI/conflicts.jl") +include("MOI/indicator_constraint.jl") + +# CPLEX exports all `CPXxxx` symbols. If you don't want all of these symbols in +# your environment, then use `import CPLEX` instead of `using CPLEX`. + +for sym in names(@__MODULE__, all=true) + sym_string = string(sym) + if startswith(sym_string, "CPX") + @eval export $sym + end +end - include("cpx_common.jl") - include("cpx_env.jl") - v = version() - if startswith(v,"12.8") - include("full_defines_1280.jl") - include("cpx_params_1280.jl") - elseif startswith(v,"12.9") - include("full_defines_1290.jl") - include("cpx_params_1290.jl") - elseif startswith(v, "12.10") - include("full_defines_12100.jl") - include("cpx_params_12100.jl") - else - error("Unsupported CPLEX version $v. Only 12.8, 12.9, and 12.10 are currently supported.") +include("deprecated_functions.jl") + +# Special overload to deprecate the `model.inner` field access. +function Base.getproperty(opt::Optimizer, key::Symbol) + if key == :inner + error(_DEPRECATED_ERROR_MESSAGE) end - include("cpx_model.jl") - include("cpx_params.jl") - include("cpx_vars.jl") - include("cpx_constrs.jl") - include("cpx_quad.jl") - include("cpx_solve.jl") - include("cpx_callbacks.jl") - include("cpx_highlevel.jl") - include("cpx_generic_callbacks.jl") + return getfield(opt, key) +end - include("CplexSolverInterface.jl") - include("MOI/MOI_wrapper.jl") end diff --git a/src/CplexSolverInterface.jl b/src/CplexSolverInterface.jl deleted file mode 100644 index 74a18e88..00000000 --- a/src/CplexSolverInterface.jl +++ /dev/null @@ -1,919 +0,0 @@ -using MathProgBase -export CplexSolver - -mutable struct CplexMathProgModel <: AbstractLinearQuadraticModel - inner::Model - lazycb - cutcb - heuristiccb - branchcb - incumbentcb - infocb - solvetime::Float64 - mipstart_effortlevel::Cint - heuristic_buffer::Vector{Float64} -end - -function CplexMathProgModel(;mipstart_effortlevel::Cint = CPX_MIPSTART_AUTO, options...) - env = Env() - # set_param!(env, "CPX_PARAM_MIPCBREDLP", 0) # access variables in original problem, not presolved - # set_param!(env, "CPX_PARAM_PRELINEAR", 0) # MAY NOT BE NECESSARY, only performs linear presolving so can recover original variables - set_param!(env, "CPX_PARAM_SCRIND", 1) # output logs to stdout by default - for (name,value) in options - set_param!(env, string(name), value) - end - - m = CplexMathProgModel(Model(env), nothing, nothing, nothing, nothing, nothing, nothing, NaN, mipstart_effortlevel, []) - return m -end - -mutable struct CplexSolver <: AbstractMathProgSolver - options -end -CplexSolver(;kwargs...) = CplexSolver(kwargs) -MathProgBase.LinearQuadraticModel(s::CplexSolver) = CplexMathProgModel(;s.options...) - -MathProgBase.ConicModel(s::CplexSolver) = LPQPtoConicBridge(LinearQuadraticModel(s)) -MathProgBase.supportedcones(::CplexSolver) = [:Free,:Zero,:NonNeg,:NonPos,:SOC] - -function MathProgBase.setparameters!(s::CplexSolver; mpboptions...) - opts = collect(Any,s.options) - for (optname, optval) in mpboptions - if optname == :TimeLimit - push!(opts, (:CPX_PARAM_TILIM, optval)) - elseif optname == :Silent - if optval == true - push!(opts, (:CPX_PARAM_SCRIND, 0)) - end - else - error("Unrecognized parameter $optname") - end - end - s.options = opts - return -end - -function MathProgBase.setparameters!(m::CplexMathProgModel; mpboptions...) - for (optname, optval) in mpboptions - if optname == :TimeLimit - setparam!(m.inner, "CPX_PARAM_TILIM", optval) - elseif optname == :Silent - if optval == true - setparam!(m.inner,"CPX_PARAM_SCRIND",0) - end - else - error("Unrecognized parameter $optname") - end - end -end - -function MathProgBase.loadproblem!(m::CplexMathProgModel, filename::String) - read_model(m.inner, filename) -end - -function MathProgBase.loadproblem!(m::CplexMathProgModel, A, collb, colub, obj, rowlb, rowub, sense) - # throw away old model but keep env - m.inner = Model(m.inner.env) - add_vars!(m.inner, float(obj), float(collb), float(colub)) - - neginf = typemin(eltype(rowlb)) - posinf = typemax(eltype(rowub)) - - rangeconstrs = any((rowlb .!= rowub) .& (rowlb .> neginf) .& (rowub .< posinf)) - if rangeconstrs - warn("Julia Cplex interface doesn't properly support range (two-sided) constraints.") - add_rangeconstrs!(m.inner, float(A), float(rowlb), float(rowub)) - else - b = Vector{Float64}(undef, length(rowlb)) - senses = Vector{Cchar}(undef, length(rowlb)) - for i in 1:length(rowlb) - if rowlb[i] == rowub[i] - senses[i] = 'E' - b[i] = rowlb[i] - elseif rowlb[i] > neginf - senses[i] = 'G' - b[i] = rowlb[i] - else - @assert rowub[i] < posinf - senses[i] = 'L' - b[i] = rowub[i] - end - end - add_constrs!(m.inner, float(A), senses, b) - end - - set_sense!(m.inner, sense) -end - -MathProgBase.writeproblem(m::CplexMathProgModel, filename::String) = write_model(m.inner, filename) - -MathProgBase.getvarLB(m::CplexMathProgModel) = get_varLB(m.inner) -MathProgBase.setvarLB!(m::CplexMathProgModel, l) = set_varLB!(m.inner, l) -MathProgBase.getvarUB(m::CplexMathProgModel) = get_varUB(m.inner) -MathProgBase.setvarUB!(m::CplexMathProgModel, u) = set_varUB!(m.inner, u) - -# CPXchgcoef -MathProgBase.getconstrLB(m::CplexMathProgModel) = get_constrLB(m.inner) -MathProgBase.setconstrLB!(m::CplexMathProgModel, lb) = set_constrLB!(m.inner, lb) -MathProgBase.getconstrUB(m::CplexMathProgModel) = get_constrUB(m.inner) -MathProgBase.setconstrUB!(m::CplexMathProgModel, ub) = set_constrUB!(m.inner, ub) - -MathProgBase.getobj(m::CplexMathProgModel) = get_obj(m.inner) -MathProgBase.setobj!(m::CplexMathProgModel, c) = set_obj!(m.inner, c) - -MathProgBase.addvar!(m::CplexMathProgModel, l, u, coeff) = add_var!(m.inner, [], [], l, u, coeff) -MathProgBase.addvar!(m::CplexMathProgModel, constridx, constrcoef, l, u, coeff) = add_var!(m.inner, constridx, constrcoef, l, u, coeff) - -function MathProgBase.addconstr!(m::CplexMathProgModel, varidx, coef, lb, ub) - neginf = typemin(eltype(lb)) - posinf = typemax(eltype(ub)) - - rangeconstrs = any((lb .!= ub) & (lb .> neginf) & (ub .< posinf)) - if rangeconstrs - warn("Julia Cplex interface doesn't properly support range (two-sided) constraints.") - add_rangeconstrs!(m.inner, [0], varidx, float(coef), float(lb), float(ub)) - else - if lb == ub - rel = 'E' - rhs = lb - elseif lb > neginf - rel = 'G' - rhs = lb - else - @assert ub < posinf - rel = 'L' - rhs = ub - end - add_constrs!(m.inner, ivec([1]), ivec(varidx), fvec(coef), convert(Vector{Cchar},[rel]), fvec(vec(collect(rhs)))) - end -end - -MathProgBase.getconstrmatrix(m::CplexMathProgModel) = get_constr_matrix(m.inner) - -MathProgBase.setsense!(m::CplexMathProgModel, sense) = set_sense!(m.inner, sense) - -MathProgBase.getsense(m::CplexMathProgModel) = get_sense(m.inner) - -MathProgBase.numvar(m::CplexMathProgModel) = num_var(m.inner) -MathProgBase.numconstr(m::CplexMathProgModel) = num_constr(m.inner) + num_qconstr(m.inner) -MathProgBase.numlinconstr(m::CplexMathProgModel) = num_constr(m.inner) -MathProgBase.numquadconstr(m::CplexMathProgModel) = num_qconstr(m.inner) - -# MathProgBase.optimize!(m::CplexMathProgModel) = optimize!(m.inner) - -function MathProgBase.optimize!(m::CplexMathProgModel) - # set callbacks if present - if m.lazycb != nothing - setmathproglazycallback!(m) - end - if m.cutcb != nothing - setmathprogcutcallback!(m) - end - if m.heuristiccb != nothing - setmathprogheuristiccallback!(m) - end - if m.branchcb != nothing - setmathprogbranchcallback!(m) - end - if m.incumbentcb != nothing - setmathprogincumbentcallback!(m) - end - if m.infocb != nothing - setmathproginfocallback!(m) - end - start = time() - optimize!(m.inner) - m.solvetime = time() - start -end - -function MathProgBase.status(m::CplexMathProgModel) - ret = get_status(m.inner) - return (if ret in [:CPX_STAT_OPTIMAL, :CPXMIP_OPTIMAL, :CPXMIP_OPTIMAL_TOL] - :Optimal - elseif ret in [:CPX_STAT_UNBOUNDED, :CPXMIP_UNBOUNDED] - :Unbounded - elseif ret in [:CPX_STAT_INFEASIBLE, :CPXMIP_INFEASIBLE] - :Infeasible - elseif ret in [:CPX_STAT_INForUNBD, :CPXMIP_INForUNBD] - @warn("CPLEX reported infeasible or unbounded. Set CPX_PARAM_REDUCE=1 to check - infeasibility or CPX_PARAM_REDUCE=2 to check unboundedness.") - :InfeasibleOrUnbounded - elseif occursin("TIME_LIM", string(ret)) || occursin("MIP_ABORT", string(ret)) - :UserLimit - else - ret - end) -end - -MathProgBase.getobjval(m::CplexMathProgModel) = get_objval(m.inner) -MathProgBase.getobjbound(m::CplexMathProgModel) = get_best_bound(m.inner) -MathProgBase.getsolution(m::CplexMathProgModel) = get_solution(m.inner) -MathProgBase.getconstrsolution(m::CplexMathProgModel) = get_constr_solution(m.inner) -MathProgBase.getreducedcosts(m::CplexMathProgModel) = get_reduced_costs(m.inner) -MathProgBase.getconstrduals(m::CplexMathProgModel) = get_constr_duals(m.inner) -MathProgBase.getrawsolver(m::CplexMathProgModel) = m.inner -MathProgBase.getnodecount(m::CplexMathProgModel) = get_node_count(m.inner) - -const var_type_map = Dict( - 'C' => :Cont, - 'B' => :Bin, - 'I' => :Int, - 'S' => :SemiCont, - 'N' => :SemiInt -) - -const rev_var_type_map = Dict( - :Cont => 'C', - :Bin => 'B', - :Int => 'I', - :SemiCont => 'S', - :SemiInt => 'N' -) - -function MathProgBase.setvartype!(m::CplexMathProgModel, v::Vector{Symbol}) - target_int = all(x->isequal(x,:Cont), v) - prob_type = get_prob_type(m.inner) - if target_int - if m.inner.has_sos # if it has sos we need to keep has_int==true and the MI(prob_type) version. - set_vartype!(m.inner, map(x->rev_var_type_map[x], v)) - else - m.inner.has_int = false - if !(prob_type in [:LP,:QP,:QCP]) - toggleproblemtype!(m) - end - end - else - if prob_type in [:LP,:QP,:QCP] - toggleproblemtype!(m) - end - set_vartype!(m.inner, map(x->rev_var_type_map[x], v)) - end - return nothing -end - -const prob_type_toggle_map = Dict( - :LP => :MILP, - :MILP => :LP, - :QP => :MIQP, - :MIQP => :QP, - :QCP => :MIQCP, - :MIQCP => :QCP -) - -function toggleproblemtype!(m::CplexMathProgModel) - prob_type = get_prob_type(m.inner) - set_prob_type!(m.inner, prob_type_toggle_map[prob_type]) -end - -function MathProgBase.getvartype(m::CplexMathProgModel) - if m.inner.has_int - return map(x->var_type_map[x], get_vartype(m.inner)) - else - return fill(:Cont, num_var(m.inner)) - end -end - -function MathProgBase.getsolvetime(m::CplexMathProgModel) - return m.solvetime -end - -MathProgBase.getinfeasibilityray(m::CplexMathProgModel) = get_infeasibility_ray(m.inner) -MathProgBase.getunboundedray(m::CplexMathProgModel) = get_unbounded_ray(m.inner) - -MathProgBase.getbasis(m::CplexMathProgModel) = get_basis(m.inner) - -function MathProgBase.setwarmstart!(m::CplexMathProgModel, v) - # This means that warm starts are ignored if you haven't called setvartype! first - if m.inner.has_int - set_warm_start!(m.inner, v, m.mipstart_effortlevel) - end -end - -MathProgBase.addsos1!(m::CplexMathProgModel, idx, weight) = add_sos!(m.inner, :SOS1, idx, weight) -MathProgBase.addsos2!(m::CplexMathProgModel, idx, weight) = add_sos!(m.inner, :SOS2, idx, weight) - -###### -# QCQP -###### -MathProgBase.addquadconstr!(m::CplexMathProgModel, linearidx, linearval, quadrowidx, quadcolidx, quadval, sense, rhs) = - add_qconstr!(m.inner,linearidx,linearval,quadrowidx,quadcolidx,quadval,sense,rhs) -MathProgBase.setquadobj!(m::CplexMathProgModel,rowidx,colidx,quadval) = add_qpterms!(m.inner,rowidx,colidx,quadval) - -###### -# Data -###### -function getdettime(m::CplexMathProgModel) - tim = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getdettime, Cint, (Ptr{Cvoid},Ptr{Cdouble}), m.inner.env.ptr, tim) - if stat != 0 - error(CplexError(m.inner.env, stat).msg) - end - return tim[1] -end - -MathProgBase.getobjgap(m::CplexMathProgModel) = get_rel_gap(m.inner) - -########### -# Callbacks -########### -export cbaddboundbranchup!, - cbaddboundbranchdown!, - setmathprogbranchcallback!, - cbgetnodelb, - cbgetnodeub, - cbgetnodeobjval, - cbgetnodesleft, - cbgetmipiterations, - cbgetfeasibility, - cbgetgap, - cbgetstarttime, - cbgetdetstarttime, - cbgettimestamp, - cbgetdettimestamp, - cbgetintfeas - -abstract type CplexCallbackData <: MathProgCallbackData end - -# set to nothing to clear callback -MathProgBase.setlazycallback!(m::CplexMathProgModel,f) = (m.lazycb = f) -MathProgBase.setcutcallback!(m::CplexMathProgModel,f) = (m.cutcb = f) -MathProgBase.setheuristiccallback!(m::CplexMathProgModel,f) = (m.heuristiccb = f) -setbranchcallback!(m::CplexMathProgModel,f) = (m.branchcb = f) -setincumbentcallback!(m::CplexMathProgModel,f) = (m.incumbentcb = f) -MathProgBase.setinfocallback!(m::CplexMathProgModel,f) = (m.infocb = f) - -function MathProgBase.cbgetmipsolution(d::CplexCallbackData) - @assert d.state == :MIPSol || d.state == :MIPIncumbent - n = num_var(d.cbdata.model) - sol = Vector{Cdouble}(undef, n) - stat = @cpx_ccall(getcallbacknodex, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, sol, 0, n-1) - if stat != 0 - error(CplexError(d.cbdata.model.env, stat).msg) - end - return sol -end - -function MathProgBase.cbgetmipsolution(d::CplexCallbackData, sol::Vector{Cdouble}) - @assert d.state == :MIPSol - stat = @cpx_ccall(getcallbacknodex, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, sol, 0, length(sol)-1) - if stat != 0 - error(CplexError(d.cbdata.model.env, stat).msg) - end - return nothing -end - -function MathProgBase.cbgetlpsolution(d::CplexCallbackData) - @assert d.state == :MIPNode || d.state == :MIPBranch - n = num_var(d.cbdata.model) - sol = Vector{Cdouble}(undef, n) - stat = @cpx_ccall(getcallbacknodex, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, sol, 0, n-1) - if stat != 0 - error(CplexError(d.cbdata.model.env, stat).msg) - end - return sol -end - -function MathProgBase.cbgetlpsolution(d::CplexCallbackData, sol::Vector{Cdouble}) - @assert d.state == :MIPNode || d.state == :MIPIncumbent || d.state == :MIPBranch - stat = @cpx_ccall(getcallbacknodex, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, sol, 0, length(sol)-1) - if stat != 0 - error(CplexError(d.cbdata.model.env, stat).msg) - end - return nothing -end - -for (func,param,typ) in ((:cbgetexplorednodes,CPX_CALLBACK_INFO_NODE_COUNT_LONG,:Int64), - (:cbgetobj,CPX_CALLBACK_INFO_BEST_INTEGER,:Cdouble), - (:cbgetbestbound,CPX_CALLBACK_INFO_BEST_REMAINING,:Cdouble)) - - @eval begin - function (MathProgBase.$func)(d::CplexCallbackData) - val = Vector{$(typ)}(undef, 1) - ret = @cpx_ccall(getcallbackinfo, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Cint,Ptr{Cvoid}), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, $(convert(Cint,param)), val) - if ret != 0 - error(CplexError(d.cbdata.model.env, stat).msg) - end - return val[1] - end - end -end - -for (func,param,typ) in ((:cbgetnodesleft,CPX_CALLBACK_INFO_NODES_LEFT_LONG,:Int64), - (:cbgetmipiterations,CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG,:Int64), - (:cbgetgap,CPX_CALLBACK_INFO_MIP_REL_GAP,:Cdouble), - (:cbgetfeasibility,CPX_CALLBACK_INFO_MIP_FEAS,:Cint), - (:cbgetstarttime,CPX_CALLBACK_INFO_STARTTIME,:Cdouble), - (:cbgetdetstarttime,CPX_CALLBACK_INFO_STARTDETTIME,:Cdouble), - (:cbgettimestamp,CPX_CALLBACK_INFO_ENDTIME,:Cdouble), - (:cbgetdettimestamp,CPX_CALLBACK_INFO_ENDDETTIME,:Cdouble)) - - @eval begin - function ($func)(d::CplexCallbackData) - val = Vector{$(typ)}(undef, 1) - ret = @cpx_ccall(getcallbackinfo, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Cint,Ptr{Cvoid}), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, $(convert(Cint,param)), val) - if ret != 0 - error(CplexError(d.cbdata.model.env, stat).msg) - end - return val[1] - end - end -end - -# returns :MIPNode :MIPSol :Intermediate -MathProgBase.cbgetstate(d::CplexCallbackData) = d.state - -#const sensemap = Dict('=' => 'E', '<' => 'L', '>' => 'G') -function MathProgBase.cbaddcut!(d::CplexCallbackData,varidx,varcoef,sense,rhs) - @assert d.state == :MIPNode - cbcut(d.cbdata, d.where, convert(Vector{Cint}, varidx), float(varcoef), sensemap[sense], float(rhs)) - unsafe_store!(d.userinteraction_p, convert(Cint,CPX_CALLBACK_ABORT_CUT_LOOP), 1) -end - -function MathProgBase.cbaddcutlocal!(d::CplexCallbackData,varidx,varcoef,sense,rhs) - @assert d.state == :MIPNode - cbcutlocal(d.cbdata, d.where, convert(Vector{Cint}, varidx), float(varcoef), sensemap[sense], float(rhs)) - unsafe_store!(d.userinteraction_p, convert(Cint,CPX_CALLBACK_ABORT_CUT_LOOP), 1) -end - - -function MathProgBase.cbaddlazy!(d::CplexCallbackData,varidx,varcoef,sense,rhs) - @assert d.state == :MIPNode || d.state == :MIPSol - cblazy(d.cbdata, d.where, convert(Vector{Cint}, varidx), float(varcoef), sensemap[sense], float(rhs)) -end - -function MathProgBase.cbaddlazylocal!(d::CplexCallbackData,varidx,varcoef,sense,rhs) - @assert d.state == :MIPNode || d.state == :MIPSol - cblazylocal(d.cbdata, d.where, convert(Vector{Cint}, varidx), float(varcoef), sensemap[sense], float(rhs)) -end - - -function MathProgBase.cbaddsolution!(d::CplexCallbackData) - val = unsafe_wrap(Array, d.userinteraction_p, 1) - if val[1] == CPX_CALLBACK_SET - error("CPLEX only allows one heuristic solution for each call to the callback") - end - unsafe_store!(d.userinteraction_p, convert(Cint,CPX_CALLBACK_SET), 1) -end - -function MathProgBase.cbsetsolutionvalue!(d::CplexCallbackData,varidx,value) - @assert 1 <= varidx <= num_var(d.cbdata.model) - d.heur_x[varidx] = value - d.user_solution = true - nothing -end - -function cbaddboundbranchup!(d::CplexCallbackData,idx,bd,nodeest) - seqnum = cbbranch(d.cbdata, d.where,convert(Cint,idx-1),convert(Cchar,'L'),bd,nodeest) - unsafe_store!(d.userinteraction_p, convert(Cint,CPX_CALLBACK_SET), 1) - seqnum -end - -function cbaddboundbranchdown!(d::CplexCallbackData,idx,bd,nodeest) - seqnum = cbbranch(d.cbdata, d.where,convert(Cint,idx-1),convert(Cchar,'U'),bd,nodeest) - unsafe_store!(d.userinteraction_p, convert(Cint,CPX_CALLBACK_SET), 1) - seqnum -end - -function cbaddconstrbranch!(d::CplexCallbackData, indices, coeffs, rhs, sense, nodeest) - seqnum = cbbranchconstr(d.cbdata, - d.where, - Cint[idx-1 for idx in indices], - Cdouble[c for c in coeffs], - convert(Cdouble, rhs), - convert(Cchar, sense), - nodeest) - unsafe_store!(d.userinteraction_p, convert(Cint,CPX_CALLBACK_SET), 1) - seqnum -end - -function cbprocessincumbent!(d::CplexCallbackData,accept::Bool) - if accept - unsafe_store!(d.isfeas_p, convert(Cint, 1), 1) - else - unsafe_store!(d.isfeas_p, convert(Cint, 0), 1) - end - nothing -end - -mutable struct CplexLazyCallbackData <: CplexCallbackData - cbdata::CallbackData - state::Symbol - where::Cint - userinteraction_p::Ptr{Cint} -end - -mutable struct CplexCutCallbackData <: CplexCallbackData - cbdata::CallbackData - state::Symbol - where::Cint - userinteraction_p::Ptr{Cint} -end - -terminate(model::CplexMathProgModel) = terminate(model.inner) - -# breaking abstraction, define our low-level callback to eliminate -# a level of indirection -function mastercallback(env::Ptr{Cvoid}, cbdata::Ptr{Cvoid}, wherefrom::Cint, userdata::Ptr{Cvoid}, userinteraction_p::Ptr{Cint}) - model = MathProgBase.unsafe_pointer_to_objref(userdata)::CplexMathProgModel - cpxrawcb = CallbackData(cbdata, model.inner) - if wherefrom == CPX_CALLBACK_MIP_CUT_FEAS || wherefrom == CPX_CALLBACK_MIP_CUT_UNBD - state = :MIPSol - # elseif wherefrom == CPX_CALLBACK_MIP_CUT_LOOP || wherefrom == CPX_CALLBACK_MIP_CUT_LAST - elseif wherefrom == CPX_CALLBACK_MIP_CUT_LAST - state = :MIPNode - else - state = :Intermediate - end - - if model.infocb != nothing - cpxcb = CplexInfoCallbackData(cpxrawcb, state, wherefrom) - stat = model.infocb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - if model.lazycb != nothing && state == :MIPSol - cpxcb = CplexLazyCallbackData(cpxrawcb, state, wherefrom, userinteraction_p) - stat = model.lazycb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - if model.cutcb != nothing && state == :MIPNode - cpxcb = CplexCutCallbackData(cpxrawcb, state, wherefrom, userinteraction_p) - stat = model.cutcb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - return convert(Cint, 0) -end - -mutable struct CplexHeuristicCallbackData <: CplexCallbackData - cbdata::CallbackData - state::Symbol - where::Cint - sol::Vector{Float64} - heur_x::Vector{Float64} - isfeas_p::Ptr{Cint} - userinteraction_p::Ptr{Cint} - user_solution::Bool # true if user has set any solution values -end - -function MathProgBase.cbgetlpsolution(d::CplexHeuristicCallbackData) - return copy(d.sol) -end - -function MathProgBase.cbgetlpsolution(d::CplexHeuristicCallbackData, sol::Vector{Cdouble}) - copyto!(sol,d.sol) -end - -function masterheuristiccallback(env::Ptr{Cvoid}, - cbdata::Ptr{Cvoid}, - wherefrom::Cint, - userdata::Ptr{Cvoid}, - objval_p::Ptr{Cdouble}, - xx::Ptr{Cdouble}, - isfeas_p::Ptr{Cint}, - userinteraction_p::Ptr{Cint}) - model = MathProgBase.unsafe_pointer_to_objref(userdata)::CplexMathProgModel - cpxrawcb = CallbackData(cbdata, model.inner) - if wherefrom == CPX_CALLBACK_MIP_HEURISTIC - state = :MIPNode - else - state = :Intermediate - end - - if model.infocb != nothing - cpxcb = CplexInfoCallbackData(cpxrawcb, state, wherefrom) - stat = model.infocb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - if model.heuristiccb != nothing && state == :MIPNode - sol = unsafe_wrap(Array, xx, numvar(model)) - cpxcb = CplexHeuristicCallbackData(cpxrawcb, state, wherefrom, sol, model.heuristic_buffer, isfeas_p, userinteraction_p, false) - stat = model.heuristiccb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - if cpxcb.user_solution # we filled in some solution values - unsafe_store!(objval_p, dot(get_obj(model.inner), cpxcb.heur_x), 1) - for i in 1:numvar(model) - unsafe_store!(xx, cpxcb.heur_x[i], i) - end - if any(x->isnan(x), cpxcb.heur_x) # we have a partial solution - unsafe_store!(isfeas_p, convert(Cint,CPX_ON), 1) - else - unsafe_store!(isfeas_p, convert(Cint,CPX_OFF), 1) - end - fill!(model.heuristic_buffer, NaN) - end - end - return convert(Cint, 0) -end - -function setmathproglazycallback!(model::CplexMathProgModel) - set_param!(model.inner.env, "CPX_PARAM_MIPCBREDLP", 0) - set_param!(model.inner.env, "CPX_PARAM_PRELINEAR", 0) - set_param!(model.inner.env, "CPX_PARAM_REDUCE", CPX_PREREDUCE_PRIMALONLY) - cpxcallback = @cfunction(mastercallback, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cint})) - stat = @cpx_ccall(setlazyconstraintcallbackfunc, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Any, - ), - model.inner.env.ptr, cpxcallback, model) - if stat != 0 - throw(CplexError(model.env, stat)) - end - nothing -end - -function setmathprogcutcallback!(model::CplexMathProgModel) - set_param!(model.inner.env, "CPX_PARAM_MIPCBREDLP", 0) - set_param!(model.inner.env, "CPX_PARAM_PRELINEAR", 0) - cpxcallback = @cfunction(mastercallback, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cint})) - stat = @cpx_ccall(setusercutcallbackfunc, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Any, - ), - model.inner.env.ptr, cpxcallback, model) - if stat != 0 - throw(CplexError(model.env, stat)) - end - nothing -end - -function setmathprogheuristiccallback!(model::CplexMathProgModel) - set_param!(model.inner.env, "CPX_PARAM_MIPCBREDLP", 0) - set_param!(model.inner.env, "CPX_PARAM_PRELINEAR", 0) - cpxcallback = @cfunction(masterheuristiccallback, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint})) - stat = @cpx_ccall(setheuristiccallbackfunc, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Any, - ), - model.inner.env.ptr, cpxcallback, model) - if stat != 0 - throw(CplexError(model.env, stat)) - end - model.heuristic_buffer = fill(NaN, numvar(model)) - nothing -end - -struct BranchingChoice - indices::Vector{Cint} - bounds::Vector{Cdouble} - lu::Vector{Cchar} -end -export BranchingChoice - -struct CplexBranchCallbackData <: CplexCallbackData - cbdata::CallbackData - state::Symbol - where::Cint - userinteraction_p::Ptr{Cint} - nodes::Vector{BranchingChoice} -end - -function masterbranchcallback(env::Ptr{Cvoid}, - cbdata::Ptr{Cvoid}, - wherefrom::Cint, - userdata::Ptr{Cvoid}, - typ::Cint, - sos::Cint, - nodecnt::Cint, - bdcnt::Cint, - nodebeg::Ptr{Cint}, - indices::Ptr{Cint}, - lu::Ptr{Cchar}, - bd::Ptr{Cdouble}, - nodeest::Ptr{Cdouble}, - userinteraction_p::Ptr{Cint}) - model = unsafe_pointer_to_objref(userdata)::CplexMathProgModel - cpxrawcb = CallbackData(cbdata, model.inner) - if wherefrom == CPX_CALLBACK_MIP_BRANCH - @assert 0 <= nodecnt <= 2 - state = :MIPBranch - else - state = :Intermediate - end - - if model.infocb != nothing - cpxcb = CplexInfoCallbackData(cpxrawcb, state, wherefrom) - stat = model.infocb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - if model.branchcb != nothing && state == :MIPBranch - numbranchingvars = unsafe_wrap(Array, nodebeg, convert(Cint,nodecnt))::Vector{Cint} .+ 1 - idxs = unsafe_wrap(Array, indices, sum(numbranchingvars))::Vector{Cint} - vals = unsafe_wrap(Array, bd, sum(numbranchingvars))::Vector{Cdouble} - dirs = unsafe_wrap(Array, lu, sum(numbranchingvars))::Vector{Cchar} - nodes = Vector{BranchingChoice}(undef, nodecnt) - if nodecnt >= 1 - subidx = 1 : (numbranchingvars[1]) - nodes[1] = BranchingChoice(idxs[subidx], vals[subidx], dirs[subidx]) - end - if nodecnt == 2 - subidx = (numbranchingvars[1]+1) : (numbranchingvars[2]) - nodes[2] = BranchingChoice(idxs[subidx], vals[subidx], dirs[subidx]) - end - cpxcb = CplexBranchCallbackData(cpxrawcb, state, wherefrom, userinteraction_p, nodes) - stat = model.branchcb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - return convert(Cint, 0) -end - -function setmathprogbranchcallback!(model::CplexMathProgModel) - set_param!(model.inner.env, "CPX_PARAM_MIPCBREDLP", 0) - set_param!(model.inner.env, "CPX_PARAM_PRELINEAR", 0) - set_param!(model.inner.env, "CPX_PARAM_REDUCE", CPX_PREREDUCE_PRIMALONLY) - cpxcallback = @cfunction(masterbranchcallback, Cint, (Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cvoid}, - Cint, - Cint, - Cint, - Cint, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cchar}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint})) - stat = @cpx_ccall(setbranchcallbackfunc, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Any, - ), - model.inner.env.ptr, cpxcallback, model) - if stat != 0 - throw(CplexError(model.env, stat)) - end - nothing -end - -mutable struct CplexIncumbentCallbackData <: CplexCallbackData - cbdata::CallbackData - state::Symbol - where::Cint - sol::Vector{Float64} - isfeas_p::Ptr{Cint} - userinteraction_p::Ptr{Cint} - nodes::Vector{BranchingChoice} -end - -function masterincumbentcallback(env::Ptr{Cvoid}, - cbdata::Ptr{Cvoid}, - wherefrom::Cint, - userdata::Ptr{Cvoid}, - objval::Cdouble, - xx::Ptr{Cdouble}, - isfeas_p::Ptr{Cint}, - useraction_p::Ptr{Cint}) - model = unsafe_pointer_to_objref(userdata)::CplexMathProgModel - cpxrawcb = CallbackData(cbdata, model.inner) - if wherefrom == CPX_CALLBACK_MIP_INCUMBENT_NODESOLN || - wherefrom == CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN || - wherefrom == CPX_CALLBACK_MIP_INCUMBENT_USERSOLN - state = :MIPIncumbent - else - state = :Intermediate - end - - if model.infocb != nothing - cpxcb = CplexInfoCallbackData(cpxrawcb, state, wherefrom) - stat = model.infocb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - if model.incumbentcb != nothing && state == :MIPIncumbent - sol = unsafe_wrap(Array, xx, numvar(model)) - cpxcb = CplexIncumbentCallbackData(cpxrawcb, state, wherefrom, sol, isfeas_p, useraction_p, BranchingChoice[]) - stat = model.incumbentcb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - return convert(Cint, 0) -end - -function setmathprogincumbentcallback!(model::CplexMathProgModel) - set_param!(model.inner.env, "CPX_PARAM_MIPCBREDLP", 0) - set_param!(model.inner.env, "CPX_PARAM_PRELINEAR", 0) - set_param!(model.inner.env, "CPX_PARAM_REDUCE", CPX_PREREDUCE_PRIMALONLY) - cpxcallback = @cfunction(masterincumbentcallback, Cint, (Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cvoid}, - Cdouble, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint})) - stat = @cpx_ccall(setincumbentcallbackfunc, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Any, - ), - model.inner.env.ptr, cpxcallback, model) - if stat != 0 - throw(CplexError(model.env, stat)) - end - nothing -end - -mutable struct CplexInfoCallbackData <: CplexCallbackData - cbdata::CallbackData - state::Symbol - where::Cint -end - -function masterinfocallback(env::Ptr{Cvoid}, - cbdata::Ptr{Cvoid}, - wherefrom::Cint, - userdata::Ptr{Cvoid}) - model = unsafe_pointer_to_objref(userdata)::CplexMathProgModel - if model.infocb != nothing - state = :Intermediate - cpxrawcb = CallbackData(cbdata, model.inner) - cpxcb = CplexInfoCallbackData(cpxrawcb, state, wherefrom) - stat = model.infocb(cpxcb) - if stat == :Exit - terminate(model.inner) - end - end - return convert(Cint, 0) -end - -function setmathproginfocallback!(model::CplexMathProgModel) - cpxcallback = @cfunction(masterinfocallback, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Ptr{Cvoid})) - stat = @cpx_ccall(setinfocallbackfunc, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Any, - ), - model.inner.env.ptr, cpxcallback, model) - if stat != 0 - throw(CplexError(model.env, stat)) - end - nothing -end - -function cbgetnodelb(d::CplexCallbackData) - n = num_var(d.cbdata.model) - lb = Vector{Cdouble}(undef, n) - stat = @cpx_ccall(getcallbacknodelb, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, lb, 0, n-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return lb -end - -function cbgetnodeub(d::CplexCallbackData) - n = num_var(d.cbdata.model) - ub = Vector{Cdouble}(undef, n) - stat = @cpx_ccall(getcallbacknodeub, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, ub, 0, n-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return ub -end - -function cbgetnodeobjval(d::CplexCallbackData) - val = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getcallbacknodeobjval, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cdouble}), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, val) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return val[1] -end - -function cbgetintfeas(d::CplexCallbackData) - n = num_var(d.cbdata.model) - feas = Vector{Cint}(undef, n) - stat = @cpx_ccall(getcallbacknodeintfeas, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cint},Cint,Cint), - d.cbdata.model.env.ptr, d.cbdata.cbdata, d.where, feas, 0, n-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return convert(Vector{Int64},feas) -end diff --git a/src/MOI/MOI_callbacks.jl b/src/MOI/MOI_callbacks.jl index bcd48909..dc1154d6 100644 --- a/src/MOI/MOI_callbacks.jl +++ b/src/MOI/MOI_callbacks.jl @@ -1,15 +1,79 @@ +mutable struct CallbackContext + model::Optimizer + ptr::Ptr{Cvoid} +end +Base.cconvert(::Type{Ptr{Cvoid}}, x::CallbackContext) = x +Base.unsafe_convert(::Type{Ptr{Cvoid}}, x::CallbackContext) = x.ptr::Ptr{Cvoid} + +mutable struct _CallbackUserData + model::Optimizer + callback::Function +end +Base.cconvert(::Type{Ptr{Cvoid}}, x::_CallbackUserData) = x +function Base.unsafe_convert(::Type{Ptr{Cvoid}}, x::_CallbackUserData) + return pointer_from_objref(x)::Ptr{Cvoid} +end + +function _cplex_callback_wrapper( + context::Ptr{Cvoid}, + context_id::Clong, + p_user_data::Ptr{Cvoid}, +) + user_data = unsafe_pointer_to_objref(p_user_data)::_CallbackUserData + user_data.callback(CallbackContext(user_data.model, context), context_id) + return Cint(0) +end + +""" + column(cb_data::CallbackContext, x::MOI.VariableIndex) + +Return the 1-indexed column associated with `x` in a callback. + +The C API requires 0-indexed columns. +""" +function column(cb_data::CallbackContext, x::MOI.VariableIndex) + return _info(cb_data.model, x).column +end + """ - CallbackFunction() + CallbackFunction( + context_mask::UInt16 = + CPX_CALLBACKCONTEXT_THREAD_UP | + CPX_CALLBACKCONTEXT_THREAD_DOWN | + CPX_CALLBACKCONTEXT_LOCAL_PROGRESS | + CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS | + CPX_CALLBACKCONTEXT_CANDIDATE | + CPX_CALLBACKCONTEXT_RELAXATION + ) + ) + +Set a generic CPLEX callback function. Use `context_mask` to control where the +callback is called from. -Set a generic CPLEX callback function. +Callback must be a function with signature: -Note: before accessing `MOI.CallbackVariablePrimal`, you must call either -`callbackgetcandidatepoint(model::Optimizer, cb_data, cb_where)` or -`callbackgetrelaxationpoint(model::Optimizer, cb_data, cb_where)`. + callback(cb_data::CallbackContext, context_id::Clong) + +Before accessing `MOI.CallbackVariablePrimal`, you must call +`CPLEX.load_callback_variable_primal(cb_data, context_id)`. """ -struct CallbackFunction <: MOI.AbstractCallback end +struct CallbackFunction <: MOI.AbstractCallback + context_mask::UInt16 -function MOI.set(model::Optimizer, ::CallbackFunction, f::Function) + function CallbackFunction( + context_mask::UInt16 = + CPX_CALLBACKCONTEXT_THREAD_UP | + CPX_CALLBACKCONTEXT_THREAD_DOWN | + CPX_CALLBACKCONTEXT_LOCAL_PROGRESS | + CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS | + CPX_CALLBACKCONTEXT_CANDIDATE | + CPX_CALLBACKCONTEXT_RELAXATION + ) + return new(context_mask) + end +end + +function MOI.set(model::Optimizer, cb::CallbackFunction, f::Function) if MOI.get(model, MOI.NumberOfThreads()) != 1 @warn( "When using callbacks, make sure to set `NumberOfThreads` to `1` " * @@ -18,50 +82,65 @@ function MOI.set(model::Optimizer, ::CallbackFunction, f::Function) "you are doing." ) end + cpx_callback = @cfunction( + _cplex_callback_wrapper, Cint, (Ptr{Cvoid}, Clong, Ptr{Cvoid}) + ) + user_data = _CallbackUserData( + model, + (context, context_id) -> begin + model.callback_state = _CB_GENERIC + f(context::CallbackContext, context_id::Clong) + model.callback_state = _CB_NONE + end + ) + ret = CPXcallbacksetfunc( + model.env, + model.lp, + cb.context_mask, + cpx_callback, + user_data, + ) + _check_ret(model, ret) + model.generic_callback = user_data model.has_generic_callback = true - context_mask = - CPX_CALLBACKCONTEXT_THREAD_UP | - CPX_CALLBACKCONTEXT_THREAD_DOWN | - CPX_CALLBACKCONTEXT_LOCAL_PROGRESS | - CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS | - CPX_CALLBACKCONTEXT_CANDIDATE | - CPX_CALLBACKCONTEXT_RELAXATION - CPLEX.cbsetfunc(model.inner, context_mask, (cb_data, cb_where) -> begin - model.callback_state = CB_GENERIC - f(cb_data, cb_where) - model.callback_state = CB_NONE - end) return end MOI.supports(::Optimizer, ::CallbackFunction) = true """ - callbackgetcandidatepoint(model::Optimizer, cb_data, cb_where) + load_callback_variable_primal(cb_data, context_id) -Load the solution at a CPX_CALLBACKCONTEXT_CANDIDATE node so that it can be -accessed using `MOI.CallbackVariablePrimal`. -""" -function callbackgetcandidatepoint(model::Optimizer, cb_data, cb_where) - N = length(model.variable_info) - resize!(model.callback_variable_primal, N) - CPLEX.cbgetcandidatepoint( - cb_data, model.callback_variable_primal, Cint(0), Cint(N - 1), Ref{Float64}() - ) - return -end - -""" - callbackgetrelaxationpoint(model::Optimizer, cb_data, cb_where) - -Load the solution at a CB_MIPNODE node so that it can be accessed using +Load the solution during a callback so that it can be accessed using `MOI.CallbackVariablePrimal`. """ -function callbackgetrelaxationpoint(model::Optimizer, cb_data, cb_where) +function load_callback_variable_primal( + cb_data::CallbackContext, context_id::Clong +) + model = cb_data.model::Optimizer N = length(model.variable_info) resize!(model.callback_variable_primal, N) - CPLEX.cbgetrelaxationpoint( - cb_data, model.callback_variable_primal, Cint(0), Cint(N - 1), Ref{Float64}() - ) + if context_id == CPX_CALLBACKCONTEXT_CANDIDATE + ret = CPXcallbackgetcandidatepoint( + cb_data, + model.callback_variable_primal, + Cint(0), + Cint(N - 1), + C_NULL, + ) + elseif context_id == CPX_CALLBACKCONTEXT_RELAXATION + ret = CPXcallbackgetrelaxationpoint( + cb_data, + model.callback_variable_primal, + Cint(0), + Cint(N - 1), + C_NULL, + ) + else + error( + "`load_callback_variable_primal` can only be called at " * + "CPX_CALLBACKCONTEXT_CANDIDATE or CPX_CALLBACKCONTEXT_RELAXATION." + ) + end return end @@ -69,7 +148,7 @@ end # MOI callbacks # ============================================================================== -function default_moi_callback(model::Optimizer) +function _default_moi_callback(model::Optimizer) if MOI.get(model, MOI.NumberOfThreads()) != 1 # The current callback system isn't thread-safe. As a work-around, set # the number of threads to 1, regardless of what the user intended. @@ -77,28 +156,31 @@ function default_moi_callback(model::Optimizer) # what they are doing if they use a solver-dependent callback. MOI.set(model, MOI.NumberOfThreads(), 1) end - return (cb_data, cb_where) -> begin - if cb_where == CPX_CALLBACKCONTEXT_CANDIDATE - if cbcandidateispoint(cb_data) == 0 - return # No candidate point available - end - callbackgetcandidatepoint(model, cb_data, cb_where) - if model.lazy_callback !== nothing - model.callback_state = CB_LAZY - model.lazy_callback(cb_data) - end - elseif cb_where == CPX_CALLBACKCONTEXT_RELAXATION - callbackgetrelaxationpoint(model, cb_data, cb_where) + return (cb_data, cb_context) -> begin + if cb_context == CPX_CALLBACKCONTEXT_CANDIDATE + ispoint_p = Ref{Cint}() + ret = CPXcallbackcandidateispoint(cb_data, ispoint_p) + _check_ret(cb_data.model, ret) + if ispoint_p[] == 0 + return # No candidate point available + end + load_callback_variable_primal(cb_data, cb_context) + if model.lazy_callback !== nothing + model.callback_state = _CB_LAZY + model.lazy_callback(cb_data) + end + elseif cb_context == CPX_CALLBACKCONTEXT_RELAXATION + load_callback_variable_primal(cb_data, cb_context) if model.user_cut_callback !== nothing - model.callback_state = CB_USER_CUT + model.callback_state = _CB_USER_CUT model.user_cut_callback(cb_data) end if model.heuristic_callback !== nothing - model.callback_state = CB_HEURISTIC + model.callback_state = _CB_HEURISTIC model.heuristic_callback(cb_data) end end - model.callback_state = CB_NONE + model.callback_state = _CB_NONE end end @@ -126,24 +208,24 @@ function MOI.submit( f::MOI.ScalarAffineFunction{Float64}, s::Union{MOI.LessThan{Float64}, MOI.GreaterThan{Float64}, MOI.EqualTo{Float64}} ) - if model.callback_state == CB_USER_CUT + if model.callback_state == _CB_USER_CUT throw(MOI.InvalidCallbackUsage(MOI.UserCutCallback(), cb)) - elseif model.callback_state == CB_HEURISTIC + elseif model.callback_state == _CB_HEURISTIC throw(MOI.InvalidCallbackUsage(MOI.HeuristicCallback(), cb)) elseif !iszero(f.constant) throw(MOI.ScalarFunctionConstantNotZero{Float64, typeof(f), typeof(s)}(f.constant)) end indices, coefficients = _indices_and_coefficients(model, f) sense, rhs = _sense_and_rhs(s) - CPLEX.cbrejectcandidate( + ret = CPXcallbackrejectcandidate( cb.callback_data, Cint(1), Cint(length(coefficients)), - Float64[rhs], - Cchar[sense], - Cint[0], - indices .- Cint(1), - coefficients + Ref(rhs), + Ref{Cchar}(sense), + Ref{Cint}(0), + indices, + coefficients, ) return end @@ -163,29 +245,32 @@ function MOI.submit( model::Optimizer, cb::MOI.UserCut{CallbackContext}, f::MOI.ScalarAffineFunction{Float64}, - s::Union{MOI.LessThan{Float64}, MOI.GreaterThan{Float64}, MOI.EqualTo{Float64}} + s::Union{ + MOI.LessThan{Float64}, MOI.GreaterThan{Float64}, MOI.EqualTo{Float64} + }, ) - if model.callback_state == CB_LAZY + if model.callback_state == _CB_LAZY throw(MOI.InvalidCallbackUsage(MOI.LazyConstraintCallback(), cb)) - elseif model.callback_state == CB_HEURISTIC + elseif model.callback_state == _CB_HEURISTIC throw(MOI.InvalidCallbackUsage(MOI.HeuristicCallback(), cb)) elseif !iszero(f.constant) throw(MOI.ScalarFunctionConstantNotZero{Float64, typeof(f), typeof(s)}(f.constant)) end - indices, coefficients = _indices_and_coefficients(model, f) + rmatind, rmatval = _indices_and_coefficients(model, f) sense, rhs = _sense_and_rhs(s) - CPLEX.cbaddusercuts( + ret = CPXcallbackaddusercuts( cb.callback_data, Cint(1), - Cint(length(coefficients)), - [rhs], - [sense], - Cint[0], - indices .- Cint(1), - coefficients, - [CPX_USECUT_FILTER], - Cint[0] + Cint(length(rmatval)), + Ref(rhs), + Ref(sense), + Ref{Cint}(0), + rmatind, + rmatval, + Ref{Cint}(CPX_USECUT_FILTER), + Ref{Cint}(0), ) + _check_ret(model, ret) return end MOI.supports(::Optimizer, ::MOI.UserCut{CallbackContext}) = true @@ -204,17 +289,22 @@ function MOI.submit( model::Optimizer, cb::MOI.HeuristicSolution{CallbackContext}, variables::Vector{MOI.VariableIndex}, - values::MOI.Vector{Float64} + values::MOI.Vector{Float64}, ) - if model.callback_state == CB_LAZY + if model.callback_state == _CB_LAZY throw(MOI.InvalidCallbackUsage(MOI.LazyConstraintCallback(), cb)) - elseif model.callback_state == CB_USER_CUT + elseif model.callback_state == _CB_USER_CUT throw(MOI.InvalidCallbackUsage(MOI.UserCutCallback(), cb)) end - ind = Cint[_info(model, var).column - 1 for var in variables] - CPLEX.cbpostheursoln( - cb.callback_data, Cint(1), ind, values, NaN, CPXCALLBACKSOLUTION_SOLVE + ret = CPXcallbackpostheursoln( + cb.callback_data, + Cint(1), + Cint[_info(model, var).column - 1 for var in variables], + values, + NaN, + CPXCALLBACKSOLUTION_SOLVE, ) + _check_ret(model, ret) return MOI.HEURISTIC_SOLUTION_UNKNOWN end MOI.supports(::Optimizer, ::MOI.HeuristicSolution{CallbackContext}) = true diff --git a/src/MOI/MOI_wrapper.jl b/src/MOI/MOI_wrapper.jl index 871f2ee0..135d73f6 100644 --- a/src/MOI/MOI_wrapper.jl +++ b/src/MOI/MOI_wrapper.jl @@ -4,52 +4,43 @@ const MOI = MathOptInterface const CleverDicts = MOI.Utilities.CleverDicts @enum( - VariableType, - CONTINUOUS, - BINARY, - INTEGER, - SEMIINTEGER, - SEMICONTINUOUS, + _BoundType, + _NONE, + _LESS_THAN, + _GREATER_THAN, + _LESS_AND_GREATER_THAN, + _INTERVAL, + _EQUAL_TO, ) @enum( - BoundType, - NONE, - LESS_THAN, - GREATER_THAN, - LESS_AND_GREATER_THAN, - INTERVAL, - EQUAL_TO, -) - -@enum( - ObjectiveType, - SINGLE_VARIABLE, - SCALAR_AFFINE, - SCALAR_QUADRATIC, + _ObjectiveType, + _SINGLE_VARIABLE, + _SCALAR_AFFINE, + _SCALAR_QUADRATIC, ) @enum( CallbackState, - CB_NONE, - CB_GENERIC, - CB_LAZY, - CB_USER_CUT, - CB_HEURISTIC, + _CB_NONE, + _CB_GENERIC, + _CB_LAZY, + _CB_USER_CUT, + _CB_HEURISTIC, ) -const SCALAR_SETS = Union{ +const _SCALAR_SETS = Union{ MOI.GreaterThan{Float64}, MOI.LessThan{Float64}, MOI.EqualTo{Float64}, MOI.Interval{Float64}, } -mutable struct VariableInfo +mutable struct _VariableInfo index::MOI.VariableIndex column::Int - bound::BoundType - type::VariableType + bound::_BoundType + type::Char start::Union{Float64, Nothing} name::String # Storage for constraint names associated with variables because CPLEX can @@ -64,12 +55,12 @@ mutable struct VariableInfo # second order cone. lower_bound_if_soc::Float64 num_soc_constraints::Int - function VariableInfo(index::MOI.VariableIndex, column::Int) + function _VariableInfo(index::MOI.VariableIndex, column::Int) return new( index, column, - NONE, - CONTINUOUS, + _NONE, + CPX_CONTINUOUS, nothing, "", "", @@ -81,54 +72,83 @@ mutable struct VariableInfo end end -mutable struct ConstraintInfo +mutable struct _ConstraintInfo row::Int set::MOI.AbstractSet # Storage for constraint names. Where possible, these are also stored in the # CPLEX model. name::String - ConstraintInfo(row::Int, set::MOI.AbstractSet) = new(row, set, "") + _ConstraintInfo(row::Int, set::MOI.AbstractSet) = new(row, set, "") +end + +mutable struct Env + ptr::Ptr{Cvoid} + # These fields keep track of how many models the `Env` is used for to help + # with finalizing. If you finalize an Env first, then the model, Gurobi will + # throw an error. + finalize_called::Bool + attached_models::Int + + function Env() + status_p = Ref{Cint}() + ptr = CPXopenCPLEX(status_p) + if status_p[] != 0 + error( + "CPLEX Error $(status_p[]): Unable to create CPLEX environment." + ) + end + env = new(ptr, false, 0) + finalizer(env) do e + e.finalize_called = true + if e.attached_models == 0 + # Only finalize the model if there are no models using it. + CPXcloseCPLEX(Ref(e.ptr)) + e.ptr = C_NULL + end + end + return env + end end +Base.cconvert(::Type{Ptr{Cvoid}}, x::Env) = x +Base.unsafe_convert(::Type{Ptr{Cvoid}}, env::Env) = env.ptr::Ptr{Cvoid} -mutable struct CachedSolution - variable_primal::Vector{Float64} - variable_dual::Vector{Float64} - - linear_primal::Vector{Float64} - linear_dual::Vector{Float64} - - quadratic_primal::Vector{Float64} - quadratic_dual::Vector{Float64} - - has_primal_certificate::Bool - has_dual_certificate::Bool - - solve_time::Float64 +function _check_ret(env::Union{Env, CPXENVptr}, ret::Cint) + if ret == 0 + return + end + buffer = Array{Cchar}(undef, CPXMESSAGEBUFSIZE) + p = pointer(buffer) + GC.@preserve buffer begin + errstr = CPXgeterrorstring(env, ret, p) + if errstr == C_NULL + error("CPLEX Error $(ret): Unknown error code.") + else + error(unsafe_string(p)) + end + end end mutable struct Optimizer <: MOI.AbstractOptimizer # The low-level CPLEX model. - inner::Model - - # The model name. TODO(odow): pass through to .inner. - name::String + lp::CPXLPptr + env::Env # A flag to keep track of MOI.Silent, which over-rides the OutputFlag # parameter. silent::Bool # An enum to remember what objective is currently stored in the model. - objective_type::ObjectiveType + objective_type::_ObjectiveType # A flag to keep track of MOI.FEASIBILITY_SENSE, since CPLEX only stores # MIN_SENSE or MAX_SENSE. This allows us to differentiate between MIN_SENSE # and FEASIBILITY_SENSE. is_feasibility::Bool - # A mapping from the MOI.VariableIndex to the CPLEX column. VariableInfo + # A mapping from the MOI.VariableIndex to the CPLEX column. _VariableInfo # also stores some additional fields like what bounds have been added, the # variable type, and the names of SingleVariable-in-Set constraints. - variable_info::CleverDicts.CleverDict{MOI.VariableIndex, VariableInfo} + variable_info::CleverDicts.CleverDict{MOI.VariableIndex, _VariableInfo} # An index that is incremented for each new constraint (regardless of type). # We can check if a constraint is valid by checking if it is in the correct @@ -136,16 +156,16 @@ mutable struct Optimizer <: MOI.AbstractOptimizer # constraints cannot be distinguished from previously created ones. last_constraint_index::Int # ScalarAffineFunction{Float64}-in-Set storage. - affine_constraint_info::Dict{Int, ConstraintInfo} + affine_constraint_info::Dict{Int, _ConstraintInfo} # ScalarQuadraticFunction{Float64}-in-Set storage. - quadratic_constraint_info::Dict{Int, ConstraintInfo} + quadratic_constraint_info::Dict{Int, _ConstraintInfo} # VectorOfVariables-in-Set storage. - sos_constraint_info::Dict{Int, ConstraintInfo} + sos_constraint_info::Dict{Int, _ConstraintInfo} # VectorAffineFunction-in-Set storage. # the function info is also stored in the dict - indicator_constraint_info::Dict{Int, Tuple{ConstraintInfo, MOI.VectorAffineFunction{Float64}}} + indicator_constraint_info::Dict{Int, Tuple{_ConstraintInfo, MOI.VectorAffineFunction{Float64}}} # Note: we do not have a singlevariable_constraint_info dictionary. Instead, - # data associated with these constraints are stored in the VariableInfo + # data associated with these constraints are stored in the _VariableInfo # objects. # Mappings from variable and constraint names to their indices. These are @@ -153,10 +173,13 @@ mutable struct Optimizer <: MOI.AbstractOptimizer name_to_variable::Union{Nothing, Dict{String, Union{Nothing, MOI.VariableIndex}}} name_to_constraint_index::Union{Nothing, Dict{String, Union{Nothing, MOI.ConstraintIndex}}} - # TODO: add functionality to the lower-level API to support querying single - # elements of the solution. - cached_solution::Union{Nothing, CachedSolution} - conflict::Union{Nothing, ConflictRefinerData} + has_primal_certificate::Bool + has_dual_certificate::Bool + certificate::Vector{Float64} + + solve_time::Float64 + + conflict::Any # ::Union{Nothing, ConflictRefinerData} # Callback fields. callback_variable_primal::Vector{Float64} @@ -165,58 +188,89 @@ mutable struct Optimizer <: MOI.AbstractOptimizer lazy_callback::Union{Nothing, Function} user_cut_callback::Union{Nothing, Function} heuristic_callback::Union{Nothing, Function} + generic_callback::Any + + terminate_signal::Ref{Cint} """ - Optimizer(env = nothing) + Optimizer(env::Union{Nothing, Env} = nothing) Create a new Optimizer object. You can share CPLEX `Env`s between models by passing an instance of `Env` - as the first argument. By default, a new environment is created for every - model. + as the first argument. + + Set optimizer attributes using `MOI.RawParameter` or + `JuMP.set_optimizer_atttribute`. + + ## Example + + using JuMP, CPLEX + const env = CPLEX.Env() + model = JuMP.Model(() -> CPLEX.Optimizer(env)) + set_optimizer_attribute(model, "CPXPARAM_ScreenOutput", 0) """ - function Optimizer(env::Env = Env()) + function Optimizer(env::Union{Nothing, Env} = nothing) model = new() - model.inner = Model(env) + model.lp = C_NULL + model.env = env === nothing ? Env() : env MOI.set(model, MOI.RawParameter("CPXPARAM_ScreenOutput"), 1) model.silent = false - model.variable_info = CleverDicts.CleverDict{MOI.VariableIndex, VariableInfo}() - model.affine_constraint_info = Dict{Int, ConstraintInfo}() - model.quadratic_constraint_info = Dict{Int, ConstraintInfo}() - model.sos_constraint_info = Dict{Int, ConstraintInfo}() - model.indicator_constraint_info = Dict{Int, Tuple{ConstraintInfo, MOI.VectorAffineFunction{Float64}}}() + model.variable_info = CleverDicts.CleverDict{MOI.VariableIndex, _VariableInfo}() + model.affine_constraint_info = Dict{Int, _ConstraintInfo}() + model.quadratic_constraint_info = Dict{Int, _ConstraintInfo}() + model.sos_constraint_info = Dict{Int, _ConstraintInfo}() + model.indicator_constraint_info = Dict{Int, Tuple{_ConstraintInfo, MOI.VectorAffineFunction{Float64}}}() model.callback_variable_primal = Float64[] - MOI.empty!(model) # MOI.empty!(model) re-sets the `.inner` field. + model.certificate = Float64[] + MOI.empty!(model) + finalizer(model) do m + ret = CPXfreeprob(m.env, Ref(m.lp)) + _check_ret(m, ret) + m.env.attached_models -= 1 + if env === nothing + # We created this env. Finalize it now + finalize(m.env) + elseif m.env.finalize_called && m.env.attached_models == 0 + # We delayed finalizing `m.env` earlier because there were still + # models attached. Finalize it now. + CPXcloseCPLEX(Ref(m.env.ptr)) + m.env.ptr = C_NULL + end + end + model.terminate_signal = Ref{Cint}(0) + CPXsetterminate(model.env, model.terminate_signal) return model end end -function CachedSolution(model::Optimizer) - num_variables = length(model.variable_info) - num_affine = length(model.affine_constraint_info) - num_quad = length(model.quadratic_constraint_info) - return CachedSolution( - fill(NaN, num_variables), - fill(NaN, num_variables), - fill(NaN, num_affine), - fill(NaN, num_affine), - fill(NaN, num_quad), - fill(NaN, num_quad), - false, - false, - NaN - ) +function terminate(model::Optimizer) + model.terminate_signal[] = Cint(1) + return end -Base.show(io::IO, model::Optimizer) = show(io, model.inner) +_check_ret(model::Optimizer, ret::Cint) = _check_ret(model.env, ret) + +Base.show(io::IO, model::Optimizer) = show(io, model.lp) function MOI.empty!(model::Optimizer) - model.inner = Model(model.inner.env) - model.name = "" + if model.lp != C_NULL + ret = CPXfreeprob(model.env, Ref(model.lp)) + _check_ret(model.env, ret) + model.env.attached_models -= 1 + end + # Try open a new problem + stat = Ref{Cint}() + tmp = CPXcreateprob(model.env, stat, "") + if tmp == C_NULL + _check_ret(model.env, stat[]) + end + model.env.attached_models += 1 + model.lp = tmp if model.silent MOI.set(model, MOI.RawParameter("CPXPARAM_ScreenOutput"), 0) end - model.objective_type = SCALAR_AFFINE + model.objective_type = _SCALAR_AFFINE model.is_feasibility = true empty!(model.variable_info) empty!(model.affine_constraint_info) @@ -225,19 +279,22 @@ function MOI.empty!(model::Optimizer) model.name_to_variable = nothing model.name_to_constraint_index = nothing empty!(model.callback_variable_primal) - model.cached_solution = nothing + empty!(model.certificate) + model.has_primal_certificate = false + model.has_dual_certificate = false + model.solve_time = NaN model.conflict = nothing - model.callback_state = CB_NONE + model.callback_state = _CB_NONE model.has_generic_callback = false model.lazy_callback = nothing model.user_cut_callback = nothing model.heuristic_callback = nothing + model.generic_callback = nothing return end function MOI.is_empty(model::Optimizer) - !isempty(model.name) && return false - model.objective_type != SCALAR_AFFINE && return false + model.objective_type != _SCALAR_AFFINE && return false model.is_feasibility == false && return false !isempty(model.variable_info) && return false length(model.affine_constraint_info) != 0 && return false @@ -246,8 +303,7 @@ function MOI.is_empty(model::Optimizer) model.name_to_variable !== nothing && return false model.name_to_constraint_index !== nothing && return false length(model.callback_variable_primal) != 0 && return false - model.cached_solution !== nothing && return false - model.callback_state != CB_NONE && return false + model.callback_state != _CB_NONE && return false model.has_generic_callback && return false model.lazy_callback !== nothing && return false model.user_cut_callback !== nothing && return false @@ -263,7 +319,7 @@ function MOI.supports( ) where {F <: Union{ MOI.SingleVariable, MOI.ScalarAffineFunction{Float64}, - MOI.ScalarQuadraticFunction{Float64} + MOI.ScalarQuadraticFunction{Float64}, }} return true end @@ -278,7 +334,7 @@ function MOI.supports_constraint( MOI.ZeroOne, MOI.Integer, MOI.Semicontinuous{Float64}, - MOI.Semiinteger{Float64} + MOI.Semiinteger{Float64}, }} return true end @@ -321,12 +377,62 @@ MOI.supports(::Optimizer, ::MOI.ObjectiveSense) = true MOI.supports(::Optimizer, ::MOI.RawParameter) = true function MOI.set(model::Optimizer, param::MOI.RawParameter, value) - CPLEX.set_param!(model.inner.env, param.name, value) + numP, typeP = Ref{Cint}(), Ref{Cint}() + ret = CPXgetparamnum(model.env, param.name, numP) + _check_ret(model.env, ret) + ret = CPXgetparamtype(model.env, numP[], typeP) + _check_ret(model.env, ret) + ret = if typeP[] == CPX_PARAMTYPE_NONE + Cint(0) + elseif typeP[] == CPX_PARAMTYPE_INT + CPXsetintparam(model.env, numP[], value) + elseif typeP[] == CPX_PARAMTYPE_DOUBLE + CPXsetdblparam(model.env, numP[], value) + elseif typeP[] == CPX_PARAMTYPE_STRING + CPXsetstrparam(model.env, numP[], value) + else + @assert typeP[] == CPX_PARAMTYPE_LONG + CPXsetlongparam(model.env, numP[], value) + end + _check_ret(model.env, ret) return end function MOI.get(model::Optimizer, param::MOI.RawParameter) - return CPLEX.get_param(model.inner.env, param.name) + numP, typeP = Ref{Cint}(), Ref{Cint}() + ret = CPXgetparamnum(model.env, param.name, numP) + _check_ret(model.env, ret) + ret = CPXgetparamtype(model.env, numP[], typeP) + _check_ret(model.env, ret) + if typeP[] == CPX_PARAMTYPE_NONE + Cint(0) + elseif typeP[] == CPX_PARAMTYPE_INT + valueP = Ref{Cint}() + ret = CPXgetintparam(model.env, numP[], valueP) + _check_ret(model.env, ret) + return Int(valueP[]) + elseif typeP[] == CPX_PARAMTYPE_DOUBLE + valueP = Ref{Cdouble}() + ret = CPXgetdblparam(model.env, numP[], valueP) + _check_ret(model.env, ret) + return valueP[] + elseif typeP[] == CPX_PARAMTYPE_STRING + buffer = Array{Cchar}(undef, CPXMESSAGEBUFSIZE) + valueP = pointer(buffer) + GC.@preserve buffer begin + ret = CPXgetstrparam(model.env, numP[], valueP) + _check_ret(model, ret) + return unsafe_string(valueP) + end + else + @assert typeP[] == CPX_PARAMTYPE_LONG + valueP = Ref{CPXLONG}() + ret = CPXsetlongparam(model.env, numP[], valueP) + _check_ret(model.env, ret) + return valueP[] + end + _check_ret(model.env, ret) + return end function MOI.set(model::Optimizer, ::MOI.TimeLimitSec, limit::Real) @@ -368,10 +474,10 @@ function _indices_and_coefficients( indices::AbstractVector{Cint}, coefficients::AbstractVector{Float64}, model::Optimizer, - f::MOI.ScalarAffineFunction{Float64} + f::MOI.ScalarAffineFunction{Float64}, ) for (i, term) in enumerate(f.terms) - indices[i] = Cint(_info(model, term.variable_index).column) + indices[i] = Cint(column(model, term.variable_index) - 1) coefficients[i] = term.coefficient end return indices, coefficients @@ -398,8 +504,8 @@ function _indices_and_coefficients( f::MOI.ScalarQuadraticFunction ) for (i, term) in enumerate(f.quadratic_terms) - I[i] = Cint(_info(model, term.variable_index_1).column) - J[i] = Cint(_info(model, term.variable_index_2).column) + I[i] = Cint(column(model, term.variable_index_1) - 1) + J[i] = Cint(column(model, term.variable_index_2) - 1) V[i] = term.coefficient # CPLEX returns a list of terms. MOI requires 0.5 x' Q x. So, to get # from @@ -416,7 +522,7 @@ function _indices_and_coefficients( end end for (i, term) in enumerate(f.affine_terms) - indices[i] = Cint(_info(model, term.variable_index).column) + indices[i] = Cint(column(model, term.variable_index) - 1) coefficients[i] = term.coefficient end return @@ -445,7 +551,7 @@ _sense_and_rhs(s::MOI.EqualTo{Float64}) = (Cchar('E'), s.value) ### Variables ### -# Short-cuts to return the VariableInfo associated with an index. +# Short-cuts to return the _VariableInfo associated with an index. function _info(model::Optimizer, key::MOI.VariableIndex) if haskey(model.variable_info, key) return model.variable_info[key] @@ -453,29 +559,45 @@ function _info(model::Optimizer, key::MOI.VariableIndex) throw(MOI.InvalidIndex(key)) end +""" + column(model::Optimizer, x::MOI.VariableIndex) + +Return the 1-indexed column associated with `x`. + +The C API requires 0-indexed columns. +""" +function column(model::Optimizer, x::MOI.VariableIndex) + return _info(model, x).column +end + function MOI.add_variable(model::Optimizer) - # Initialize `VariableInfo` with a dummy `VariableIndex` and a column, + # Initialize `_VariableInfo` with a dummy `VariableIndex` and a column, # because we need `add_item` to tell us what the `VariableIndex` is. index = CleverDicts.add_item( - model.variable_info, VariableInfo(MOI.VariableIndex(0), 0) + model.variable_info, _VariableInfo(MOI.VariableIndex(0), 0) ) info = _info(model, index) info.index = index info.column = length(model.variable_info) - # TODO(odow): see if C API can add single variable. - CPLEX.add_vars!(model.inner, [0.0], [-Inf], [Inf]) + ret = CPXnewcols( + model.env, model.lp, 1, C_NULL, [-Inf], C_NULL, C_NULL, C_NULL + ) + _check_ret(model, ret) return index end function MOI.add_variables(model::Optimizer, N::Int) - CPLEX.add_vars!(model.inner, zeros(N), fill(-Inf, N), fill(Inf, N)) + ret = CPXnewcols( + model.env, model.lp, N, C_NULL, fill(-Inf, N), C_NULL, C_NULL, C_NULL + ) + _check_ret(model, ret) indices = Vector{MOI.VariableIndex}(undef, N) num_variables = length(model.variable_info) for i in 1:N - # Initialize `VariableInfo` with a dummy `VariableIndex` and a column, + # Initialize `_VariableInfo` with a dummy `VariableIndex` and a column, # because we need `add_item` to tell us what the `VariableIndex` is. index = CleverDicts.add_item( - model.variable_info, VariableInfo(MOI.VariableIndex(0), 0) + model.variable_info, _VariableInfo(MOI.VariableIndex(0), 0) ) info = _info(model, index) info.index = index @@ -492,8 +614,8 @@ end # Helper function used inside MOI.delete (vector version). Takes a list of # numbers (MOI.VariableIndex) sorted by increasing values, return two lists # representing the same set of numbers but in the form of intervals. -# Ex.: intervalize([1, 3, 4, 5, 8, 10, 11]) -> ([1, 3, 8, 10], [1, 5, 8, 11]) -function intervalize(xs) +# Ex.: _intervalize([1, 3, 4, 5, 8, 10, 11]) -> ([1, 3, 8, 10], [1, 5, 8, 11]) +function _intervalize(xs) starts, ends = empty(xs), empty(xs) for x in xs if isempty(starts) || x != last(ends) + 1 @@ -512,9 +634,12 @@ function MOI.delete(model::Optimizer, indices::Vector{<:MOI.VariableIndex}) soc_idx = findfirst(e -> e.num_soc_constraints > 0, info) soc_idx !== nothing && throw(MOI.DeleteNotAllowed(indices[soc_idx])) sorted_del_cols = sort!(collect(i.column for i in info)) - starts, ends = intervalize(sorted_del_cols) + starts, ends = _intervalize(sorted_del_cols) for ri in reverse(1:length(starts)) - CPLEX.c_api_delcols(model.inner, Cint(starts[ri]), Cint(ends[ri])) + ret = CPXdelcols( + model.env, model.lp, Cint(starts[ri] - 1), Cint(ends[ri] - 1) + ) + _check_ret(model, ret) end for var_idx in indices delete!(model.variable_info, var_idx) @@ -544,7 +669,10 @@ function MOI.delete(model::Optimizer, v::MOI.VariableIndex) if info.num_soc_constraints > 0 throw(MOI.DeleteNotAllowed(v)) end - CPLEX.c_api_delcols(model.inner, Cint(info.column), Cint(info.column)) + ret = CPXdelcols( + model.env, model.lp, Cint(info.column - 1), Cint(info.column - 1) + ) + _check_ret(model, ret) delete!(model.variable_info, v) for other_info in values(model.variable_info) if other_info.column > info.column @@ -597,9 +725,10 @@ function MOI.set( info = _info(model, v) info.name = name if isascii(name) - CPLEX.c_api_chgname( - model.inner, Cchar('c'), Cint(info.column - 1), name + ret = CPXchgname( + model.env, model.lp, Cchar('c'), Cint(info.column - 1), name ) + _check_ret(model, ret) end model.name_to_variable = nothing return @@ -611,10 +740,15 @@ end function _zero_objective(model::Optimizer) num_vars = length(model.variable_info) + n = fill(Cint(0), num_vars) + ret = CPXcopyquad(model.env, model.lp, n, n, Cint[], Cdouble[]) + _check_ret(model, ret) + ind = convert(Vector{Cint}, 0:(num_vars - 1)) obj = zeros(Float64, num_vars) - CPLEX.add_qpterms!(model.inner, Cint[], Cint[], Float64[]) - CPLEX.c_api_chgobj(model.inner, Cint[1:num_vars;], obj) - CPLEX.c_api_chgobjoffset(model.inner, 0.0) + ret = CPXchgobj(model.env, model.lp, length(ind), ind, obj) + _check_ret(model, ret) + ret = CPXchgobjoffset(model.env, model.lp, 0.0) + _check_ret(model, ret) return end @@ -622,110 +756,129 @@ function MOI.set( model::Optimizer, ::MOI.ObjectiveSense, sense::MOI.OptimizationSense ) if sense == MOI.MIN_SENSE - CPLEX.c_api_chgobjsen(model.inner, Cint(1)) + ret = CPXchgobjsen(model.env, model.lp, CPX_MIN) + _check_ret(model, ret) model.is_feasibility = false elseif sense == MOI.MAX_SENSE - CPLEX.c_api_chgobjsen(model.inner, Cint(-1)) + ret = CPXchgobjsen(model.env, model.lp, CPX_MAX) + _check_ret(model, ret) model.is_feasibility = false else @assert sense == MOI.FEASIBILITY_SENSE _zero_objective(model) - CPLEX.c_api_chgobjsen(model.inner, Cint(1)) + ret = CPXchgobjsen(model.env, model.lp, CPX_MIN) + _check_ret(model, ret) model.is_feasibility = true end return end function MOI.get(model::Optimizer, ::MOI.ObjectiveSense) - sense = CPLEX.c_api_getobjsen(model.inner) + sense = CPXgetobjsen(model.env, model.lp) if model.is_feasibility return MOI.FEASIBILITY_SENSE - elseif sense == Cint(-1) + elseif sense == CPX_MAX return MOI.MAX_SENSE else - @assert sense == Cint(1) + @assert sense == CPX_MIN return MOI.MIN_SENSE end end + function MOI.set( model::Optimizer, ::MOI.ObjectiveFunction{F}, f::F ) where {F <: MOI.SingleVariable} MOI.set( - model, - MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(), + model, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(), convert(MOI.ScalarAffineFunction{Float64}, f) ) - model.objective_type = SINGLE_VARIABLE + model.objective_type = _SINGLE_VARIABLE return end function MOI.get(model::Optimizer, ::MOI.ObjectiveFunction{MOI.SingleVariable}) - obj = MOI.get( - model, - MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}() - ) + obj = MOI.get(model, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}()) return convert(MOI.SingleVariable, obj) end function MOI.set( model::Optimizer, ::MOI.ObjectiveFunction{F}, f::F ) where {F <: MOI.ScalarAffineFunction{Float64}} - if model.objective_type == SCALAR_QUADRATIC + num_vars = length(model.variable_info) + if model.objective_type == _SCALAR_QUADRATIC # We need to zero out the existing quadratic objective. - CPLEX.add_qpterms!(model.inner, Cint[], Cint[], Float64[]) + ret = CPXcopyquad( + model.env, + model.lp, + fill(Cint(0), num_vars), + fill(Cint(0), num_vars), + Ref{Cint}(), + Ref{Cdouble}(), + ) + _check_ret(model, ret) end - num_vars = length(model.variable_info) obj = zeros(Float64, num_vars) for term in f.terms - column = _info(model, term.variable_index).column - obj[column] += term.coefficient - end - CPLEX.c_api_chgobj(model.inner, Cint[1:num_vars;], obj) - CPLEX.c_api_chgobjoffset(model.inner, f.constant) - model.objective_type = SCALAR_AFFINE + col = column(model, term.variable_index) + obj[col] += term.coefficient + end + ind = convert(Vector{Cint}, 0:(num_vars - 1)) + ret = CPXchgobj(model.env, model.lp, num_vars, ind, obj) + _check_ret(model, ret) + ret = CPXchgobjoffset(model.env, model.lp, f.constant) + _check_ret(model, ret) + model.objective_type = _SCALAR_AFFINE return end function MOI.get( model::Optimizer, ::MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}} ) - if model.objective_type == SCALAR_QUADRATIC + if model.objective_type == _SCALAR_QUADRATIC error("Unable to get objective function. Currently: $(model.objective_type).") end dest = zeros(length(model.variable_info)) - CPLEX.c_api_getobj( - model.inner, dest, Cint(1), CPLEX.c_api_getnumcols(model.inner) - ) + ret = CPXgetobj(model.env, model.lp, dest, Cint(0), Cint(length(dest) - 1)) + _check_ret(model, ret) terms = MOI.ScalarAffineTerm{Float64}[] for (index, info) in model.variable_info coefficient = dest[info.column] iszero(coefficient) && continue push!(terms, MOI.ScalarAffineTerm(coefficient, index)) end - constant = CPLEX.c_api_getobjoffset(model.inner) - return MOI.ScalarAffineFunction(terms, constant) + constant = Ref{Cdouble}() + ret = CPXgetobjoffset(model.env, model.lp, constant) + _check_ret(model, ret) + return MOI.ScalarAffineFunction(terms, constant[]) end function MOI.set( model::Optimizer, ::MOI.ObjectiveFunction{F}, f::F ) where {F <: MOI.ScalarQuadraticFunction{Float64}} - affine_indices, affine_coefficients, I, J, V = _indices_and_coefficients( - model, f + a, b, I, J, V = _indices_and_coefficients(model, f) + n = length(model.variable_info) + obj = zeros(n) + for (i, c) in zip(a, b) + obj[i + 1] += c + end + ind = convert(Vector{Cint}, 0:(n - 1)) + ret = CPXchgobj(model.env, model.lp, n, ind, obj) + _check_ret(model, ret) + ret = CPXchgobjoffset(model.env, model.lp, f.constant) + _check_ret(model, ret) + Q = SparseArrays.sparse(I .+ 1, J .+ 1, V, n, n) + Q = Q .+ Q' + ret = CPXcopyquad( + model.env, + model.lp, + convert(Vector{Cint}, Q.colptr .- 1), + Cint[Q.colptr[k + 1] - Q.colptr[k] for k = 1:n], + convert(Vector{Cint}, Q.rowval .- 1), + Q.nzval, ) - obj = zeros(length(model.variable_info)) - for (i, c) in zip(affine_indices, affine_coefficients) - obj[i] = c - end - CPLEX.c_api_chgobj(model.inner, Cint[1:length(obj);], obj) - CPLEX.c_api_chgobjoffset(model.inner, f.constant) - for i = 1:length(I) - if I[i] == J[i] - V[i] *= 2 - end - end - CPLEX.add_qpterms!(model.inner, I, J, V) - model.objective_type = SCALAR_QUADRATIC + _check_ret(model, ret) + model.objective_type = _SCALAR_QUADRATIC return end @@ -734,22 +887,52 @@ function MOI.get( ::MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{Float64}} ) dest = zeros(length(model.variable_info)) - CPLEX.c_api_getobj(model.inner, dest, Cint(1), Cint(length(dest))) + ret = CPXgetobj(model.env, model.lp, dest, Cint(0), Cint(length(dest) - 1)) + _check_ret(model, ret) terms = MOI.ScalarAffineTerm{Float64}[] for (index, info) in model.variable_info coefficient = dest[info.column] iszero(coefficient) && continue push!(terms, MOI.ScalarAffineTerm(coefficient, index)) end - constant = CPLEX.c_api_getobjoffset(model.inner) + constant = Ref{Cdouble}() + ret = CPXgetobjoffset(model.env, model.lp, constant) + _check_ret(model, ret) q_terms = MOI.ScalarQuadraticTerm{Float64}[] - qmatbeg, qmatind, qmatval = CPLEX.c_api_getquad(model.inner) + surplus_p = Ref{Cint}() + ret = CPXgetquad( + model.env, + model.lp, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + 0, + surplus_p, + 0, + length(dest) - 1, + ) + qmatbeg = Vector{Cint}(undef, length(dest)) + qmatind = Vector{Cint}(undef, -surplus_p[]) + qmatval = Vector{Cdouble}(undef, -surplus_p[]) + nzcnt_p = Ref{Cint}() + ret = CPXgetquad( + model.env, + model.lp, + nzcnt_p, + qmatbeg, + qmatind, + qmatval, + -surplus_p[], + surplus_p, + 0, + length(dest) - 1, + ) row = 0 for (i, (col, val)) in enumerate(zip(qmatind, qmatval)) if row < length(qmatbeg) && i == (qmatbeg[row + 1] + 1) row += 1 end - iszero(val) && continue push!( q_terms, MOI.ScalarQuadraticTerm( @@ -760,16 +943,17 @@ function MOI.get( ) end return MOI.Utilities.canonical( - MOI.ScalarQuadraticFunction(terms, q_terms, constant) + MOI.ScalarQuadraticFunction(terms, q_terms, constant[]) ) end function MOI.modify( model::Optimizer, ::MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}, - chg::MOI.ScalarConstantChange{Float64} + chg::MOI.ScalarConstantChange{Float64}, ) - CPLEX.c_api_chgobjoffset(model.inner, chg.new_constant) + ret = CPXchgobjoffset(model.env, model.lp, chg.new_constant) + _check_ret(model, ret) return end @@ -787,13 +971,26 @@ function _info( return throw(MOI.InvalidIndex(c)) end +""" + column(model::Optimizer, c::MOI.ConstraintIndex{MOI.SingleVariable, <:Any}) + +Return the 1-indexed column associated with `c`. + +The C API requires 0-indexed columns. +""" +function column( + model::Optimizer, c::MOI.ConstraintIndex{MOI.SingleVariable, <:Any} +) + return _info(model, c).column +end + function MOI.is_valid( model::Optimizer, c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}} ) if haskey(model.variable_info, MOI.VariableIndex(c.value)) info = _info(model, c) - return info.bound == LESS_THAN || info.bound == LESS_AND_GREATER_THAN + return info.bound == _LESS_THAN || info.bound == _LESS_AND_GREATER_THAN end return false end @@ -804,7 +1001,7 @@ function MOI.is_valid( ) if haskey(model.variable_info, MOI.VariableIndex(c.value)) info = _info(model, c) - return info.bound == GREATER_THAN || info.bound == LESS_AND_GREATER_THAN + return info.bound == _GREATER_THAN || info.bound == _LESS_AND_GREATER_THAN end return false end @@ -814,7 +1011,7 @@ function MOI.is_valid( c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.Interval{Float64}} ) return haskey(model.variable_info, MOI.VariableIndex(c.value)) && - _info(model, c).bound == INTERVAL + _info(model, c).bound == _INTERVAL end function MOI.is_valid( @@ -822,7 +1019,7 @@ function MOI.is_valid( c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.EqualTo{Float64}} ) return haskey(model.variable_info, MOI.VariableIndex(c.value)) && - _info(model, c).bound == EQUAL_TO + _info(model, c).bound == _EQUAL_TO end function MOI.is_valid( @@ -830,7 +1027,7 @@ function MOI.is_valid( c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.ZeroOne} ) return haskey(model.variable_info, MOI.VariableIndex(c.value)) && - _info(model, c).type == BINARY + _info(model, c).type == CPX_BINARY end function MOI.is_valid( @@ -838,7 +1035,7 @@ function MOI.is_valid( c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.Integer} ) return haskey(model.variable_info, MOI.VariableIndex(c.value)) && - _info(model, c).type == INTEGER + _info(model, c).type == CPX_INTEGER end function MOI.is_valid( @@ -846,7 +1043,7 @@ function MOI.is_valid( c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.Semicontinuous{Float64}} ) return haskey(model.variable_info, MOI.VariableIndex(c.value)) && - _info(model, c).type == SEMICONTINUOUS + _info(model, c).type == CPX_SEMICONT end function MOI.is_valid( @@ -854,7 +1051,7 @@ function MOI.is_valid( c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.Semiinteger{Float64}} ) return haskey(model.variable_info, MOI.VariableIndex(c.value)) && - _info(model, c).type == SEMIINTEGER + _info(model, c).type == CPX_SEMIINT end function MOI.get( @@ -878,22 +1075,23 @@ _bounds(s::MOI.EqualTo{Float64}) = (s.value, s.value) _bounds(s::MOI.Interval{Float64}) = (s.lower, s.upper) function _throw_if_existing_lower( - bound::BoundType, var_type::VariableType, + bound::_BoundType, + var_type::Char, new_set::Type{<:MOI.AbstractSet}, - variable::MOI.VariableIndex + variable::MOI.VariableIndex, ) - existing_set = if bound == LESS_AND_GREATER_THAN || bound == GREATER_THAN + existing_set = if bound == _LESS_AND_GREATER_THAN || bound == _GREATER_THAN MOI.GreaterThan{Float64} - elseif bound == INTERVAL + elseif bound == _INTERVAL MOI.Interval{Float64} - elseif bound == EQUAL_TO + elseif bound == _EQUAL_TO MOI.EqualTo{Float64} - elseif var_type == SEMIINTEGER + elseif var_type == CPX_SEMIINT MOI.Semiinteger{Float64} - elseif var_type == SEMICONTINUOUS + elseif var_type == CPX_SEMICONT MOI.Semicontinuous{Float64} else - nothing # Also covers `NONE` and `LESS_THAN`. + nothing # Also covers `_NONE` and `_LESS_THAN`. end if existing_set !== nothing throw(MOI.LowerBoundAlreadySet{existing_set, new_set}(variable)) @@ -901,23 +1099,23 @@ function _throw_if_existing_lower( end function _throw_if_existing_upper( - bound::BoundType, - var_type::VariableType, + bound::_BoundType, + var_type::Char, new_set::Type{<:MOI.AbstractSet}, variable::MOI.VariableIndex ) - existing_set = if bound == LESS_AND_GREATER_THAN || bound == LESS_THAN + existing_set = if bound == _LESS_AND_GREATER_THAN || bound == _LESS_THAN MOI.LessThan{Float64} - elseif bound == INTERVAL + elseif bound == _INTERVAL MOI.Interval{Float64} - elseif bound == EQUAL_TO + elseif bound == _EQUAL_TO MOI.EqualTo{Float64} - elseif var_type == SEMIINTEGER + elseif var_type == CPX_SEMIINT MOI.Semiinteger{Float64} - elseif var_type == SEMICONTINUOUS + elseif var_type == CPX_SEMICONT MOI.Semicontinuous{Float64} else - nothing # Also covers `NONE` and `GREATER_THAN`. + nothing # Also covers `_NONE` and `_GREATER_THAN`. end if existing_set !== nothing throw(MOI.UpperBoundAlreadySet{existing_set, new_set}(variable)) @@ -926,23 +1124,23 @@ end function MOI.add_constraint( model::Optimizer, f::MOI.SingleVariable, s::S -) where {S <: SCALAR_SETS} +) where {S <: _SCALAR_SETS} info = _info(model, f.variable) if S <: MOI.LessThan{Float64} _throw_if_existing_upper(info.bound, info.type, S, f.variable) - info.bound = info.bound == GREATER_THAN ? LESS_AND_GREATER_THAN : LESS_THAN + info.bound = info.bound == _GREATER_THAN ? _LESS_AND_GREATER_THAN : _LESS_THAN elseif S <: MOI.GreaterThan{Float64} _throw_if_existing_lower(info.bound, info.type, S, f.variable) - info.bound = info.bound == LESS_THAN ? LESS_AND_GREATER_THAN : GREATER_THAN + info.bound = info.bound == _LESS_THAN ? _LESS_AND_GREATER_THAN : _GREATER_THAN elseif S <: MOI.EqualTo{Float64} _throw_if_existing_lower(info.bound, info.type, S, f.variable) _throw_if_existing_upper(info.bound, info.type, S, f.variable) - info.bound = EQUAL_TO + info.bound = _EQUAL_TO else @assert S <: MOI.Interval{Float64} _throw_if_existing_lower(info.bound, info.type, S, f.variable) _throw_if_existing_upper(info.bound, info.type, S, f.variable) - info.bound = INTERVAL + info.bound = _INTERVAL end index = MOI.ConstraintIndex{MOI.SingleVariable, typeof(s)}(f.variable.value) MOI.set(model, MOI.ConstraintSet(), index, s) @@ -951,24 +1149,24 @@ end function MOI.add_constraints( model::Optimizer, f::Vector{MOI.SingleVariable}, s::Vector{S} -) where {S <: SCALAR_SETS} +) where {S <: _SCALAR_SETS} for fi in f info = _info(model, fi.variable) if S <: MOI.LessThan{Float64} _throw_if_existing_upper(info.bound, info.type, S, fi.variable) - info.bound = info.bound == GREATER_THAN ? LESS_AND_GREATER_THAN : LESS_THAN + info.bound = info.bound == _GREATER_THAN ? _LESS_AND_GREATER_THAN : _LESS_THAN elseif S <: MOI.GreaterThan{Float64} _throw_if_existing_lower(info.bound, info.type, S, fi.variable) - info.bound = info.bound == LESS_THAN ? LESS_AND_GREATER_THAN : GREATER_THAN + info.bound = info.bound == _LESS_THAN ? _LESS_AND_GREATER_THAN : _GREATER_THAN elseif S <: MOI.EqualTo{Float64} _throw_if_existing_lower(info.bound, info.type, S, fi.variable) _throw_if_existing_upper(info.bound, info.type, S, fi.variable) - info.bound = EQUAL_TO + info.bound = _EQUAL_TO else @assert S <: MOI.Interval{Float64} _throw_if_existing_lower(info.bound, info.type, S, fi.variable) _throw_if_existing_upper(info.bound, info.type, S, fi.variable) - info.bound = INTERVAL + info.bound = _INTERVAL end end indices = [ @@ -989,17 +1187,20 @@ function _set_bounds( lower, upper = _bounds(s) info = _info(model, c) if lower !== nothing - push!(columns, Cint(info.column)) + push!(columns, Cint(info.column - 1)) push!(senses, Cchar('L')) push!(values, lower) end if upper !== nothing - push!(columns, Cint(info.column)) + push!(columns, Cint(info.column - 1)) push!(senses, Cchar('U')) push!(values, upper) end end - CPLEX.c_api_chgbds(model.inner, columns, senses, values) + ret = CPXchgbds( + model.env, model.lp, length(columns), columns, senses, values + ) + _check_ret(model, ret) return end @@ -1010,10 +1211,10 @@ function MOI.delete( MOI.throw_if_not_valid(model, c) info = _info(model, c) _set_variable_upper_bound(model, info, Inf) - if info.bound == LESS_AND_GREATER_THAN - info.bound = GREATER_THAN + if info.bound == _LESS_AND_GREATER_THAN + info.bound = _GREATER_THAN else - info.bound = NONE + info.bound = _NONE end info.lessthan_name = "" model.name_to_constraint_index = nothing @@ -1034,19 +1235,43 @@ function _set_variable_lower_bound(model, info, value) if info.num_soc_constraints == 0 # No SOC constraints, set directly. @assert isnan(info.lower_bound_if_soc) - CPLEX.c_api_chgbds(model.inner, Cint[info.column], Cchar['L'], [value]) + ret = CPXchgbds( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}('L'), + Ref(value), + ) + _check_ret(model, ret) elseif value >= 0.0 # Regardless of whether there are SOC constraints, this is a valid bound # for the SOC constraint and should over-ride any previous bounds. info.lower_bound_if_soc = NaN - CPLEX.c_api_chgbds(model.inner, Cint[info.column], Cchar['L'], [value]) + ret = CPXchgbds( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}('L'), + Ref(value), + ) + _check_ret(model, ret) elseif isnan(info.lower_bound_if_soc) # Previously, we had a non-negative lower bound (i.e., it was set in the # case above). Now we're setting this with a negative one, but there are # still some SOC constraints, so we cache `value` and set the variable # lower bound to `0.0`. @assert value < 0.0 - CPLEX.c_api_chgbds(model.inner, Cint[info.column], Cchar['L'], [0.0]) + ret = CPXchgbds( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}('L'), + Ref(0.0), + ) + _check_ret(model, ret) info.lower_bound_if_soc = value else # Previously, we had a negative lower bound. We're setting this with @@ -1071,18 +1296,34 @@ function _get_variable_lower_bound(model, info) @assert info.lower_bound_if_soc < 0.0 return info.lower_bound_if_soc end - lb = CPLEX.c_api_getlb(model.inner, Cint(info.column), Cint(info.column))[1] - return lb == -CPX_INFBOUND ? -Inf : lb + lb = Ref{Cdouble}() + ret = CPXgetlb( + model.env, model.lp, lb, Cint(info.column - 1), Cint(info.column - 1) + ) + _check_ret(model, ret) + return lb[] == -CPX_INFBOUND ? -Inf : lb[] end function _set_variable_upper_bound(model, info, value) - CPLEX.c_api_chgbds(model.inner, Cint[info.column], Cchar['U'], [value]) + ret = CPXchgbds( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}('U'), + Ref(value), + ) + _check_ret(model, ret) return end function _get_variable_upper_bound(model, info) - ub = CPLEX.c_api_getub(model.inner, Cint(info.column), Cint(info.column))[1] - return ub == CPX_INFBOUND ? Inf : ub + ub = Ref{Cdouble}() + ret = CPXgetub( + model.env, model.lp, ub, Cint(info.column - 1), Cint(info.column - 1) + ) + _check_ret(model, ret) + return ub[] == CPX_INFBOUND ? Inf : ub[] end function MOI.delete( @@ -1092,10 +1333,10 @@ function MOI.delete( MOI.throw_if_not_valid(model, c) info = _info(model, c) _set_variable_lower_bound(model, info, -Inf) - if info.bound == LESS_AND_GREATER_THAN - info.bound = LESS_THAN + if info.bound == _LESS_AND_GREATER_THAN + info.bound = _LESS_THAN else - info.bound = NONE + info.bound = _NONE end info.greaterthan_interval_or_equalto_name = "" model.name_to_constraint_index = nothing @@ -1110,7 +1351,7 @@ function MOI.delete( info = _info(model, c) _set_variable_lower_bound(model, info, -Inf) _set_variable_upper_bound(model, info, Inf) - info.bound = NONE + info.bound = _NONE info.greaterthan_interval_or_equalto_name = "" model.name_to_constraint_index = nothing return @@ -1124,7 +1365,7 @@ function MOI.delete( info = _info(model, c) _set_variable_lower_bound(model, info, -Inf) _set_variable_upper_bound(model, info, Inf) - info.bound = NONE + info.bound = _NONE info.greaterthan_interval_or_equalto_name = "" model.name_to_constraint_index = nothing return @@ -1174,7 +1415,7 @@ function MOI.set( model::Optimizer, ::MOI.ConstraintSet, c::MOI.ConstraintIndex{MOI.SingleVariable, S}, s::S -) where {S<:SCALAR_SETS} +) where {S<:_SCALAR_SETS} MOI.throw_if_not_valid(model, c) lower, upper = _bounds(s) info = _info(model, c) @@ -1191,8 +1432,15 @@ function MOI.add_constraint( model::Optimizer, f::MOI.SingleVariable, ::MOI.ZeroOne ) info = _info(model, f.variable) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['B']) - info.type = BINARY + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_BINARY), + ) + _check_ret(model, ret) + info.type = CPX_BINARY return MOI.ConstraintIndex{MOI.SingleVariable, MOI.ZeroOne}(f.variable.value) end @@ -1201,8 +1449,15 @@ function MOI.delete( ) MOI.throw_if_not_valid(model, c) info = _info(model, c) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['C']) - info.type = CONTINUOUS + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_CONTINUOUS), + ) + _check_ret(model, ret) + info.type = CPX_CONTINUOUS info.type_constraint_name = "" model.name_to_constraint_index = nothing return @@ -1221,8 +1476,15 @@ function MOI.add_constraint( model::Optimizer, f::MOI.SingleVariable, ::MOI.Integer ) info = _info(model, f.variable) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['I']) - info.type = INTEGER + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_INTEGER), + ) + _check_ret(model, ret) + info.type = CPX_INTEGER return MOI.ConstraintIndex{MOI.SingleVariable, MOI.Integer}(f.variable.value) end @@ -1231,8 +1493,15 @@ function MOI.delete( ) MOI.throw_if_not_valid(model, c) info = _info(model, c) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['C']) - info.type = CONTINUOUS + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_CONTINUOUS), + ) + _check_ret(model, ret) + info.type = CPX_CONTINUOUS info.type_constraint_name = "" model.name_to_constraint_index = nothing return @@ -1253,10 +1522,17 @@ function MOI.add_constraint( info = _info(model, f.variable) _throw_if_existing_lower(info.bound, info.type, typeof(s), f.variable) _throw_if_existing_upper(info.bound, info.type, typeof(s), f.variable) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['S']) + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_SEMICONT), + ) + _check_ret(model, ret) _set_variable_lower_bound(model, info, s.lower) _set_variable_upper_bound(model, info, s.upper) - info.type = SEMICONTINUOUS + info.type = CPX_SEMICONT return MOI.ConstraintIndex{MOI.SingleVariable, MOI.Semicontinuous{Float64}}(f.variable.value) end @@ -1266,10 +1542,17 @@ function MOI.delete( ) MOI.throw_if_not_valid(model, c) info = _info(model, c) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['C']) + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_CONTINUOUS), + ) + _check_ret(model, ret) _set_variable_lower_bound(model, info, -Inf) _set_variable_upper_bound(model, info, Inf) - info.type = CONTINUOUS + info.type = CPX_CONTINUOUS info.type_constraint_name = "" model.name_to_constraint_index = nothing return @@ -1293,10 +1576,17 @@ function MOI.add_constraint( info = _info(model, f.variable) _throw_if_existing_lower(info.bound, info.type, typeof(s), f.variable) _throw_if_existing_upper(info.bound, info.type, typeof(s), f.variable) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['N']) + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_SEMIINT), + ) + _check_ret(model, ret) _set_variable_lower_bound(model, info, s.lower) _set_variable_upper_bound(model, info, s.upper) - info.type = SEMIINTEGER + info.type = CPX_SEMIINT return MOI.ConstraintIndex{MOI.SingleVariable, MOI.Semiinteger{Float64}}(f.variable.value) end @@ -1306,10 +1596,17 @@ function MOI.delete( ) MOI.throw_if_not_valid(model, c) info = _info(model, c) - CPLEX.c_api_chgctype(model.inner, Cint[info.column], Cchar['C']) + ret = CPXchgctype( + model.env, + model.lp, + 1, + Ref{Cint}(info.column - 1), + Ref{Cchar}(CPX_CONTINUOUS), + ) + _check_ret(model, ret) _set_variable_lower_bound(model, info, -Inf) _set_variable_upper_bound(model, info, Inf) - info.type = CONTINUOUS + info.type = CPX_CONTINUOUS info.type_constraint_name = "" model.name_to_constraint_index = nothing return @@ -1402,17 +1699,30 @@ function MOI.add_constraint( end model.last_constraint_index += 1 model.affine_constraint_info[model.last_constraint_index] = - ConstraintInfo(length(model.affine_constraint_info) + 1, s) + _ConstraintInfo(length(model.affine_constraint_info) + 1, s) indices, coefficients = _indices_and_coefficients(model, f) sense, rhs = _sense_and_rhs(s) - CPLEX.c_api_addrows( - model.inner, Cint[1], indices, coefficients, [sense], [rhs] + ret = CPXaddrows( + model.env, + model.lp, + 0, + 1, + length(indices), + Ref(rhs), + Ref{Cchar}(sense), + Cint[0, length(indices)], + indices, + coefficients, + C_NULL, + C_NULL, ) + _check_ret(model, ret) return MOI.ConstraintIndex{typeof(f), typeof(s)}(model.last_constraint_index) end function MOI.add_constraints( - model::Optimizer, f::Vector{MOI.ScalarAffineFunction{Float64}}, + model::Optimizer, + f::Vector{MOI.ScalarAffineFunction{Float64}}, s::Vector{<:Union{MOI.GreaterThan{Float64}, MOI.LessThan{Float64}, MOI.EqualTo{Float64}}} ) if length(f) != length(s) @@ -1430,7 +1740,7 @@ function MOI.add_constraints( # Initialize storage indices = Vector{MOI.ConstraintIndex{eltype(f), eltype(s)}}(undef, length(f)) row_starts = Vector{Cint}(undef, length(f) + 1) - row_starts[1] = 1 + row_starts[1] = 0 columns = Vector{Cint}(undef, nnz) coefficients = Vector{Float64}(undef, nnz) senses = Vector{Cchar}(undef, length(f)) @@ -1440,19 +1750,32 @@ function MOI.add_constraints( senses[i], rhss[i] = _sense_and_rhs(si) row_starts[i + 1] = row_starts[i] + length(fi.terms) _indices_and_coefficients( - view(columns, row_starts[i]:row_starts[i + 1] - 1), - view(coefficients, row_starts[i]:row_starts[i + 1] - 1), - model, fi + view(columns, (1 + row_starts[i]):row_starts[i + 1]), + view(coefficients, (1 + row_starts[i]):row_starts[i + 1]), + model, + fi, ) model.last_constraint_index += 1 indices[i] = MOI.ConstraintIndex{eltype(f), eltype(s)}(model.last_constraint_index) model.affine_constraint_info[model.last_constraint_index] = - ConstraintInfo(length(model.affine_constraint_info) + 1, si) + _ConstraintInfo(length(model.affine_constraint_info) + 1, si) end pop!(row_starts) - CPLEX.c_api_addrows( - model.inner, row_starts, columns, coefficients, senses, rhss + ret = CPXaddrows( + model.env, + model.lp, + 0, + length(f), + length(coefficients), + rhss, + senses, + row_starts, + columns, + coefficients, + C_NULL, + C_NULL, ) + _check_ret(model, ret) return indices end @@ -1461,7 +1784,8 @@ function MOI.delete( c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any} ) row = _info(model, c).row - CPLEX.c_api_delrows(model.inner, Cint(row), Cint(row)) + ret = CPXdelrows(model.env, model.lp, Cint(row - 1), Cint(row - 1)) + _check_ret(model, ret) for (key, info) in model.affine_constraint_info if info.row > row info.row -= 1 @@ -1475,20 +1799,28 @@ end function MOI.get( model::Optimizer, ::MOI.ConstraintSet, - c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S} + c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S}, ) where {S} - rhs = Vector{Cdouble}(undef, 1) + rhs = Ref{Cdouble}() row = _info(model, c).row - CPLEX.c_api_getrhs(model.inner, rhs, Cint(row), Cint(row)) - return S(rhs[1]) + ret = CPXgetrhs(model.env, model.lp, rhs, Cint(row - 1), Cint(row - 1)) + return S(rhs[]) end function MOI.set( model::Optimizer, ::MOI.ConstraintSet, - c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S}, s::S + c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S}, + s::S, ) where {S} - CPLEX.c_api_chgrhs(model.inner, Cint[_info(model, c).row], [MOI.constant(s)]) + ret = CPXchgrhs( + model.env, + model.lp, + 1, + Ref{Cint}(_info(model, c).row - 1), + Ref(MOI.constant(s)), + ) + _check_ret(model, ret) return end @@ -1497,16 +1829,44 @@ function MOI.get( ::MOI.ConstraintFunction, c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S} ) where {S} - row = _info(model, c).row - (nzcnt, rmatbeg, rmatind, rmatval) = c_api_getrows(model.inner, Cint(row), Cint(row)) + row = Cint(_info(model, c).row - 1) + surplus_p = Ref{Cint}() + CPXgetrows( + model.env, + model.lp, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + 0, + surplus_p, + row, + row, + ) + rmatbeg = Vector{Cint}(undef, 2) + rmatind = Vector{Cint}(undef, -surplus_p[]) + rmatval = Vector{Cdouble}(undef, -surplus_p[]) + nzcnt_p = Ref{Cint}() + ret = CPXgetrows( + model.env, + model.lp, + nzcnt_p, + rmatbeg, + rmatind, + rmatval, + -surplus_p[], + surplus_p, + row, + row, + ) + _check_ret(model, ret) terms = MOI.ScalarAffineTerm{Float64}[] - for i = 1:nzcnt - iszero(rmatval[i]) && continue + for i = 1:nzcnt_p[] push!( terms, MOI.ScalarAffineTerm( rmatval[i], - model.variable_info[CleverDicts.LinearIndex(rmatind[i])].index + model.variable_info[CleverDicts.LinearIndex(rmatind[i] + 1)].index ) ) end @@ -1516,7 +1876,7 @@ end function MOI.get( model::Optimizer, ::MOI.ConstraintName, - c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any} + c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any}, ) return _info(model, c).name end @@ -1524,14 +1884,15 @@ end function MOI.set( model::Optimizer, ::MOI.ConstraintName, c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any}, - name::String + name::String, ) info = _info(model, c) info.name = name if isascii(name) - CPLEX.c_api_chgname( - model.inner, Cchar('r'), Cint(info.row - 1), name + ret = CPXchgname( + model.env, model.lp, Cchar('r'), Cint(info.row - 1), name ) + _check_ret(model, ret) end model.name_to_constraint_index = nothing return @@ -1633,17 +1994,31 @@ end function MOI.add_constraint( model::Optimizer, - f::MOI.ScalarQuadraticFunction{Float64}, s::SCALAR_SETS + f::MOI.ScalarQuadraticFunction{Float64}, s::_SCALAR_SETS ) if !iszero(f.constant) throw(MOI.ScalarFunctionConstantNotZero{Float64, typeof(f), typeof(s)}(f.constant)) end indices, coefficients, I, J, V = _indices_and_coefficients(model, f) sense, rhs = _sense_and_rhs(s) - CPLEX.add_qconstr!(model.inner, indices, coefficients, I, J, V, sense, rhs) + ret = CPXaddqconstr( + model.env, + model.lp, + length(indices), + length(V), + rhs, + sense, + indices, + coefficients, + I, + J, + V, + C_NULL, + ) + _check_ret(model, ret) model.last_constraint_index += 1 model.quadratic_constraint_info[model.last_constraint_index] = - ConstraintInfo(length(model.quadratic_constraint_info) + 1, s) + _ConstraintInfo(length(model.quadratic_constraint_info) + 1, s) return MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, typeof(s)}(model.last_constraint_index) end @@ -1660,7 +2035,10 @@ function MOI.delete( c::MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, S} ) where {S} info = _info(model, c) - CPLEX.c_api_delqconstrs(model.inner, Cint(info.row - 1), Cint(info.row - 1)) + ret = CPXdelqconstrs( + model.env, model.lp, Cint(info.row - 1), Cint(info.row - 1) + ) + _check_ret(model, ret) for (key, info_2) in model.quadratic_constraint_info if info_2.row > info.row info_2.row -= 1 @@ -1676,19 +2054,84 @@ function MOI.get( ::MOI.ConstraintSet, c::MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, S} ) where {S} - _, _, _, _, _, _, rhs = CPLEX.c_api_getqconstr(model.inner, _info(model, c).row) - return S(rhs) + rhs_p = Ref{Cdouble}() + ret = CPXgetqconstr( + model.env, + model.lp, + C_NULL, + C_NULL, + rhs_p, + C_NULL, + C_NULL, + C_NULL, + 0, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + 0, + C_NULL, + Cint(_info(model, c).row - 1), + ) + return S(rhs_p[]) +end + +function _CPXgetqconstr(model::Optimizer, c::MOI.ConstraintIndex) + row = Cint(_info(model, c).row - 1) + linsurplus_p, quadsurplus_p = Ref{Cint}(), Ref{Cint}() + CPXgetqconstr( + model.env, + model.lp, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + 0, + linsurplus_p, + C_NULL, + C_NULL, + C_NULL, + 0, + quadsurplus_p, + row, + ) + linind = Vector{Cint}(undef, -linsurplus_p[]) + linval = Vector{Cdouble}(undef, -linsurplus_p[]) + quadrow = Vector{Cint}(undef, -quadsurplus_p[]) + quadcol = Vector{Cint}(undef, -quadsurplus_p[]) + quadval = Vector{Cdouble}(undef, -quadsurplus_p[]) + ret = CPXgetqconstr( + model.env, + model.lp, + Ref{Cint}(), + Ref{Cint}(), + Ref{Cdouble}(), + Ref{Cchar}(), + linind, + linval, + -linsurplus_p[], + linsurplus_p, + quadrow, + quadcol, + quadval, + -quadsurplus_p[], + quadsurplus_p, + row, + ) + _check_ret(model, ret) + return linind, linval, quadrow, quadcol, quadval end function MOI.get( model::Optimizer, ::MOI.ConstraintFunction, - c::MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, S} + c::MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, S}, ) where {S} - affine_cols, affine_coefficients, I, J, V = CPLEX.c_api_getqconstr(model.inner, _info(model, c).row) + a, b, I, J, V = _CPXgetqconstr(model, c) affine_terms = MOI.ScalarAffineTerm{Float64}[] - for (col, coef) in zip(affine_cols, affine_coefficients) - iszero(coef) && continue + for (col, coef) in zip(a, b) push!( affine_terms, MOI.ScalarAffineTerm( @@ -1735,11 +2178,11 @@ end ### VectorOfVariables-in-SOS{I|II} ### -const SOS = Union{MOI.SOS1{Float64}, MOI.SOS2{Float64}} +const _SOS = Union{MOI.SOS1{Float64}, MOI.SOS2{Float64}} function _info( model::Optimizer, - key::MOI.ConstraintIndex{MOI.VectorOfVariables, <:SOS} + key::MOI.ConstraintIndex{MOI.VectorOfVariables, <:_SOS} ) if haskey(model.sos_constraint_info, key.value) return model.sos_constraint_info[key.value] @@ -1747,8 +2190,8 @@ function _info( throw(MOI.InvalidIndex(key)) end -_sos_type(::MOI.SOS1) = :SOS1 -_sos_type(::MOI.SOS2) = :SOS2 +_sos_type(::MOI.SOS1) = CPX_TYPE_SOS1 +_sos_type(::MOI.SOS2) = CPX_TYPE_SOS2 function MOI.is_valid( model::Optimizer, @@ -1763,23 +2206,35 @@ function MOI.is_valid( end function MOI.add_constraint( - model::Optimizer, f::MOI.VectorOfVariables, s::SOS -) - columns = Int[_info(model, v).column for v in f.variables] - CPLEX.add_sos!(model.inner, _sos_type(s), columns, s.weights) + model::Optimizer, f::MOI.VectorOfVariables, s::_SOS +) + columns = Cint[column(model, v) - 1 for v in f.variables] + ret = CPXaddsos( + model.env, + model.lp, + 1, + length(columns), + Ref{Cchar}(_sos_type(s)), + Ref{Cint}(0), + columns, + s.weights, + C_NULL, + ) + _check_ret(model, ret) model.last_constraint_index += 1 index = MOI.ConstraintIndex{MOI.VectorOfVariables, typeof(s)}(model.last_constraint_index) - model.sos_constraint_info[index.value] = ConstraintInfo( + model.sos_constraint_info[index.value] = _ConstraintInfo( length(model.sos_constraint_info) + 1, s ) return index end function MOI.delete( - model::Optimizer, c::MOI.ConstraintIndex{MOI.VectorOfVariables, <:SOS} + model::Optimizer, c::MOI.ConstraintIndex{MOI.VectorOfVariables, <:_SOS} ) - row = _info(model, c).row - CPLEX.c_api_delsos(model.inner, row - 1, row - 1) + row = Cint(_info(model, c).row - 1) + ret = CPXdelsos(model.env, model.lp, row, row) + _check_ret(model, ret) for (key, info) in model.sos_constraint_info if info.row > row info.row -= 1 @@ -1814,18 +2269,78 @@ function MOI.get( model::Optimizer, ::MOI.ConstraintSet, c::MOI.ConstraintIndex{MOI.VectorOfVariables, S} -) where {S <: SOS} - _, weights, _ = CPLEX.c_api_getsos(model.inner, _info(model, c).row - 1) - return S(weights) +) where {S <: _SOS} + surplus_p = Ref{Cint}() + row = Cint(_info(model, c).row - 1) + CPXgetsos( + model.env, + model.lp, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + 0, + surplus_p, + row, + row + ) + sosind = Vector{Cint}(undef, -surplus_p[]) + soswt = Vector{Cdouble}(undef, -surplus_p[]) + ret = CPXgetsos( + model.env, + model.lp, + Ref{Cint}(), + Ref{Cchar}(), + Ref{Cint}(), + sosind, + soswt, + -surplus_p[], + surplus_p, + row, + row + ) + _check_ret(model, ret) + return S(soswt) end function MOI.get( model::Optimizer, ::MOI.ConstraintFunction, c::MOI.ConstraintIndex{MOI.VectorOfVariables, S} -) where {S <: SOS} - cols, _, _ = CPLEX.c_api_getsos(model.inner, _info(model, c).row - 1) +) where {S <: _SOS} + surplus_p = Ref{Cint}() + row = Cint(_info(model, c).row - 1) + CPXgetsos( + model.env, + model.lp, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + C_NULL, + 0, + surplus_p, + row, + row + ) + sosind = Vector{Cint}(undef, -surplus_p[]) + soswt = Vector{Cdouble}(undef, -surplus_p[]) + ret = CPXgetsos( + model.env, + model.lp, + Ref{Cint}(), + Ref{Cchar}(), + Ref{Cint}(), + sosind, + soswt, + -surplus_p[], + surplus_p, + row, + row, + ) + _check_ret(model, ret) return MOI.VectorOfVariables([ - model.variable_info[CleverDicts.LinearIndex(i + 1)].index for i in cols + model.variable_info[CleverDicts.LinearIndex(i + 1)].index for i in sosind ]) end @@ -1833,7 +2348,7 @@ end ### Optimize methods. ### -function check_moi_callback_validity(model::Optimizer) +function _check_moi_callback_validity(model::Optimizer) has_moi_callback = model.lazy_callback !== nothing || model.user_cut_callback !== nothing || @@ -1844,151 +2359,228 @@ function check_moi_callback_validity(model::Optimizer) return has_moi_callback end -const INTEGER_TYPES = Set{Symbol}([:MILP, :MIQP, :MIQCP]) -const CONTINUOUS_TYPES = Set{Symbol}([:LP, :QP, :QCP]) - -function _make_problem_type_integer(optimizer::Optimizer) - optimizer.inner.has_int = true - prob_type = get_prob_type(optimizer.inner) - prob_type in INTEGER_TYPES && return - # prob_type_toggle_map is defined in file CplexSolverInterface.jl - set_prob_type!(optimizer.inner, prob_type_toggle_map[prob_type]) +function _make_problem_type_continuous(model::Optimizer) + prob_type = CPXgetprobtype(model.env, model.lp) + # There are prob_types other than the ones listed here, but the + # CPLEX.Optimizer should never encounter them. + if prob_type == CPXPROB_MILP + ret = CPXchgprobtype(model.env, model.lp, CPXPROB_LP) + _check_ret(model, ret) + elseif prob_type == CPXPROB_MIQP + ret = CPXchgprobtype(model.env, model.lp, CPXPROB_QP) + _check_ret(model, ret) + elseif prob_type == CPXPROB_MIQCP + ret = CPXchgprobtype(model.env, model.lp, CPXPROB_QCP) + _check_ret(model, ret) + end return end -function _make_problem_type_continuous(optimizer::Optimizer) - optimizer.inner.has_int = false - prob_type = get_prob_type(optimizer.inner) - prob_type in CONTINUOUS_TYPES && return - # prob_type_toggle_map is defined in file CplexSolverInterface.jl - set_prob_type!(optimizer.inner, prob_type_toggle_map[prob_type]) - return +function _has_discrete_variables(model::Optimizer) + if length(model.sos_constraint_info) > 0 + return true + end + return any(v -> v.type != CPX_CONTINUOUS, values(model.variable_info)) end -function _has_discrete_variables(model::Optimizer) - for v in values(model.variable_info) - if v.type != CONTINUOUS - return true - end +function _optimize!(model) + prob_type = CPXgetprobtype(model.env, model.lp) + # There are prob_types other than the ones listed here, but the + # CPLEX.Optimizer should never encounter them. + ret = if prob_type in (CPXPROB_MILP, CPXPROB_MIQP, CPXPROB_MIQCP) + CPXmipopt(model.env, model.lp) + elseif prob_type in (CPXPROB_QP, CPXPROB_QCP) + CPXqpopt(model.env, model.lp) + else + @assert prob_type == CPXPROB_LP + CPXlpopt(model.env, model.lp) end - return length(model.sos_constraint_info) > 0 + _check_ret(model, ret) + return end function MOI.optimize!(model::Optimizer) - # Initialize callbacks if necessary. - if check_moi_callback_validity(model) - MOI.set(model, CallbackFunction(), default_moi_callback(model)) + if _check_moi_callback_validity(model) + context_mask = UInt16(0) + if model.lazy_callback !== nothing + context_mask |= CPX_CALLBACKCONTEXT_CANDIDATE + end + if model.user_cut_callback !== nothing || model.heuristic_callback !== nothing + context_mask |= CPX_CALLBACKCONTEXT_RELAXATION + end + MOI.set( + model, CallbackFunction(context_mask), _default_moi_callback(model) + ) model.has_generic_callback = false end - model.cached_solution = nothing if _has_discrete_variables(model) - _make_problem_type_integer(model) varindices = Cint[] values = Float64[] for (key, info) in model.variable_info if info.start !== nothing - push!(varindices, Cint(info.column)) + push!(varindices, Cint(info.column - 1)) push!(values, info.start) end end - CPLEX.set_warm_start!( - model.inner, varindices, values, CPX_MIPSTART_AUTO + ret = CPXaddmipstarts( + model.env, + model.lp, + 1, + length(varindices), + Ref{Cint}(0), + varindices, + values, + Ref{Cint}(CPX_MIPSTART_AUTO), + C_NULL, ) + _check_ret(model, ret) else + # CPLEX is annoying. If you add a discrete constraint, then delete it, + # CPLEX _DOES NOT_ change the prob type back to the continuous version. + # That means we dispatch to mipopt instead of lpopt/qpopt and we fail to + # compute the expected dual information. Force the change here if + # needed. _make_problem_type_continuous(model) end start_time = time() - CPLEX.optimize!(model.inner) - solve_time = time() - start_time - - model.cached_solution = CachedSolution(model) - model.cached_solution.solve_time = solve_time - status = MOI.get(model, MOI.PrimalStatus()) - if status == MOI.FEASIBLE_POINT - CPLEX.c_api_getx(model.inner, model.cached_solution.variable_primal) - CPLEX.c_api_getax(model.inner, model.cached_solution.linear_primal) - CPLEX.c_api_getxqxax(model.inner, model.cached_solution.quadratic_primal) - elseif status == MOI.INFEASIBILITY_CERTIFICATE - model.cached_solution.variable_primal = get_unbounded_ray(model.inner) - model.cached_solution.has_primal_certificate = true - end - status = MOI.get(model, MOI.DualStatus()) - if status == MOI.FEASIBLE_POINT - CPLEX.c_api_getdj(model.inner, model.cached_solution.variable_dual) - CPLEX.c_api_getpi(model.inner, model.cached_solution.linear_dual) - elseif status == MOI.INFEASIBILITY_CERTIFICATE - model.cached_solution.linear_dual = get_infeasibility_ray(model.inner) - model.cached_solution.has_dual_certificate = true + try + _optimize!(model) + catch ex + if ex isa InterruptException + terminate(model) + else + rethrow(ex) + end + end + model.solve_time = time() - start_time + model.has_primal_certificate = false + model.has_dual_certificate = false + if MOI.get(model, MOI.PrimalStatus()) == MOI.INFEASIBILITY_CERTIFICATE + resize!(model.certificate, length(model.variable_info)) + ret = CPXgetray(model.env, model.lp, model.certificate) + _check_ret(model, ret) + model.has_primal_certificate = true + elseif MOI.get(model, MOI.DualStatus()) == MOI.INFEASIBILITY_CERTIFICATE + resize!(model.certificate, length(model.affine_constraint_info)) + ret = CPXdualfarkas(model.env, model.lp, model.certificate, C_NULL) + _check_ret(model, ret) + model.has_dual_certificate = true end return end function _throw_if_optimize_in_progress(model, attr) - if model.callback_state != CB_NONE + if model.callback_state != _CB_NONE throw(MOI.OptimizeInProgress(attr)) end end function MOI.get(model::Optimizer, attr::MOI.RawStatusString) _throw_if_optimize_in_progress(model, attr) - statind = c_api_getstat(model.inner) - return c_api_getstatstring(model.inner, statind) -end + stat = CPXgetstat(model.env, model.lp) + buffer_str = Vector{Cchar}(undef, CPXMESSAGEBUFSIZE) + p = CPXgetstatstring(model.env, stat, buffer_str) + return unsafe_string(p) +end + +# These status symbols are taken from libcpx_common at CPLEX 12.10. +const _TERMINATION_STATUSES = Dict( + CPX_STAT_ABORT_DETTIME_LIM => MOI.TIME_LIMIT, + CPX_STAT_ABORT_DUAL_OBJ_LIM => MOI.OBJECTIVE_LIMIT, + CPX_STAT_ABORT_IT_LIM => MOI.ITERATION_LIMIT, + CPX_STAT_ABORT_OBJ_LIM => MOI.OBJECTIVE_LIMIT, + CPX_STAT_ABORT_PRIM_OBJ_LIM => MOI.OBJECTIVE_LIMIT, + CPX_STAT_ABORT_TIME_LIM => MOI.TIME_LIMIT, + CPX_STAT_ABORT_USER => MOI.INTERRUPTED, + CPX_STAT_BENDERS_NUM_BEST => MOI.NUMERICAL_ERROR, + # These should never arise for TerminationStatus + # CPX_STAT_CONFLICT_ABORT_CONTRADICTION + # CPX_STAT_CONFLICT_ABORT_DETTIME_LIM + # CPX_STAT_CONFLICT_ABORT_IT_LIM + # CPX_STAT_CONFLICT_ABORT_MEM_LIM + # CPX_STAT_CONFLICT_ABORT_NODE_LIM + # CPX_STAT_CONFLICT_ABORT_OBJ_LIM + # CPX_STAT_CONFLICT_ABORT_TIME_LIM + # CPX_STAT_CONFLICT_ABORT_USER + # CPX_STAT_CONFLICT_FEASIBLE + # CPX_STAT_CONFLICT_MINIMAL + CPX_STAT_FEASIBLE => MOI.LOCALLY_SOLVED, + CPX_STAT_FEASIBLE_RELAXED_INF => MOI.LOCALLY_SOLVED, + CPX_STAT_FEASIBLE_RELAXED_QUAD => MOI.LOCALLY_SOLVED, + CPX_STAT_FEASIBLE_RELAXED_SUM => MOI.LOCALLY_SOLVED, + CPX_STAT_FIRSTORDER => MOI.LOCALLY_SOLVED, + CPX_STAT_INFEASIBLE => MOI.INFEASIBLE, + CPX_STAT_INForUNBD => MOI.INFEASIBLE_OR_UNBOUNDED, + CPX_STAT_MULTIOBJ_INFEASIBLE => MOI.INFEASIBLE, + CPX_STAT_MULTIOBJ_INForUNBD => MOI.INFEASIBLE_OR_UNBOUNDED, + CPX_STAT_MULTIOBJ_NON_OPTIMAL => MOI.LOCALLY_SOLVED, + CPX_STAT_MULTIOBJ_OPTIMAL => MOI.OPTIMAL, + CPX_STAT_MULTIOBJ_STOPPED => MOI.INTERRUPTED, + CPX_STAT_MULTIOBJ_UNBOUNDED => MOI.DUAL_INFEASIBLE, + CPX_STAT_NUM_BEST => MOI.NUMERICAL_ERROR, + CPX_STAT_OPTIMAL => MOI.OPTIMAL, + CPX_STAT_OPTIMAL_FACE_UNBOUNDED => MOI.DUAL_INFEASIBLE, + CPX_STAT_OPTIMAL_INFEAS => MOI.ALMOST_INFEASIBLE, + CPX_STAT_OPTIMAL_RELAXED_INF => MOI.LOCALLY_SOLVED, + CPX_STAT_OPTIMAL_RELAXED_QUAD => MOI.LOCALLY_SOLVED, + CPX_STAT_OPTIMAL_RELAXED_SUM => MOI.LOCALLY_SOLVED, + CPX_STAT_UNBOUNDED => MOI.DUAL_INFEASIBLE, + + CPXMIP_ABORT_FEAS => MOI.LOCALLY_SOLVED, + CPXMIP_ABORT_INFEAS => MOI.OTHER_ERROR, + CPXMIP_ABORT_RELAXATION_UNBOUNDED => MOI.INFEASIBLE_OR_UNBOUNDED, + CPXMIP_ABORT_RELAXED => MOI.LOCALLY_SOLVED, + CPXMIP_DETTIME_LIM_FEAS => MOI.TIME_LIMIT, + CPXMIP_DETTIME_LIM_INFEAS => MOI.TIME_LIMIT, + CPXMIP_FAIL_FEAS => MOI.LOCALLY_SOLVED, + CPXMIP_FAIL_FEAS_NO_TREE => MOI.LOCALLY_SOLVED, + CPXMIP_FAIL_INFEAS => MOI.OTHER_ERROR, + CPXMIP_FAIL_INFEAS_NO_TREE => MOI.MEMORY_LIMIT, + CPXMIP_FEASIBLE => MOI.LOCALLY_SOLVED, + CPXMIP_FEASIBLE_RELAXED_INF => MOI.LOCALLY_SOLVED, + CPXMIP_FEASIBLE_RELAXED_QUAD => MOI.LOCALLY_SOLVED, + CPXMIP_FEASIBLE_RELAXED_SUM => MOI.LOCALLY_SOLVED, + CPXMIP_INFEASIBLE => MOI.INFEASIBLE, + CPXMIP_INForUNBD => MOI.INFEASIBLE_OR_UNBOUNDED, + CPXMIP_MEM_LIM_FEAS => MOI.MEMORY_LIMIT, + CPXMIP_MEM_LIM_INFEAS => MOI.MEMORY_LIMIT, + CPXMIP_NODE_LIM_FEAS => MOI.NODE_LIMIT, + CPXMIP_NODE_LIM_INFEAS => MOI.NODE_LIMIT, + CPXMIP_OPTIMAL => MOI.OPTIMAL, + CPXMIP_OPTIMAL_INFEAS => MOI.INFEASIBLE, + CPXMIP_OPTIMAL_POPULATED => MOI.OPTIMAL, + CPXMIP_OPTIMAL_POPULATED_TOL => MOI.OPTIMAL, + CPXMIP_OPTIMAL_RELAXED_INF => MOI.LOCALLY_SOLVED, + CPXMIP_OPTIMAL_RELAXED_QUAD => MOI.LOCALLY_SOLVED, + CPXMIP_OPTIMAL_RELAXED_SUM => MOI.LOCALLY_SOLVED, + CPXMIP_OPTIMAL_TOL => MOI.OPTIMAL, + CPXMIP_POPULATESOL_LIM => MOI.SOLUTION_LIMIT, + CPXMIP_SOL_LIM => MOI.SOLUTION_LIMIT, + CPXMIP_TIME_LIM_FEAS => MOI.TIME_LIMIT, + CPXMIP_TIME_LIM_INFEAS => MOI.TIME_LIMIT, + CPXMIP_UNBOUNDED => MOI.DUAL_INFEASIBLE, +) function MOI.get(model::Optimizer, attr::MOI.TerminationStatus) _throw_if_optimize_in_progress(model, attr) - if model.cached_solution === nothing + stat = CPXgetstat(model.env, model.lp) + if stat == 0 return MOI.OPTIMIZE_NOT_CALLED end - stat = c_api_getstat(model.inner) - if stat in (1, 101, 102) # CPX_STAT_OPTIMAL, CPXMIP_OPTIMAL, CPXMIP_OPTIMAL_TOL - return MOI.OPTIMAL - elseif stat in (3, 103) # CPX_STAT_INFEASIBLE, CPXMIP_INFEASIBLE - return MOI.INFEASIBLE - elseif stat in (4, 119, 133) # CPX_STAT_INForUNBD, CPXMIP_INForUNBD - return MOI.INFEASIBLE_OR_UNBOUNDED - elseif stat in (2, 118) # CPX_STAT_UNBOUNDED, CPXMIP_UNBOUNDED - return MOI.DUAL_INFEASIBLE - elseif stat in (23) # CPX_STAT_NUM_BEST, CPX_STAT_FEASIBLE - return MOI.LOCALLY_SOLVED - elseif stat in (15, 17, 19, 24, 130) # CPX_STAT_OPTIMAL_RELAXED_SUM, CPX_STAT_OPTIMAL_RELAXED_INF, CPX_STAT_OPTIMAL_RELAXED_QUAD, CPX_STAT_FIRSTORDER - return MOI.ALMOST_OPTIMAL - elseif stat in (12, 21, 22) # CPX_STAT_*ABORT*_OBJ_LIM - return MOI.OBJECTIVE_LIMIT - elseif stat in (10) # CPX_STAT_*ABORT_IT_LIM - return MOI.ITERATION_LIMIT - elseif stat in (53, 105, 106) # CPX_STAT_CONFLICT_ABORT_NODE_LIM, # CPXMIP_NODE_LIM* - return MOI.NODE_LIMIT - elseif stat in (11, 25, 107, 108, 131, 132) # CPX_STAT_*ABORT*TIME_LIM - return MOI.TIME_LIMIT - elseif stat in (111, 112, 116, 117) - return MOI.MEMORY_LIMIT - elseif stat in (104, 128) - return MOI.SOLUTION_LIMIT - elseif stat in (13, 113, 114) # CPX_STAT_ABORT_USER - return MOI.INTERRUPTED - elseif stat in (5, 6, 20, 109, 110, 115) # CPX_STAT_OPTIMAL_INFEAS, CPX_STAT_OPTIMAL_FACE_UNBOUNDED - return MOI.NUMERICAL_ERROR - elseif stat in (14, 16, 18) - return MOI.OTHER_ERROR # TODO: REPLACE WITH FEASIBLE TO RELAXED TOLERANCE ERROR CODE - elseif stat in (110) - return MOI.OTHER_ERROR # TODO: CPXMIP_FAIL_INFEAS - elseif 30 <= stat <= 39 - !model.silent && @warn("Results from conflict analysis should be accessed via ConflictStatus() not TerminationStatus().") - return MOI.OTHER_ERROR - elseif stat in (40, 41) - !model.silent && @warn("Benders Decomposition not currently wrapped in CPLEX MOI. Query CPLEX directly to assess results.") - return MOI.OTHER_ERROR - elseif stat in (120, 121, 122, 123, 124, 125, 126, 127) - !model.silent && @warn("FeasOpt not currently wrapped in CPLEX MOI. Query CPLEX directly to assess results.") - return MOI.OTHER_ERROR - elseif stat == 0 + term_stat = get(_TERMINATION_STATUSES, stat, nothing) + if term_stat === nothing + @warn(""" + Termination status $(stat) is not wrapped by CPLEX.jl. CPLEX explains + this status as follows: + + $(MOI.get(model, MOI.RawStatusString())) + + Please open an issue at https://github.com/JuliaOpt/CPLEX.jl/issues and + provide the complete text of this error message. + """) return MOI.OTHER_ERROR - else - error("getstat() returned at value of $stat which MOI cannot intepret. Please open - an issue here to add support for this error code - https://github.com/JuliaOpt/CPLEX.jl/issues.") end + return term_stat end function MOI.get(model::Optimizer, attr::MOI.PrimalStatus) @@ -1996,18 +2588,15 @@ function MOI.get(model::Optimizer, attr::MOI.PrimalStatus) if attr.N != 1 return MOI.NO_SOLUTION end - _, _, primal_stat, _ = c_api_solninfo(model.inner) - if primal_stat == 1 - return MOI.FEASIBLE_POINT + solnmethod_p, solntype_p, pfeas_p = Ref{Cint}(), Ref{Cint}(), Ref{Cint}() + ret = CPXsolninfo(model.env, model.lp, C_NULL, solntype_p, pfeas_p, C_NULL) + _check_ret(model, ret) + stat = CPXgetstat(model.env, model.lp) + if stat == CPX_STAT_UNBOUNDED + return MOI.INFEASIBILITY_CERTIFICATE end - term_stat = MOI.get(model, MOI.TerminationStatus()) - if term_stat == MOI.DUAL_INFEASIBLE - try - # TODO: improve this check. - get_unbounded_ray(model.inner) - return MOI.INFEASIBILITY_CERTIFICATE - catch - end + if pfeas_p[] > 0 && solntype_p[] != CPX_NO_SOLN + return MOI.FEASIBLE_POINT end return MOI.NO_SOLUTION end @@ -2016,26 +2605,40 @@ function MOI.get(model::Optimizer, attr::MOI.DualStatus) _throw_if_optimize_in_progress(model, attr) if attr.N != 1 return MOI.NO_SOLUTION - elseif model.inner.has_int - return MOI.NO_SOLUTION end - _, _, primal_stat, dual_stat = c_api_solninfo(model.inner) - if primal_stat == dual_stat == 1 + solnmethod_p, solntype_p, dfeas_p = Ref{Cint}(), Ref{Cint}(), Ref{Cint}() + ret = CPXsolninfo( + model.env, model.lp, solnmethod_p, solntype_p, C_NULL, dfeas_p + ) + _check_ret(model, ret) + stat = CPXgetstat(model.env, model.lp) + if stat == CPX_STAT_INFEASIBLE && solnmethod_p[] == CPX_ALG_DUAL + # Dual farkas only available when model is infeasible and CPXdualopt + # used as the solution method. + return MOI.INFEASIBILITY_CERTIFICATE + end + if dfeas_p[] == 0 + return MOI.NO_SOLUTION + elseif solntype_p[] == CPX_PRIMAL_SOLN || solntype_p[] == CPX_NO_SOLN + return MOI.NO_SOLUTION + else return MOI.FEASIBLE_POINT - elseif primal_stat == 0 && dual_stat == 1 - if MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE - return MOI.INFEASIBILITY_CERTIFICATE - end - return MOI.UNKNOWN_RESULT_STATUS end - return MOI.NO_SOLUTION end -function MOI.get(model::Optimizer, attr::MOI.VariablePrimal, x::MOI.VariableIndex) +function MOI.get( + model::Optimizer, attr::MOI.VariablePrimal, x::MOI.VariableIndex +) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - column = _info(model, x).column - return model.cached_solution.variable_primal[column] + col = Cint(column(model, x) - 1) + if model.has_primal_certificate + return model.certificate[col + 1] + end + x = Ref{Cdouble}() + ret = CPXgetx(model.env, model.lp, x, col, col) + _check_ret(model, ret) + return x[] end function MOI.get( @@ -2048,23 +2651,31 @@ function MOI.get( end function MOI.get( - model::Optimizer, attr::MOI.ConstraintPrimal, - c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any} + model::Optimizer, + attr::MOI.ConstraintPrimal, + c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - row = _info(model, c).row - return model.cached_solution.linear_primal[row] + row = Cint(_info(model, c).row - 1) + ax = Ref{Cdouble}() + ret = CPXgetax(model.env, model.lp, ax, row, row) + _check_ret(model, ret) + return ax[] end function MOI.get( - model::Optimizer, attr::MOI.ConstraintPrimal, - c::MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, <:Any} + model::Optimizer, + attr::MOI.ConstraintPrimal, + c::MOI.ConstraintIndex{MOI.ScalarQuadraticFunction{Float64}, <:Any}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - row = _info(model, c).row - return model.cached_solution.quadratic_primal[row] + row = Cint(_info(model, c).row - 1) + xqxax = Ref{Cdouble}() + ret = CPXgetxqxax(model.env, model.lp, xqxax, row, row) + _check_ret(model, ret) + return xqxax[] end function _dual_multiplier(model::Optimizer) @@ -2072,26 +2683,29 @@ function _dual_multiplier(model::Optimizer) end function MOI.get( - model::Optimizer, attr::MOI.ConstraintDual, - c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}} + model::Optimizer, + attr::MOI.ConstraintDual, + c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.LessThan{Float64}}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - column = _info(model, c).column - reduced_cost = model.cached_solution.variable_dual[column] + col = Cint(column(model, c) - 1) + p = Ref{Cdouble}() + ret = CPXgetdj(model.env, model.lp, p, col, col) + _check_ret(model, ret) sense = MOI.get(model, MOI.ObjectiveSense()) # The following is a heuristic for determining whether the reduced cost # applies to the lower or upper bound. It can be wrong by at most # `FeasibilityTol`. - if sense == MOI.MIN_SENSE && reduced_cost < 0 + if sense == MOI.MIN_SENSE && p[] < 0 # If minimizing, the reduced cost must be negative (ignoring # tolerances). - return reduced_cost - elseif sense == MOI.MAX_SENSE && reduced_cost > 0 + return p[] + elseif sense == MOI.MAX_SENSE && p[] > 0 # If minimizing, the reduced cost must be positive (ignoring # tolerances). However, because of the MOI dual convention, we return a # negative value. - return -reduced_cost + return -p[] else # The reduced cost, if non-zero, must related to the lower bound. return 0.0 @@ -2099,26 +2713,29 @@ function MOI.get( end function MOI.get( - model::Optimizer, attr::MOI.ConstraintDual, - c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.GreaterThan{Float64}} + model::Optimizer, + attr::MOI.ConstraintDual, + c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.GreaterThan{Float64}}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - column = _info(model, c).column - reduced_cost = model.cached_solution.variable_dual[column] + col = Cint(column(model, c) - 1) + p = Ref{Cdouble}() + ret = CPXgetdj(model.env, model.lp, p, col, col) + _check_ret(model, ret) sense = MOI.get(model, MOI.ObjectiveSense()) # The following is a heuristic for determining whether the reduced cost # applies to the lower or upper bound. It can be wrong by at most # `FeasibilityTol`. - if sense == MOI.MIN_SENSE && reduced_cost > 0 + if sense == MOI.MIN_SENSE && p[] > 0 # If minimizing, the reduced cost must be negative (ignoring # tolerances). - return reduced_cost - elseif sense == MOI.MAX_SENSE && reduced_cost < 0 + return p[] + elseif sense == MOI.MAX_SENSE && p[] < 0 # If minimizing, the reduced cost must be positive (ignoring # tolerances). However, because of the MOI dual convention, we return a # negative value. - return -reduced_cost + return -p[] else # The reduced cost, if non-zero, must related to the lower bound. return 0.0 @@ -2126,35 +2743,48 @@ function MOI.get( end function MOI.get( - model::Optimizer, attr::MOI.ConstraintDual, - c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.EqualTo{Float64}} + model::Optimizer, + attr::MOI.ConstraintDual, + c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.EqualTo{Float64}}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - column = _info(model, c).column - reduced_cost = model.cached_solution.variable_dual[column] - return _dual_multiplier(model) * reduced_cost + col = Cint(column(model, c) - 1) + p = Ref{Cdouble}() + ret = CPXgetdj(model.env, model.lp, p, col, col) + _check_ret(model, ret) + return _dual_multiplier(model) * p[] end function MOI.get( - model::Optimizer, attr::MOI.ConstraintDual, - c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.Interval{Float64}} + model::Optimizer, + attr::MOI.ConstraintDual, + c::MOI.ConstraintIndex{MOI.SingleVariable, MOI.Interval{Float64}}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - column = _info(model, c).column - reduced_cost = model.cached_solution.variable_dual[column] - return _dual_multiplier(model) * reduced_cost + col = Cint(column(model, c) - 1) + p = Ref{Cdouble}() + ret = CPXgetdj(model.env, model.lp, p, col, col) + _check_ret(model, ret) + return _dual_multiplier(model) * p[] end function MOI.get( - model::Optimizer, attr::MOI.ConstraintDual, - c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any} + model::Optimizer, + attr::MOI.ConstraintDual, + c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any}, ) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - row = _info(model, c).row - return _dual_multiplier(model) * model.cached_solution.linear_dual[row] + row = Cint(_info(model, c).row - 1) + if model.has_dual_certificate + return model.certificate[row + 1] + end + p = Ref{Cdouble}() + ret = CPXgetpi(model.env, model.lp, p, row, row) + _check_ret(model, ret) + return _dual_multiplier(model) * p[] end # function MOI.get( @@ -2170,64 +2800,76 @@ end function MOI.get(model::Optimizer, attr::MOI.ObjectiveValue) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - return CPLEX.c_api_getobjval(model.inner) + p = Ref{Cdouble}() + ret = CPXgetobjval(model.env, model.lp, p) + _check_ret(model, ret) + return p[] end function MOI.get(model::Optimizer, attr::MOI.ObjectiveBound) _throw_if_optimize_in_progress(model, attr) - if model.inner.has_int - return CPLEX.get_best_bound(model.inner) - else - return CPLEX.c_api_getobjval(model.inner) + p = Ref{Cdouble}() + ret = CPXgetbestobjval(model.env, model.lp, p) + if ret == CPXERR_NOT_MIP + ret = CPXgetobjval(model.env, model.lp, p) end + _check_ret(model, ret) + return p[] end function MOI.get(model::Optimizer, attr::MOI.SolveTime) _throw_if_optimize_in_progress(model, attr) - return model.cached_solution.solve_time + return model.solve_time end function MOI.get(model::Optimizer, attr::MOI.SimplexIterations) _throw_if_optimize_in_progress(model, attr) - return CPLEX.c_api_getitcnt(model.inner) + return CPXgetitcnt(model.env, model.lp) end function MOI.get(model::Optimizer, attr::MOI.BarrierIterations) _throw_if_optimize_in_progress(model, attr) - return CPLEX.c_api_getbaritcnt(model.inner) + return CPXgetbaritcnt(model.env, model.lp) end function MOI.get(model::Optimizer, attr::MOI.NodeCount) _throw_if_optimize_in_progress(model, attr) - return CPLEX.get_node_count(model.inner) + return CPXgetnodecnt(model.env, model.lp) end function MOI.get(model::Optimizer, attr::MOI.RelativeGap) _throw_if_optimize_in_progress(model, attr) - return CPLEX.get_rel_gap(model.inner) + p = Ref{Cdouble}() + ret = CPXgetmiprelgap(model.env, model.lp, p) + _check_ret(model, ret) + return p[] end function MOI.get(model::Optimizer, attr::MOI.DualObjectiveValue) _throw_if_optimize_in_progress(model, attr) MOI.check_result_index_bounds(model, attr) - if model.inner.has_int - return CPLEX.get_best_bound(model.inner) - else - return CPLEX.c_api_getobjval(model.inner) + p = Ref{Cdouble}() + ret = CPXgetbestobjval(model.env, model.lp, p) + if ret == CPXERR_NOT_MIP + ret = CPXgetobjval(model.env, model.lp, p) end + _check_ret(model, ret) + return p[] end function MOI.get(model::Optimizer, attr::MOI.ResultCount) _throw_if_optimize_in_progress(model, attr) - if model.cached_solution === nothing - return 0 - elseif model.cached_solution.has_dual_certificate + if model.has_dual_certificate return 1 - elseif model.cached_solution.has_primal_certificate + elseif model.has_primal_certificate return 1 else - _, _, primal_stat, _ = c_api_solninfo(model.inner) - return primal_stat == 1 ? 1 : 0 + pfeasind_p = Ref{Cint}() + ret = CPXsolninfo( + model.env, model.lp, C_NULL, C_NULL, pfeasind_p, C_NULL + ) + _check_ret(model, ret) + return pfeasind_p[] == 1 ? 1 : 0 end end @@ -2250,11 +2892,22 @@ function MOI.set(model::Optimizer, ::MOI.NumberOfThreads, x::Int) end function MOI.get(model::Optimizer, ::MOI.Name) - return model.name + surplus_p = Ref{Cint}() + CPXgetprobname(model.env, model.lp, C_NULL, 0, surplus_p) + buf_str = Vector{Cchar}(undef, -surplus_p[]) + buf_str_p = pointer(buf_str) + GC.@preserve buf_str begin + ret = CPXgetprobname( + model.env, model.lp, buf_str_p, -surplus_p[], surplus_p + ) + _check_ret(model, ret) + return unsafe_string(buf_str_p) + end end function MOI.set(model::Optimizer, ::MOI.Name, name::String) - model.name = name + ret = CPXchgprobname(model.env, model.lp, name) + _check_ret(model, ret) return end @@ -2263,7 +2916,7 @@ function MOI.get(model::Optimizer, ::MOI.ListOfVariableIndices) return sort!(collect(keys(model.variable_info)), by = x -> x.value) end -MOI.get(model::Optimizer, ::MOI.RawSolver) = model.inner +MOI.get(model::Optimizer, ::MOI.RawSolver) = model.lp function MOI.set( model::Optimizer, @@ -2292,16 +2945,16 @@ function MOI.get(model::Optimizer, ::MOI.NumberOfConstraints{F, S}) where {F, S} return length(MOI.get(model, MOI.ListOfConstraintIndices{F, S}())) end -_bound_enums(::Type{<:MOI.LessThan}) = (LESS_THAN, LESS_AND_GREATER_THAN) -_bound_enums(::Type{<:MOI.GreaterThan}) = (GREATER_THAN, LESS_AND_GREATER_THAN) -_bound_enums(::Type{<:MOI.Interval}) = (INTERVAL,) -_bound_enums(::Type{<:MOI.EqualTo}) = (EQUAL_TO,) +_bound_enums(::Type{<:MOI.LessThan}) = (_LESS_THAN, _LESS_AND_GREATER_THAN) +_bound_enums(::Type{<:MOI.GreaterThan}) = (_GREATER_THAN, _LESS_AND_GREATER_THAN) +_bound_enums(::Type{<:MOI.Interval}) = (_INTERVAL,) +_bound_enums(::Type{<:MOI.EqualTo}) = (_EQUAL_TO,) _bound_enums(::Any) = (nothing,) -_type_enums(::Type{MOI.ZeroOne}) = (BINARY,) -_type_enums(::Type{MOI.Integer}) = (INTEGER,) -_type_enums(::Type{<:MOI.Semicontinuous}) = (SEMICONTINUOUS,) -_type_enums(::Type{<:MOI.Semiinteger}) = (SEMIINTEGER,) +_type_enums(::Type{MOI.ZeroOne}) = (CPX_BINARY,) +_type_enums(::Type{MOI.Integer}) = (CPX_INTEGER,) +_type_enums(::Type{<:MOI.Semicontinuous}) = (CPX_SEMICONT,) +_type_enums(::Type{<:MOI.Semiinteger}) = (CPX_SEMIINT,) _type_enums(::Any) = (nothing,) function MOI.get( @@ -2369,27 +3022,27 @@ end function MOI.get(model::Optimizer, ::MOI.ListOfConstraints) constraints = Set{Tuple{DataType, DataType}}() for info in values(model.variable_info) - if info.bound == NONE - elseif info.bound == LESS_THAN + if info.bound == _NONE + elseif info.bound == _LESS_THAN push!(constraints, (MOI.SingleVariable, MOI.LessThan{Float64})) - elseif info.bound == GREATER_THAN + elseif info.bound == _GREATER_THAN push!(constraints, (MOI.SingleVariable, MOI.GreaterThan{Float64})) - elseif info.bound == LESS_AND_GREATER_THAN + elseif info.bound == _LESS_AND_GREATER_THAN push!(constraints, (MOI.SingleVariable, MOI.LessThan{Float64})) push!(constraints, (MOI.SingleVariable, MOI.GreaterThan{Float64})) - elseif info.bound == EQUAL_TO + elseif info.bound == _EQUAL_TO push!(constraints, (MOI.SingleVariable, MOI.EqualTo{Float64})) - elseif info.bound == INTERVAL + elseif info.bound == _INTERVAL push!(constraints, (MOI.SingleVariable, MOI.Interval{Float64})) end - if info.type == CONTINUOUS - elseif info.type == BINARY + if info.type == CPX_CONTINUOUS + elseif info.type == CPX_BINARY push!(constraints, (MOI.SingleVariable, MOI.ZeroOne)) - elseif info.type == INTEGER + elseif info.type == CPX_INTEGER push!(constraints, (MOI.SingleVariable, MOI.Integer)) - elseif info.type == SEMICONTINUOUS + elseif info.type == CPX_SEMICONT push!(constraints, (MOI.SingleVariable, MOI.Semicontinuous{Float64})) - elseif info.type == SEMIINTEGER + elseif info.type == CPX_SEMIINT push!(constraints, (MOI.SingleVariable, MOI.Semiinteger{Float64})) end end @@ -2412,12 +3065,12 @@ end function MOI.get(model::Optimizer, ::MOI.ObjectiveFunctionType) if model.is_feasibility return nothing - elseif model.objective_type == SINGLE_VARIABLE + elseif model.objective_type == _SINGLE_VARIABLE return MOI.SingleVariable - elseif model.objective_type == SCALAR_AFFINE + elseif model.objective_type == _SCALAR_AFFINE return MOI.ScalarAffineFunction{Float64} else - @assert model.objective_type == SCALAR_QUADRATIC + @assert model.objective_type == _SCALAR_QUADRATIC return MOI.ScalarQuadraticFunction{Float64} end end @@ -2427,12 +3080,14 @@ function MOI.modify( c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any}, chg::MOI.ScalarCoefficientChange{Float64} ) - CPLEX.c_api_chgcoef( - model.inner, - Cint(_info(model, c).row), - Cint(_info(model, chg.variable).column,), - chg.new_coefficient + ret = CPXchgcoef( + model.env, + model.lp, + Cint(_info(model, c).row - 1), + Cint(column(model, chg.variable) - 1), + chg.new_coefficient, ) + _check_ret(model, ret) return end @@ -2441,8 +3096,11 @@ function MOI.modify( c::MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}, chg::MOI.ScalarCoefficientChange{Float64} ) - column = _info(model, chg.variable).column - CPLEX.c_api_chgobj(model.inner, Cint[column], [chg.new_coefficient]) + col = Cint(column(model, chg.variable) - 1) + ret = CPXchgobj( + model.env, model.lp, 1, Ref(col), Ref(chg.new_coefficient) + ) + _check_ret(model, ret) return end @@ -2468,10 +3126,11 @@ function _replace_with_matching_sparsity!( replacement::MOI.ScalarAffineFunction, row::Int ) for term in replacement.terms - col = Cint(_info(model, term.variable_index).column) - CPLEX.c_api_chgcoef( - model.inner, Cint(row), Cint(col), MOI.coefficient(term) + col = Cint(column(model, term.variable_index) - 1) + ret = CPXchgcoef( + model.env, model.lp, Cint(row - 1), col, MOI.coefficient(term) ) + _check_ret(model, ret) end return end @@ -2497,20 +3156,25 @@ sparsity patterns match, the zeroing-out step can be skipped. function _replace_with_different_sparsity!( model::Optimizer, previous::MOI.ScalarAffineFunction, - replacement::MOI.ScalarAffineFunction, row::Int + replacement::MOI.ScalarAffineFunction, + row::Int, ) # First, zero out the old constraint function terms. for term in previous.terms - col = Cint(_info(model, term.variable_index).column) - CPLEX.c_api_chgcoef(model.inner, Cint(row), Cint(col), 0.0) + col = Cint(column(model, term.variable_index) - 1) + ret = CPXchgcoef( + model.env, model.lp, Cint(row - 1), col, 0.0 + ) + _check_ret(model, ret) end # Next, set the new constraint function terms. for term in previous.terms - col = Cint(_info(model, term.variable_index).column) - CPLEX.c_api_chgcoef( - model.inner, Cint(row), Cint(col), MOI.coefficient(term) + col = Cint(column(model, term.variable_index) - 1) + ret = CPXchgcoef( + model.env, model.lp, Cint(row - 1), col, MOI.coefficient(term) ) + _check_ret(model, ret) end return end @@ -2543,7 +3207,7 @@ end function MOI.set( model::Optimizer, ::MOI.ConstraintFunction, - c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:SCALAR_SETS}, + c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:_SCALAR_SETS}, f::MOI.ScalarAffineFunction{Float64} ) previous = MOI.get(model, MOI.ConstraintFunction(), c) @@ -2560,20 +3224,22 @@ function MOI.set( else _replace_with_different_sparsity!(model, previous, replacement, row) end - rhs = zeros(1) - CPLEX.c_api_getrhs(model.inner, rhs, Cint(row), Cint(row)) - rhs[1] -= replacement.constant - previous.constant - CPLEX.c_api_chgrhs(model.inner, [Cint(row)], rhs) + rhs = Ref{Cdouble}() + ret = CPXgetrhs(model.env, model.lp, rhs, Cint(row - 1), Cint(row - 1)) + _check_ret(model, ret) + rhs[] -= replacement.constant - previous.constant + ret = CPXchgrhs(model.env, model.lp, 1, Ref{Cint}(row - 1), rhs) + _check_ret(model, ret) return end # function MOI.get( # model::Optimizer, ::MOI.ConstraintBasisStatus, # c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S} -# ) where {S <: SCALAR_SETS} +# ) where {S <: _SCALAR_SETS} # row = _info(model, c).row # # TODO -# cbasis = 0 # get_intattrelement(model.inner, "CBasis", row) +# cbasis = 0 # get_intattrelement(model.lp, "CBasis", row) # if cbasis == 0 # return MOI.BASIC # elseif cbasis == -1 @@ -2586,10 +3252,10 @@ end # function MOI.get( # model::Optimizer, ::MOI.ConstraintBasisStatus, # c::MOI.ConstraintIndex{MOI.SingleVariable, S} -# ) where {S <: SCALAR_SETS} +# ) where {S <: _SCALAR_SETS} # column = _info(model, c).column # _update_if_necessary(model) -# vbasis = get_intattrelement(model.inner, "VBasis", column) +# vbasis = get_intattrelement(model.lp, "VBasis", column) # if vbasis == 0 # return MOI.BASIC # elseif vbasis == -1 @@ -2646,19 +3312,41 @@ function MOI.add_constraint( lb = _get_variable_lower_bound(model, t_info) if isnan(t_info.lower_bound_if_soc) && lb < 0.0 t_info.lower_bound_if_soc = lb - CPLEX.c_api_chgbds(model.inner, Cint[t_info.column], Cchar['L'], [0.0]) + ret = CPXchgbds( + model.env, + model.lp, + 1, + Ref{Cint}(t_info.column - 1), + Ref{Cchar}('L'), + Ref(0.0), + ) + _check_ret(model, ret) end t_info.num_soc_constraints += 1 # Now add the quadratic constraint. - I = Cint[_info(model, v).column for v in f.variables] - V = fill(Cdouble(-1.0), length(f.variables)) + I = Cint[column(model, v) - 1 for v in f.variables] + V = fill(-1.0, length(f.variables)) V[1] = 1.0 - CPLEX.add_qconstr!(model.inner, Cint[], Cdouble[], I, I, V, Cchar('G'), 0.0) + ret = CPXaddqconstr( + model.env, + model.lp, + 0, + length(V), + 0.0, + Cchar('G'), + C_NULL, + C_NULL, + I, + I, + V, + C_NULL, + ) + _check_ret(model, ret) model.last_constraint_index += 1 model.quadratic_constraint_info[model.last_constraint_index] = - ConstraintInfo(length(model.quadratic_constraint_info) + 1, s) + _ConstraintInfo(length(model.quadratic_constraint_info) + 1, s) return MOI.ConstraintIndex{MOI.VectorOfVariables, MOI.SecondOrderCone}(model.last_constraint_index) end @@ -2676,7 +3364,10 @@ function MOI.delete( ) f = MOI.get(model, MOI.ConstraintFunction(), c) info = _info(model, c) - CPLEX.c_api_delqconstrs(model.inner, Cint(info.row - 1), Cint(info.row - 1)) + ret = CPXdelqconstrs( + model.env, model.lp, Cint(info.row - 1), Cint(info.row - 1) + ) + _check_ret(model, ret) for (key, info_2) in model.quadratic_constraint_info if info_2.row > info.row info_2.row -= 1 @@ -2704,17 +3395,19 @@ function MOI.delete( end function MOI.get( - model::Optimizer, ::MOI.ConstraintSet, + model::Optimizer, + ::MOI.ConstraintSet, c::MOI.ConstraintIndex{MOI.VectorOfVariables, MOI.SecondOrderCone} ) return _info(model, c).set end function MOI.get( - model::Optimizer, ::MOI.ConstraintFunction, - c::MOI.ConstraintIndex{MOI.VectorOfVariables, MOI.SecondOrderCone} + model::Optimizer, + ::MOI.ConstraintFunction, + c::MOI.ConstraintIndex{MOI.VectorOfVariables, MOI.SecondOrderCone}, ) - a, b, I, J, V = CPLEX.c_api_getqconstr(model.inner, _info(model, c).row) + a, b, I, J, V = _CPXgetqconstr(model, c) @assert length(a) == length(b) == 0 # Check for no linear terms. t = nothing x = MOI.VariableIndex[] @@ -2771,167 +3464,3 @@ function MOI.set( return end -@deprecate compute_conflict MOI.compute_conflict! - -function MOI.compute_conflict!(model::Optimizer) - # In case there is no conflict, c_api_getconflict throws an error, while the - # conflict data structure can handle more gracefully this case (via a status - # check). - try - model.conflict = c_api_getconflict(model.inner) - catch exc - if isa(exc, CplexError) && exc.code == CPXERR_NO_CONFLICT - model.conflict = ConflictRefinerData( - CPX_STAT_CONFLICT_FEASIBLE, 0, Cint[], Cint[], 0, Cint[], Cint[] - ) - else - rethrow(exc) - end - end - return -end - -function _ensure_conflict_computed(model::Optimizer) - if model.conflict === nothing - error( - "Cannot access conflict status. Call " * - "`CPLEX.compute_conflict(model)` first. In case the model is " * - "modified, the computed conflict will not be purged." - ) - end -end - -""" - ConflictStatus() - -Return the raw status from CPLEX indicating the status of the last -computed conflict. It returns an integer value defined in -[CPLEX' documentation](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/refcallablelibrary/macros/homepagesolutionstatus.html) -(with a name like `CPX_STAT_CONFLICT_*`) or `nothing` if the -function `compute_conflict!` has not yet been called. -""" -struct ConflictStatus <: MOI.AbstractModelAttribute end - -MOI.supports(::Optimizer, ::ConflictStatus) = true - -function MOI.get(model::Optimizer, ::ConflictStatus) - if model.conflict === nothing - return nothing - else - return model.conflict.stat - end -end - -MOI.supports(::Optimizer, ::MOI.ConflictStatus) = true - -function MOI.get(model::Optimizer, ::MOI.ConflictStatus) - status = MOI.get(model, ConflictStatus()) - if status === nothing - return MOI.COMPUTE_CONFLICT_NOT_CALLED - elseif status == CPX_STAT_CONFLICT_MINIMAL - return MOI.CONFLICT_FOUND - elseif status == CPX_STAT_CONFLICT_FEASIBLE - return MOI.NO_CONFLICT_EXISTS - else - return MOI.NO_CONFLICT_FOUND - end -end - -function _get_conflict_status( - model::Optimizer, - index::MOI.ConstraintIndex{MOI.SingleVariable, <:Any} -) - _ensure_conflict_computed(model) - column = _info(model, index).column - for (col, stat) in zip(model.conflict.colind, model.conflict.colstat) - if column - 1 == col - return stat - end - end - return nothing -end - -function MOI.get( - model::Optimizer, - ::MOI.ConstraintConflictStatus, - index::MOI.ConstraintIndex{MOI.SingleVariable, <:MOI.LessThan} -) - status = _get_conflict_status(model, index) - if status in [CPLEX.CPX_CONFLICT_MEMBER, CPLEX.CPX_CONFLICT_UB] - return MOI.IN_CONFLICT - elseif status in [CPLEX.CPX_CONFLICT_POSSIBLE_MEMBER, CPLEX.CPX_CONFLICT_POSSIBLE_UB] - return MOI.MAYBE_IN_CONFLICT - else - return MOI.NOT_IN_CONFLICT - end -end - -function MOI.get( - model::Optimizer, - ::MOI.ConstraintConflictStatus, - index::MOI.ConstraintIndex{MOI.SingleVariable, <:MOI.GreaterThan}) - status = _get_conflict_status(model, index) - if status in [CPLEX.CPX_CONFLICT_MEMBER, CPLEX.CPX_CONFLICT_LB] - return MOI.IN_CONFLICT - elseif status in [CPLEX.CPX_CONFLICT_POSSIBLE_MEMBER, CPLEX.CPX_CONFLICT_POSSIBLE_LB] - return MOI.MAYBE_IN_CONFLICT - else - return MOI.NOT_IN_CONFLICT - end -end - -function MOI.get( - model::Optimizer, - ::MOI.ConstraintConflictStatus, - index::MOI.ConstraintIndex{MOI.SingleVariable, <:Union{MOI.EqualTo, MOI.Interval}} -) - status = _get_conflict_status(model, index) - if status in [CPLEX.CPX_CONFLICT_MEMBER, CPLEX.CPX_CONFLICT_LB, CPLEX.CPX_CONFLICT_UB] - return MOI.IN_CONFLICT - elseif status in [CPLEX.CPX_CONFLICT_POSSIBLE_MEMBER, CPLEX.CPX_CONFLICT_POSSIBLE_LB, CPLEX.CPX_CONFLICT_POSSIBLE_UB] - return MOI.MAYBE_IN_CONFLICT - else - return MOI.NOT_IN_CONFLICT - end -end - -function MOI.get( - model::Optimizer, - ::MOI.ConstraintConflictStatus, - index::MOI.ConstraintIndex{ - <:MOI.ScalarAffineFunction, - <:Union{MOI.LessThan, MOI.GreaterThan, MOI.EqualTo} - } -) - _ensure_conflict_computed(model) - rindex = findfirst(x -> x == _info(model, index).row - 1, model.conflict.rowind) - if rindex === nothing - return MOI.NOT_IN_CONFLICT - elseif model.conflict.rowstat[rindex] == CPX_CONFLICT_MEMBER - return MOI.IN_CONFLICT - else - return MOI.MAYBE_IN_CONFLICT - end -end - -function MOI.supports( - ::Optimizer, - ::MOI.ConstraintConflictStatus, - ::Type{MOI.ConstraintIndex{<:MOI.SingleVariable, <:SCALAR_SETS}} -) - return true -end - -function MOI.supports( - ::Optimizer, - ::MOI.ConstraintConflictStatus, - ::Type{MOI.ConstraintIndex{ - <:MOI.ScalarAffineFunction, - <:Union{MOI.LessThan, MOI.GreaterThan, MOI.EqualTo} - }} -) - return true -end - -include("MOI_callbacks.jl") -include("indicator_constraint.jl") diff --git a/src/MOI/conflicts.jl b/src/MOI/conflicts.jl new file mode 100644 index 00000000..302a7f7e --- /dev/null +++ b/src/MOI/conflicts.jl @@ -0,0 +1,195 @@ +mutable struct _ConflictRefinerData + confstat::Cint + rowind::Vector{Cint} + rowbdstat::Vector{Cint} + confnumrows::Cint + colind::Vector{Cint} + colbdstat::Vector{Cint} + confnumcols::Cint +end + +function MOI.compute_conflict!(model::Optimizer) + # This function always calls refineconflict first, which starts the conflict + # refiner. In other words, any call to this function is expensive. + confnumrows_p = Ref{Cint}(0) + confnumcols_p = Ref{Cint}(0) + ret = CPXrefineconflict(model.env, model.lp, confnumrows_p, confnumcols_p) + _check_ret(model, ret) + # Then, retrieve it. + confstat_p = Ref{Cint}() + rowind = Vector{Cint}(undef, confnumrows_p[]) + rowbdstat = Vector{Cint}(undef, confnumrows_p[]) + confnumrows_p = Ref{Cint}() + colind = Vector{Cint}(undef, confnumcols_p[]) + colbdstat = Vector{Cint}(undef, confnumcols_p[]) + confnumcols_p = Ref{Cint}() + ret = CPXgetconflict( + model.env, + model.lp, + confstat_p, + rowind, + rowbdstat, + confnumrows_p, + colind, + colbdstat, + confnumcols_p, + ) + if ret == CPXERR_NO_CONFLICT + model.conflict = _ConflictRefinerData( + CPX_STAT_CONFLICT_FEASIBLE, Cint[], Cint[], 0, Cint[], Cint[], 0 + ) + else + _check_ret(model, ret) + model.conflict = _ConflictRefinerData( + confstat_p[], + rowind, + rowbdstat, + confnumrows_p[], + colind, + colbdstat, + confnumcols_p[], + ) + end + return +end + +function _ensure_conflict_computed(model::Optimizer) + if model.conflict === nothing + error( + "Cannot access conflict status. Call " * + "`MOI.compute_conflict!(model)` first. In case the model is " * + "modified, the computed conflict will not be purged." + ) + end +end + +""" + ConflictStatus() + +Return the raw status from CPLEX indicating the status of the last computed +conflict. + +It returns an integer value defined in +the [CPLEX documentation](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/refcallablelibrary/macros/homepagesolutionstatus.html) +(with a name like `CPX_STAT_CONFLICT_*`) or `nothing` if the function +`MOI.compute_conflict!` has not yet been called. +""" +struct ConflictStatus <: MOI.AbstractModelAttribute end + +MOI.supports(::Optimizer, ::ConflictStatus) = true + +function MOI.get(model::Optimizer, ::ConflictStatus) + return model.conflict === nothing ? nothing : model.conflict.confstat +end + +MOI.supports(::Optimizer, ::MOI.ConflictStatus) = true + +function MOI.get(model::Optimizer, ::MOI.ConflictStatus) + status = MOI.get(model, ConflictStatus()) + if status === nothing + return MOI.COMPUTE_CONFLICT_NOT_CALLED + elseif status == CPX_STAT_CONFLICT_MINIMAL + return MOI.CONFLICT_FOUND + elseif status == CPX_STAT_CONFLICT_FEASIBLE + return MOI.NO_CONFLICT_EXISTS + else + return MOI.NO_CONFLICT_FOUND + end +end + +function _get_conflict_status( + model::Optimizer, index::MOI.ConstraintIndex{MOI.SingleVariable, <:Any} +) + _ensure_conflict_computed(model) + cindex = findfirst( + x -> x == Cint(_info(model, index).column - 1), model.conflict.colind + ) + return cindex === nothing ? nothing : model.conflict.colbdstat[cindex] +end + +function MOI.get( + model::Optimizer, + ::MOI.ConstraintConflictStatus, + index::MOI.ConstraintIndex{MOI.SingleVariable, <:MOI.LessThan}, +) + status = _get_conflict_status(model, index) + if status in (CPX_CONFLICT_MEMBER, CPX_CONFLICT_UB) + return MOI.IN_CONFLICT + elseif status in (CPX_CONFLICT_POSSIBLE_MEMBER, CPX_CONFLICT_POSSIBLE_UB) + return MOI.MAYBE_IN_CONFLICT + else + return MOI.NOT_IN_CONFLICT + end +end + +function MOI.get( + model::Optimizer, + ::MOI.ConstraintConflictStatus, + index::MOI.ConstraintIndex{MOI.SingleVariable, <:MOI.GreaterThan}, +) + status = _get_conflict_status(model, index) + if status in (CPX_CONFLICT_MEMBER, CPX_CONFLICT_LB) + return MOI.IN_CONFLICT + elseif status in (CPX_CONFLICT_POSSIBLE_MEMBER, CPX_CONFLICT_POSSIBLE_LB) + return MOI.MAYBE_IN_CONFLICT + else + return MOI.NOT_IN_CONFLICT + end +end + +function MOI.get( + model::Optimizer, + ::MOI.ConstraintConflictStatus, + index::MOI.ConstraintIndex{ + MOI.SingleVariable, <:Union{MOI.EqualTo, MOI.Interval} + } +) + status = _get_conflict_status(model, index) + if status in (CPX_CONFLICT_MEMBER, CPX_CONFLICT_LB, CPX_CONFLICT_UB) + return MOI.IN_CONFLICT + elseif status in (CPX_CONFLICT_POSSIBLE_MEMBER, CPX_CONFLICT_POSSIBLE_LB, CPX_CONFLICT_POSSIBLE_UB) + return MOI.MAYBE_IN_CONFLICT + else + return MOI.NOT_IN_CONFLICT + end +end + +function MOI.get( + model::Optimizer, + ::MOI.ConstraintConflictStatus, + index::MOI.ConstraintIndex{ + <:MOI.ScalarAffineFunction, + <:Union{MOI.LessThan, MOI.GreaterThan, MOI.EqualTo} + }, +) + _ensure_conflict_computed(model) + rindex = findfirst( + x -> x == Cint(_info(model, index).row - 1), model.conflict.rowind + ) + if rindex === nothing + return MOI.NOT_IN_CONFLICT + elseif model.conflict.rowbdstat[rindex] == CPX_CONFLICT_MEMBER + return MOI.IN_CONFLICT + else + return MOI.MAYBE_IN_CONFLICT + end +end + +function MOI.supports( + ::Optimizer, + ::MOI.ConstraintConflictStatus, + ::Type{MOI.ConstraintIndex{<:MOI.SingleVariable, <:_SCALAR_SETS}}, +) + return true +end + +function MOI.supports( + ::Optimizer, + ::MOI.ConstraintConflictStatus, + ::Type{MOI.ConstraintIndex{ + <:MOI.ScalarAffineFunction, + <:Union{MOI.LessThan, MOI.GreaterThan, MOI.EqualTo} + }}, +) + return true +end diff --git a/src/MOI/indicator_constraint.jl b/src/MOI/indicator_constraint.jl index 7e04157b..fd17deba 100644 --- a/src/MOI/indicator_constraint.jl +++ b/src/MOI/indicator_constraint.jl @@ -57,24 +57,36 @@ function MOI.add_constraint( # getting the indicator variable sense_code = _get_indicator_sense(s.set) active_bool = A == MOI.ACTIVATE_ON_ONE ? Cint(0) : Cint(1) - var_inner = _info(model, first_index_terms[1].variable_index).column + var_inner = Cint(_info(model, first_index_terms[1].variable_index).column - 1) # keeping track of the constraints model.last_constraint_index += 1 - info = ConstraintInfo(length(model.indicator_constraint_info) + 1, s) + info = _ConstraintInfo(length(model.indicator_constraint_info) + 1, s) model.indicator_constraint_info[model.last_constraint_index] = (info, func) linear_idx = Vector{Cint}(undef, length(scalar_index_terms)) linear_coefficients = Vector{Cdouble}(undef, length(scalar_index_terms)) for (i, term) in enumerate(scalar_index_terms) - linear_idx[i] = _info(model, term.variable_index).column + linear_idx[i] = Cint(_info(model, term.variable_index).column - 1) linear_coefficients[i] = term.coefficient end # switching constant on other side # a^T x + b <= c <==> a^T x <= c - b fcons = MOI.constant(func) rhs = Cdouble(MOI.constant(s.set) - fcons[2]) - add_indicator_constraint(model.inner, linear_idx, linear_coefficients, sense_code, rhs, var_inner, active_bool) + CPXaddindconstr( + model.env, + model.lp, + var_inner, + active_bool, + length(linear_idx), + rhs, + sense_code, + linear_idx, + linear_coefficients, + C_NULL, + + ) return MOI.ConstraintIndex{typeof(func), typeof(s)}(model.last_constraint_index) end diff --git a/src/cpx_callbacks.jl b/src/cpx_callbacks.jl deleted file mode 100644 index b633352e..00000000 --- a/src/cpx_callbacks.jl +++ /dev/null @@ -1,116 +0,0 @@ -function get_best_bound(m::Model) - objval_p = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getbestobjval, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cdouble}), m.env.ptr, m.lp, objval_p) - if stat != 0 - throw(CplexError(m.env, stat)) - end - return objval_p[1] -end - -mutable struct CallbackData - cbdata::Ptr{Cvoid} - model::Model -end - -export CallbackData - -function setcallbackcut(cbdata::CallbackData, where::Cint, ind::Vector{Cint}, val::Vector{Cdouble}, sense::Char, rhs::Cdouble, purgeable::Cint) - len = length(ind) - @assert length(val) == len - sns = convert(Cint, sense) - stat = @cpx_ccall(cutcallbackadd, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Cdouble, - Cint, - Ptr{Cint}, - Ptr{Cdouble}, - Cint - ), - cbdata.model.env.ptr, cbdata.cbdata, where, len, rhs, sns, ind .- Cint(1), val, purgeable) - if stat != 0 - throw(CplexError(cbdata.model.env, stat)) - end -end - -function setcallbackcutlocal(cbdata::CallbackData, where::Cint, ind::Vector{Cint}, val::Vector{Cdouble}, sense::Char, rhs::Cdouble, purgeable::Cint) - len = length(ind) - @assert length(val) == len - sns = convert(Cint, sense) - stat = @cpx_ccall(cutcallbackaddlocal, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Cdouble, - Cint, - Ptr{Cint}, - Ptr{Cdouble}, - Cint - ), - cbdata.model.env.ptr, cbdata.cbdata, where, len, rhs, sns, ind .- Cint(1), val, purgeable) - if stat != 0 - throw(CplexError(cbdata.model.env, stat)) - end -end - - - -cbcut(cbdata::CallbackData, where::Cint, ind::Vector{Cint}, val::Vector{Cdouble}, sense::Char, rhs::Cdouble) = - setcallbackcut(cbdata, where, ind, val, sense, rhs, convert(Cint,CPX_USECUT_PURGE)) - -cbcutlocal(cbdata::CallbackData, where::Cint, ind::Vector{Cint}, val::Vector{Cdouble}, sense::Char, rhs::Cdouble) = - setcallbackcutlocal(cbdata, where, ind, val, sense, rhs, convert(Cint,CPX_USECUT_PURGE)) - -cblazy(cbdata::CallbackData, where::Cint, ind::Vector{Cint}, val::Vector{Cdouble}, sense::Char, rhs::Cdouble) = - setcallbackcut(cbdata, where, ind, val, sense, rhs, convert(Cint,CPX_USECUT_FORCE)) - -cblazylocal(cbdata::CallbackData, where::Cint, ind::Vector{Cint}, val::Vector{Cdouble}, sense::Char, rhs::Cdouble) = - setcallbackcutlocal(cbdata, where, ind, val, sense, rhs, convert(Cint,CPX_USECUT_FORCE)) - -function cbbranch(cbdata::CallbackData, where::Cint, idx::Cint, LU::Cchar, bd::Cdouble, nodeest::Cdouble) - seqnum = Vector{Cint}(1) - stat = @cpx_ccall(branchcallbackbranchbds, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Cint,Ptr{Cint},Ptr{Cchar},Ptr{Cdouble},Cdouble,Ptr{Cvoid},Ptr{Cint}), - cbdata.model.env.ptr,cbdata.cbdata,where,convert(Cint,1),[idx],[LU],[bd],nodeest,C_NULL,seqnum) - if stat != 0 - throw(CplexError(cbdata.model.env, stat)) - end - return seqnum[1] -end - -function cbbranchconstr(cbdata::CallbackData, where::Cint, indices::Vector{Cint}, coeffs::Vector{Cdouble}, rhs::Cdouble, sense::Cchar, nodeest::Cdouble) - seqnum = Vector{Cint}(undef, 1) - stat = @cpx_ccall(branchcallbackbranchconstraints, Cint, - (Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Cint, - Ptr{Cdouble}, - Ptr{Cchar}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Cdouble, - Ptr{Cvoid}, - Ptr{Cint}), - cbdata.model.env.ptr, - cbdata.cbdata, - where, - convert(Cint,1), - convert(Cint,length(indices)), - [rhs], - [sense], - Cint[0], - indices, - coeffs, - nodeest, - C_NULL, - seqnum) - if stat != 0 - throw(CplexError(cbdata.model.env, stat)) - end - return seqnum[1] -end diff --git a/src/cpx_common.jl b/src/cpx_common.jl deleted file mode 100644 index 53bef334..00000000 --- a/src/cpx_common.jl +++ /dev/null @@ -1,79 +0,0 @@ -# makes calling C functions a bit easier -macro cpx_ccall(func, args...) - f = "CPX$(func)" - args = map(esc,args) - @static if Sys.isunix() - return quote - ccall(($f,libcplex), $(args...)) - end - end - @static if Sys.iswindows() - return quote - ccall(($f,libcplex), $(esc(:stdcall)), $(args...)) - end - end -end - -macro cpx_ccall_intercept(model, func, args...) - # TODO fix for 0.7 and above (using cpx_call instead temporarily) - if VERSION < v"0.7.0-DEV.3382" - args = map(esc,args) - quote - ccall(:jl_exit_on_sigint, Nothing, (Cint,), convert(Cint,0)) - ret = try - $(Expr(:macrocall, Symbol("@cpx_ccall"), esc(func), args...)) - catch ex - println("Caught exception") - if !isinteractive() - ccall(:jl_exit_on_sigint, Nothing, (Cint,), convert(Cint,1)) - end - if isa(ex, InterruptException) - model.terminator[1] = 1 - end - rethrow(ex) - end - if !isinteractive() - ccall(:jl_exit_on_sigint, Nothing, (Cint,), convert(Cint,1)) - end - ret - end - end -end - -const GChars = Union{Cchar, Char} -const IVec = Vector{Cint} -const FVec = Vector{Cdouble} -const CVec = Vector{Cchar} -const CoeffMat = Union{AbstractMatrix{Cdouble}, SparseMatrixCSC{Cdouble}} -Bounds{T<:Real} = Union{T, Vector{T}} - -const GCharOrVec = Union{Cchar, Char, Vector{Cchar}, Vector{Char}} - -# empty vector & matrix (for the purpose of supplying default arguments) -const emptyfvec = Vector{Float64}(undef, 0) -const emptyfmat = Matrix{Float64}(undef, 0, 0) - -cchar(c::Cchar) = c -cchar(c::Char) = convert(Cchar, c) - -ivec(v::IVec) = v -fvec(v::FVec) = v -cvec(v::CVec) = v - -ivec(v::Vector) = convert(IVec, v) -fvec(v::Vector) = convert(FVec, v) -cvec(v::Vector) = convert(CVec, v) - -# cvecx(v, n) and fvecx(v, n) -# converts v into a vector of Cchar or Float64 of length n, -# where v can be either a scalar or a vector of length n. - -_chklen(v, n::Integer) = (length(v) == n || error("Inconsistent argument dimensions.")) - -cvecx(c::GChars, n::Integer) = fill(cchar(c), n) -cvecx(c::Vector{Cchar}, n::Integer) = (_chklen(c, n); c) -cvecx(c::Vector{Char}, n::Integer) = (_chklen(c, n); convert(Vector{Cchar}, c)) - -fvecx(v::Real, n::Integer) = fill(Float64(v), n) -fvecx(v::Vector{Float64}, n::Integer) = (_chklen(v, n); v) -fvecx(v::Vector{T}, n::Integer) where {T<:Real} = (_chklen(v, n); convert(Vector{Float64}, v)) diff --git a/src/cpx_constrs.jl b/src/cpx_constrs.jl deleted file mode 100644 index 40890434..00000000 --- a/src/cpx_constrs.jl +++ /dev/null @@ -1,537 +0,0 @@ -function c_api_addrows(model::Model, cbegins::IVec, inds::IVec, coeffs::FVec, - rel::CVec, rhs::FVec) - - nnz = length(inds) - ncons = length(rhs) - (nnz == length(coeffs)) || error("Incompatible constraint arg dimensions.") - - if ncons > 0 - stat = @cpx_ccall(addrows, Cint, ( - Ptr{Cvoid}, # environment - Ptr{Cvoid}, # problem - Cint, # num new cols - Cint, # num new rows - Cint, # num non-zeros - Ptr{Cdouble}, # rhs - Ptr{Cchar}, # sense - Ptr{Cint}, # matrix start - Ptr{Cint}, # matrix index - Ptr{Cdouble}, # matrix values - Ptr{Ptr{Cchar}}, # col names - Ptr{Ptr{Cchar}} # row names - ), - model.env.ptr, model.lp, 0, ncons, nnz, rhs, rel, - cbegins .- Cint(1), inds .- Cint(1), coeffs, - C_NULL, C_NULL) - - if stat != 0 - throw(CplexError(model.env, stat)) - end - end -end - -# same as add_rows but does conversion of sense chars -function add_constrs!(model::Model, cbegins::IVec, inds::IVec, coeffs::FVec, - rel::CVec, rhs::FVec) - - for k in 1:length(rel) - if rel[k] == UInt8('>') - rel[k] = convert(Cchar, 'G') - elseif rel[k] == UInt8('<') - rel[k] = convert(Cchar, 'L') - elseif rel[k] == UInt8('=') - rel[k] = convert(Cchar, 'E') - end - end - - c_api_addrows(model, cbegins, inds, coeffs, rel, rhs) -end - -add_constr!(model::Model, coef::Vector, sense::Char, rhs) = add_constrs!(model, [1], collect(1:length(coef)), coef, [sense], [rhs]) - -function add_constrs!(model::Model, cbeg::Vector, inds::Vector, coeffs::Vector, rel::Vector, rhs::Vector) - add_constrs!(model, ivec(cbeg), ivec(inds), fvec(coeffs), cvecx(rel, length(cbeg)), fvec(rhs)) -end - -function add_constrs_t!(model::Model, At::SparseMatrixCSC{Float64}, rel::GCharOrVec, b::Vector) - n, m = size(At) - (m == length(b) && n == num_var(model)) || error("Incompatible argument dimensions.") - add_constrs!(model, At.colptr[1:At.n], At.rowval, At.nzval, rel, b) -end - -function add_constrs_t!(model::Model, At::AbstractArray{Float64, 2}, rel::GCharOrVec, b::Vector) - n, m = size(At) - (m == length(b) && n == num_var(model)) || error("Incompatible argument dimensions.") - add_constrs_t!(model, sparse(At), rel, b) -end - -function add_constrs!(model::Model, A::CoeffMat, rel::GCharOrVec, b::Vector{Float64}) - m, n = size(A) - (m == length(b) && n == num_var(model)) || error("Incompatible argument dimensions.") - add_constrs_t!(model, transpose(A), rel, b) -end - -add_constrs!(model::Model, cbeg::Vector, inds::Vector, coeffs::Vector, rel::Char, rhs::Vector) = add_constrs!(model, cbeg, inds, coeffs, cvecx(rel, length(cbeg)), rhs) - -function add_rangeconstrs!(model::Model, cbegins::IVec, inds::IVec, coeffs::FVec, lb::FVec, ub::FVec) - nnz = length(inds) - ncons = length(lb) - (ncons == length(ub) && nnz == length(coeffs)) || error("Incompatible constraint argument dimensions.") - - sense = fill!(Vector{Cchar}(undef, ncons), 'R') - - for i in 1:ncons - if lb[i] == -Inf - lb[i] = -ub[i] - ub[i] = Inf - coeffs[cbegins[i]+1:cbegins[i+1]] = -coeffs[cbegins[i]+1:cbegins[i+1]] - end - end - - if ncons > 0 - stat = @cpx_ccall(addrows, Cint, ( - Ptr{Cvoid}, # environment - Ptr{Cvoid}, # problem - Cint, # num new cols - Cint, # num new rows - Cint, # num non-zeros - Ptr{Cdouble}, # rhs - Ptr{Cchar}, # sense - Ptr{Cint}, # matrix start - Ptr{Cint}, # matrix index - Ptr{Cdouble}, # matrix values - Ptr{Cvoid}, # col names - Ptr{Cvoid} # row names - ), - model.env.ptr, model.lp, 0, ncons, nnz, lb, sense, cbegins[1:end-1], inds, coeffs, C_NULL, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - for i = 1:ncons - stat = @cpx_ccall(chgrngval, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, 1, Cint[i-1], [ub[i]-lb[i]]) - if stat != 0 - throw(CplexError(model.env, stat)) - end - end - end -end - -function add_rangeconstrs!(model::Model, cbeg::Vector, inds::Vector, coeffs::Vector, lb::Vector, ub::Vector) - add_rangeconstrs!(model, ivec(cbeg), ivec(inds), fvec(coeffs), fvec(lb), fvec(ub)) -end - -function add_rangeconstrs_t!(model::Model, At::SparseMatrixCSC{Float64}, lb::Vector, ub::Vector) - add_rangeconstrs!(model, At.colptr-1, At.rowval-1, At.nzval, lb, ub) -end - -function add_rangeconstrs_t!(model::Model, At::Matrix{Float64}, lb::Vector, ub::Vector) - add_rangeconstrs_t!(model, sparse(At), lb, ub) -end - -function add_rangeconstrs!(model::Model, A::CoeffMat, lb::Vector, ub::Vector) - m, n = size(A) - (m == length(lb) == length(ub) && n == num_var(model)) || error("Incompatible constraint argument dimensions.") - add_rangeconstrs_t!(model, transpose(A), lb, ub) -end - -function c_api_getnumrows(model::Model) - ncons = @cpx_ccall(getnumrows, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid} - ), - model.env.ptr, model.lp) - return ncons -end -# Needed by MathProgBase Interface -num_constr(model::Model) = c_api_getnumrows(model) - -function get_constr_senses(model::Model) - ncons = num_constr(model) - senses = Vector{Cchar}(undef, ncons) - stat = @cpx_ccall(getsense, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cchar}, - Cint, - Cint - ), - model.env.ptr, model.lp, senses, 0, ncons-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return senses -end - -function c_api_chgsense(model::Model, indices::IVec, senses::CVec) - ncons = length(IVec) - stat = @cpx_ccall(chgsense, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cchar} - ), - model.env.ptr, model.lp, ncons, - indices .- Cint(1), senses) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function set_constr_senses!(model::Model, senses::Vector) - ncons = num_constr(model) - stat = @cpx_ccall(chgsense, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cchar} - ), - model.env.ptr, model.lp, ncons, Cint[0:ncons-1;], - convert(Vector{Cchar},senses)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_getrhs(model::Model, rhs::Vector{Cdouble}, - row_start::Cint, row_end::Cint) - - stat = @cpx_ccall(getrhs, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, rhs, - row_start - Cint(1), row_end - Cint(1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_rhs(model::Model) - ncons = num_constr(model) - rhs = Vector{Cdouble}(undef, ncons) - stat = @cpx_ccall(getrhs, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, rhs, 0, ncons-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return rhs -end - -function c_api_chgrhs(model::Model, indices::IVec, rhs::FVec) - ncons = length(indices) - @assert ncons == length(rhs) - stat = @cpx_ccall(chgrhs, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, ncons, indices .- Cint(1), rhs) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function set_rhs!(model::Model, rhs::Vector) - ncons = num_constr(model) - @assert ncons == length(rhs) - stat = @cpx_ccall(chgrhs, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, ncons, Cint[0:ncons-1;], float(rhs)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_constrLB(model::Model) - senses = get_constr_senses(model) - ret = get_rhs(model) - for i = 1:num_constr(model) - if senses[i] == UInt8('G') || senses[i] == UInt8('E') - # Do nothing - else - # LEQ constraint so LB is -Inf - ret[i] = -Inf - end - end - return ret -end - -function get_constrUB(model::Model) - senses = get_constr_senses(model) - ret = get_rhs(model) - for i = 1:num_constr(model) - if senses[i] == UInt8('L') || senses[i] == UInt8('E') - # Do nothing - else - # GEQ constraint so UB is Inf - ret[i] = +Inf - end - end - return ret -end - -function set_constrLB!(model::Model, lb) - senses = get_constr_senses(model) - rhs = get_rhs(model) - sense_changed = false - for i = 1:num_constr(model) - if senses[i] == UInt8('G') || senses[i] == UInt8('E') - # Do nothing - elseif senses[i] == UInt8('L') - if lb[i] != -Inf - # LEQ constraint with non-NegInf LB implies a range - if isapprox(lb[i], rhs[i]) - # seems to be an equality - senses[i] = 'E' - sense_changed = true - else - error("Tried to set LB != -Inf on a LEQ constraint (index $i)") - end - else - lb[i] = rhs[i] - end - end - end - if sense_changed - set_constr_senses!(model, senses) - end - set_rhs!(model, lb) -end - -function set_constrUB!(model::Model, ub) - senses = get_constr_senses(model) - rhs = get_rhs(model) - sense_changed = false - for i = 1:num_constr(model) - if senses[i] == UInt8('L') || senses[i] == UInt8('E') - # Do nothing - elseif senses[i] == UInt8('G') - if ub[i] != Inf - # GEQ constraint with non-PosInf UB implies a range - if isapprox(ub[i], rhs[i]) - # seems to be an equality - senses[i] = 'E' - sense_changed = true - else - error("Tried to set UB != +Inf on a GEQ constraint (index $i)") - end - else - ub[i] = rhs[i] - end - end - end - if sense_changed - set_constr_senses!(model, senses) - end - set_rhs!(model, ub) -end - -function get_nnz(model::Model) - ret = @cpx_ccall(getnumnz, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - ret == 0 && throw(error("Could not query number of nonzeros in model")) - return ret -end - -function c_api_getrows(model::Model, mbegin::Cint, mend::Cint) - nzcnt_p = Vector{Cint}(undef, 1) - m = mend - mbegin + 1 - nnz = get_nnz(model) - rmatbeg = Vector{Cint}(undef, m+1) - rmatind = Vector{Cint}(undef, nnz) - rmatval = Vector{Cdouble}(undef, nnz) - surplus_p = Vector{Cint}(undef, 1) - stat = @cpx_ccall(getrows, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Cint, - Ptr{Cint}, - Cint, - Cint - ), - model.env.ptr, model.lp, nzcnt_p, - rmatbeg, rmatind, rmatval, - nnz, surplus_p, mbegin-Cint(1), mend-Cint(1)) - if stat != 0 || surplus_p[1] < 0 - throw(CplexError(model.env, stat)) - end - rmatbeg[end] = nnz # add the last entry that Julia wants - return (nzcnt_p[1], rmatbeg, rmatind .+ Cint(1), rmatval) -end - -function get_constr_matrix(model::Model) - nzcnt_p = Vector{Cint}(undef, 1) - m = num_constr(model) - n = num_var(model) - nnz = get_nnz(model) - cmatbeg = Vector{Cint}(undef, n+1) - cmatind = Vector{Cint}(undef, nnz) - cmatval = Vector{Cdouble}(undef, nnz) - surplus_p = Vector{Cint}(undef, 1) - stat = @cpx_ccall(getcols, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Cint, - Ptr{Cint}, - Cint, - Cint - ), - model.env.ptr, model.lp, nzcnt_p, cmatbeg, cmatind, cmatval, nnz, surplus_p, 0, n-1) - if stat != 0 || surplus_p[1] < 0 - throw(CplexError(model.env, stat)) - end - cmatbeg[end] = nnz # add the last entry that Julia wants - return SparseMatrixCSC(m, n, convert(Vector{Int64}, cmatbeg.+1), convert(Vector{Int64}, cmatind.+1), cmatval) -end - -get_num_sos(model::Model) = @cpx_ccall(getnumsos, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - -# int CPXaddsos( CPXCENVptr env, CPXLPptr lp, int numsos, int numsosnz, char const * sostype, int const * sosbeg, int const * sosind, double const * soswt, char ** sosname ) -function add_sos!(model::Model, sostype::Symbol, idx::Vector{Int}, weight::Vector{Cdouble}) - ((nelem = length(idx)) == length(weight)) || error("Index and weight vectors of unequal length") - (sostype == :SOS1) ? (typ = CPX_TYPE_SOS1) : ((sostype == :SOS2) ? (typ = CPX_TYPE_SOS2) : error("Invalid SOS constraint type")) - stat = @cpx_ccall(addsos, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Ptr{Cchar}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Ptr{Cchar}} - ), - model.env.ptr, model.lp, convert(Cint, 1), convert(Cint, nelem), [convert(Cchar, typ)], Cint[0], convert(Vector{Cint}, idx.-1), weight, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - model.has_int = true - model.has_sos = true - return nothing -end - -# int CPXgetsos( CPXCENVptr env, CPXCLPptr lp, int * numsosnz_p, char * sostype, -# int * sosbeg, int * sosind, double * soswt, int sosspace, int * surplus_p, int -# begin, int end ) -function c_api_getsos(model::Model, index::Int) - numsosnz_p = Ref{Cint}() - surplus_p = Ref{Cint}() - sos_type = Ref{Cchar}() - sos_beg = Ref{Cint}() - stat = @cpx_ccall(getsos, Cint, ( - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cint}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, - Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), - model.env.ptr, model.lp, numsosnz_p, sos_type, sos_beg, C_NULL, C_NULL, - 0, surplus_p, index, index) - - num_terms = -surplus_p[] - columns = fill(Cint(0), num_terms) - weights = fill(Cdouble(0.0), num_terms) - stat = @cpx_ccall(getsos, Cint, ( - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cint}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, - Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), - model.env.ptr, model.lp, numsosnz_p, sos_type, sos_beg, columns, weights, - num_terms, surplus_p, index, index) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return (columns, weights, sos_type[]) -end - -# int CPXdelsos( CPXCENVptr env, CPXLPptr lp, int begin, int end ) -function c_api_delsos(model::Model, begin_index::Int, end_index::Int) - stat = @cpx_ccall(delsos, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), - model.env.ptr, model.lp, begin_index, end_index) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return -end - -add_indicator_constraint(model::Model, idx, coeff, sense, rhs, indicator) = - add_indicator_constraint(model::Model, idx, coeff, sense, rhs, indicator, 0) -add_indicator_constraint(model::Model, idx, coeff, sense, rhs, indicator, comp) = - add_indicator_constraint(model, convert(Vector{Cint},idx), convert(Vector{Cdouble},coeff), - convert(Cint,sense), convert(Cdouble,rhs), convert(Cint,indicator), convert(Cint,comp)) -function add_indicator_constraint(model::Model, idx::Vector{Cint}, coeff::Vector{Cdouble}, sense::Cint, rhs::Cdouble, indicator::Cint, comp::Cint) - (nzcnt = length(idx)) == length(coeff) || error("Incompatible lengths in constraint specification") - stat = @cpx_ccall(addindconstr, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Cint, - Cdouble, - Cint, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cchar}), - model.env.ptr, model.lp, indicator .- Cint(1), comp, - nzcnt, rhs, sense, idx .- Cint(1), coeff, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return nothing -end - -function c_api_chgcoef(model::Model, row::Cint, col::Cint, coef::Cdouble) - stat = @cpx_ccall(chgcoef, Cint, ( - Ptr{Cvoid}, # environment - Ptr{Cvoid}, # problem - Cint, # row - Cint, # col - Cdouble, # coef - ), - model.env.ptr, model.lp, - row - Cint(1), col - Cint(1), coef) - - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_delrows(model::Model, first::Cint, last::Cint) - stat = @cpx_ccall(delrows, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - ), - model.env.ptr, model.lp, first-1, last-1) - - if stat != 0 - throw(CplexError(model.env, stat)) - end -end diff --git a/src/cpx_env.jl b/src/cpx_env.jl deleted file mode 100644 index 66ed7566..00000000 --- a/src/cpx_env.jl +++ /dev/null @@ -1,88 +0,0 @@ -mutable struct Env - ptr::Ptr{Cvoid} - num_models::Int - finalize_called::Bool - - function Env() - stat = Vector{Cint}(undef, 1) - tmp = @cpx_ccall(openCPLEX, Ptr{Cvoid}, (Ptr{Cint},), stat) - if tmp == C_NULL - error("CPLEX: Error creating environment") - end - env = new(tmp, 0, false) - function env_finalizer(env) - if env.num_models == 0 - close_CPLEX(env) - else - env.finalize_called = true - end - end - finalizer(env_finalizer, env) - return env - end -end - -convert(ty::Type{Ptr{Cvoid}}, env::Env) = env.ptr::Ptr{Cvoid} -unsafe_convert(ty::Type{Ptr{Cvoid}}, env::Env) = convert(ty, env) - -function is_valid(env::Env) - env.ptr != C_NULL -end - -function notify_new_model(env::Env) - env.num_models += 1 -end - -function notify_freed_model(env::Env) - @assert env.num_models > 0 - env.num_models -= 1 - if env.num_models <= 0 && env.finalize_called - close_CPLEX(env) - end -end - -function close_CPLEX(env::Env) - tmp = Ptr{Cvoid}[env.ptr] - stat = @cpx_ccall(closeCPLEX, Cint, (Ptr{Cvoid},), tmp) - env.ptr = C_NULL - if stat != 0 - throw(CplexError(env, stat)) - end -end - -function set_logfile(env::Env, filename::String) - @assert isascii(filename) - stat = @cpx_ccall(setlogfilename, Cint, (Ptr{Cvoid}, Ptr{Cchar}, Ptr{Cchar}), env, filename, "w") - if stat != 0 - throw(CplexError(env, stat)) - end -end - -function get_error_msg(env::Env, code::Number) - @assert env.ptr != C_NULL - buf = Vector{Cchar}(undef, 4096) # minimum size for Cplex to accept - errstr = @cpx_ccall(geterrorstring, Ptr{Cchar}, (Ptr{Cvoid}, Cint, Ptr{Cchar}), env.ptr, convert(Cint, code), buf) - if errstr != C_NULL - return unsafe_string(pointer(buf)) - else - error("CPLEX: error getting error message(!)") - end -end - -function version(env::Env = Env()) - charptr = @cpx_ccall(version, Ptr{Cchar}, (Ptr{Cvoid},), env.ptr) - if charptr != C_NULL - return unsafe_string(charptr) - else - return error("CPLEX: error getting version") - end -end - -struct CplexError <: Exception - code::Int - msg::String - - function CplexError(env::Env, code::Integer) - new(convert(Cint, code), get_error_msg(env, code)) - end -end diff --git a/src/cpx_generic_callbacks.jl b/src/cpx_generic_callbacks.jl deleted file mode 100644 index e2636d45..00000000 --- a/src/cpx_generic_callbacks.jl +++ /dev/null @@ -1,279 +0,0 @@ -# CPXCALLSOLUTIONTYPE -const CPXCALLBACKSOLUTION_NOCHECK = Cint(-1) -const CPXCALLBACKSOLUTION_CHECKFEAS = Cint(0) -const CPXCALLBACKSOLUTION_PROPAGATE = Cint(1) -const CPXCALLBACKSOLUTION_SOLVE = Cint(2) - -mutable struct CallbackContext - model::Model - context::Ptr{Cvoid} -end - -function callback_wrapper( - context::Ptr{Cvoid}, context_id::Clong, user_handle::Ptr{Cvoid} -) - (model, callback_func) = unsafe_pointer_to_objref(user_handle)::Tuple{Model, Function} - # Run the `callback_func`. - callback_func(CallbackContext(model, context), context_id) - # Exit normally. - return Cint(0) -end - -function return_status_or_throw(model, status) - if status != 0 - throw(CplexError(model.env, status)) - else - return status - end -end - - """ - cpx_callbacksetfunc(model::Model, context_mask::Clong, callback_func::Function) - -Set the general callback function of model to `callback_func`. - -`callback_func` is a function that takes two arguments. The first is a -`CallbackContext` instance, and the second is a `Clong` indicating where the -callback is being called from. - -### Examples - - function my_callback(cb_context::CPLEX.CallbackContext, context_id::Clong) - CPLEX.cpx_callbackabort(cb_context) - end - CPLEX.cpx_callbacksetfunc(model, Clong(0), my_callback) -""" -function cbsetfunc(model::Model, context_mask::Clong, callback_func::Function) - c_callback = @cfunction(callback_wrapper, Cint, (Ptr{Cvoid}, Clong, Ptr{Cvoid})) - user_handle = (model, callback_func)::Tuple{Model, Function} - return_status = @cpx_ccall( - callbacksetfunc, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Clong, Ptr{Cvoid}, Any), - model.env, model.lp, context_mask, c_callback, user_handle - ) - # We need to keep a reference to the callback function so that it isn't - # garbage collected. - model.callback = user_handle - return return_status_or_throw(model, return_status) -end - -function cbcandidateispoint(callback_data::CallbackContext) - is_point = Ref{Cint}() - stat = @cpx_ccall( - callbackcandidateispoint, - Cint, - (Ptr{Cvoid}, Ptr{Cint}), - callback_data.context, is_point - ) - if stat != 0 - throw(CplexError(callback_data.model.env, stat)) - end - return is_point[] -end - -function cbgetcandidatepoint( - callback_data::CallbackContext, - x::Vector{Float64}, - begin_index::Cint, - end_index::Cint, - obj::Ref{Float64} -) - return_status = @cpx_ccall( - callbackgetcandidatepoint, - Cint, - (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint, Ref{Cdouble}), - callback_data.context, x, begin_index, end_index, obj - ) - return return_status_or_throw(callback_data.model, return_status) -end - -function cbgetrelaxationpoint( - callback_data::CallbackContext, - x::Vector{Float64}, - begin_index::Cint, - end_index::Cint, - obj::Ref{Float64} -) - return_status = @cpx_ccall( - callbackgetrelaxationpoint, - Cint, - (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}), - callback_data.context, x, begin_index, end_index, obj - ) - return return_status_or_throw(callback_data.model, return_status) -end - -function cbpostheursoln( - callback_data::CallbackContext, - cnt::Cint, - ind::Vector{Cint}, - val::Vector{Cdouble}, - obj::Cdouble, - strat::Cint -) - return_status = @cpx_ccall( - callbackpostheursoln, - Cint, - (Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint), - callback_data.context, cnt, ind, val, obj, strat - ) - return return_status_or_throw(callback_data.model, return_status) -end - -function cbaddusercuts( - callback_data::CallbackContext, - rcnt::Cint, - nzcnt::Cint, - rhs::Vector{Cdouble}, - sense::Vector{Cchar}, - rmatbeg::Vector{Cint}, - rmatind::Vector{Cint}, - rmatval::Vector{Cdouble}, - purgeable::Vector{Cint}, - _local::Vector{Cint} -) - return_status = @cpx_ccall( - callbackaddusercuts, - Cint, - (Ptr{Cvoid}, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}), - callback_data.context, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, purgeable, _local - ) - return return_status_or_throw(callback_data.model, return_status) -end - -function cbrejectcandidate( - callback_data::CallbackContext, - rcnt::Cint, - nzcnt::Cint, - rhs::Vector{Cdouble}, - sense::Vector{Cchar}, - rmatbeg::Vector{Cint}, - rmatind::Vector{Cint}, - rmatval::Vector{Cdouble} -) - return_status = @cpx_ccall( - callbackrejectcandidate, - Cint, - (Ptr{Cvoid}, Cint, Cint, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), - callback_data.context, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval - ) - return return_status_or_throw(callback_data.model, return_status) -end - -function cbabort(callback_data::CallbackContext) - return_status = @cpx_ccall( - callbackabort, Cint, (Ptr{Cvoid},), callback_data.context - ) - return return_status_or_throw(callback_data.model, return_status) -end - -# # Check if the callback for the context CPX_CALLBACKCONTEXT_CANDIDATE is invoked by an unbounded relaxation -# function cbcandidateisray(callback_data::CallbackContext, is_ray::Int) -# return_status = @cpx_ccall(callbackcandidateisray, -# Cint, (Ptr{Cvoid}, Ptr{Cint}), callback_data.context, is_ray) -# return return_status_or_throw(callback_data.model, return_status) -# end - - -# function cbgetcandidateray( -# callback_data::CallbackContext, x::Vector{Cdouble}, begin_index::Int, -# end_index::Int) -# return_status = @cpx_ccall(callbackgetcandidateray, -# Cint, -# (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint), -# callback_data.context, x, begin_index - 1, end_index - 1) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# # This function may have bug, should be tested. -# # function cbgetfunc(model::Model, context_id::Clong, callback_func::Function) -# # c_callback = @cfunction(callback_wrapper, Cint, (Ptr{Cvoid}, Clong, Ptr{Cvoid})) -# # user_handle = (model, callback_func)::Tuple{Model, Function} -# # return_status = @cpx_ccall(callbackgetfunc, -# # Cint, -# # (Ptr{Cvoid}, Ptr{Cvoid}, Ref{Clong}, Ptr{Cvoid}, Any), -# # model.env, model.lp, context_mask, c_callback, user_handle) -# # if return_status != 0 -# # throw(CplexError(model.env, return_status)) -# # end -# # model.callback = user_handle -# # return return_status -# # end - -# function cbgetincumbent( -# callback_data::CallbackContext, x::Vector{Cdouble}, begin_index::Int, -# end_index::Int, obj::Ref{Float64}) -# return_status = @cpx_ccall(callbackgetincumbent, -# Cint, -# (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint, Ref{Cdouble}), -# callback_data.context, x, begin_index - 1, end_index - 1, obj) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetinfodbl( -# callback_data::CallbackContext, cbinfo::CbInfo, data_p::Cdouble) -# return_status = @cpx_ccall(callbackgetinfodbl, -# Cint, -# (Ptr{Cvoid}, Cint, Ref{Cdouble}), -# callback_data.context, cbinfo, data_p) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetinfoint( -# callback_data::CallbackContext, cbinfo::CbInfo, data_p::Int) -# return_status = @cpx_ccall(callbackgetinfoint, -# Cint, -# (Ptr{Cvoid}, Cint, Ref{Cint}), -# callback_data.context, cbinfo, data_p) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetinfolong( -# callback_data::CallbackContext, cbinfo::CbInfo, data_p::Clong) -# return_status = @cpx_ccall(callbackgetinfolong, -# Cint, -# (Ptr{Cvoid}, Cint, Ref{Clong}), -# callback_data.context, cbinfo, data_p) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetlocallb( -# callback_data::CallbackContext, lb::Vector{Cdouble}, begin_index::Int, -# end_index::Int) -# return_status = @cpx_ccall(callbackgetlocallb, -# Cint, -# (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint), -# callback_data.context, lb, begin_index - 1, end_index - 1) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetlocalub( -# callback_data::CallbackContext, ub::Vector{Cdouble}, begin_index::Int, -# end_index::Int) -# return_status = @cpx_ccall(callbackgetlocalub, -# Cint, -# (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint), -# callback_data.context, ub, begin_index - 1, end_index - 1) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetgloballb( -# callback_data::CallbackContext, lb::Vector{Cdouble}, begin_index::Int, -# end_index::Int) -# return_status = @cpx_ccall(callbackgetgloballb, -# Cint, -# (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint), -# callback_data.context, lb, begin_index - 1, end_index - 1) -# return return_status_or_throw(callback_data.model, return_status) -# end - -# function cbgetglobalub( -# callback_data::CallbackContext, ub::Vector{Cdouble}, begin_index::Int, -# end_index::Int) -# return_status = @cpx_ccall(callbackgetglobalub, -# Cint, -# (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint), -# callback_data.context, ub, begin_index - 1, end_index - 1) -# return return_status_or_throw(callback_data.model, return_status) -# end diff --git a/src/cpx_highlevel.jl b/src/cpx_highlevel.jl deleted file mode 100644 index 3c15b018..00000000 --- a/src/cpx_highlevel.jl +++ /dev/null @@ -1,43 +0,0 @@ -# High level model construction - -function cplex_model(env::Env; # solver environment - name::String="", # model name - sense::Symbol=:Min, # :minimize or :maximize - H::CoeffMat=emptyfmat, # quadratic coefficient matrix - f::FVec=emptyfvec, # linear coefficient vector - A::CoeffMat=emptyfmat, # LHS of inequality constraints - b::FVec=emptyfvec, # RHS of inequality constraints - Aeq::CoeffMat=emptyfmat, # LHS of equality constraints - beq::FVec=emptyfvec, # RHS of equality constraints - lb::Bounds=-Inf, # upper bounds - ub::Bounds=Inf) # lower bounds - - # check f - if isempty(f) - error("f must be specified.") - end - - # create model - model = Model(env, name) - - # set sense - set_sense!(model, sense) - - # add variables - add_vars!(model, f, lb, ub) - - # add qpterms - if !isempty(H) - add_qpterms!(model, H) - end - - # add constraints - if !isempty(A) && !isempty(b) - add_constrs!(model, A, '<', b) - end - - if !isempty(Aeq) && !isempty(beq) - add_constrs!(model, Aeq, '=', beq) - end - return model -end diff --git a/src/cpx_model.jl b/src/cpx_model.jl deleted file mode 100644 index 1285c337..00000000 --- a/src/cpx_model.jl +++ /dev/null @@ -1,331 +0,0 @@ -mutable struct Model - env::Env # Cplex environment - lp::Ptr{Cvoid} # Cplex problem (lp) - has_int::Bool # problem has integer variables? - has_qc::Bool # problem has quadratic constraints? - has_sos::Bool # problem has Special Ordered Sets? - callback::Any - terminator::Vector{Cint} -end -function Model(env::Env, lp::Ptr{Cvoid}) - notify_new_model(env) - model = Model(env, lp, false, false, false, nothing, Cint[0]) - function model_finalizer(model) - if model.lp != C_NULL - free_problem(model) - else - # User must have called `free_problem` directly. - end - notify_freed_model(env) - end - finalizer(model_finalizer, model) - set_terminate(model) - return model -end - -function Model(env::Env, name::String="CPLEX.jl") - @assert is_valid(env) - stat = Vector{Cint}(undef, 1) - tmp = @cpx_ccall(createprob, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cint}, Ptr{Cchar}), env.ptr, stat, name) - if tmp == C_NULL - throw(CplexError(env, stat)) - end - return Model(env, tmp) -end - -function read_model(model::Model, filename::String) - stat = @cpx_ccall(readcopyprob, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cchar}, Ptr{Cchar}), model.env.ptr, model.lp, filename, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - prob_type = get_prob_type(model) - if prob_type in [:MILP,:MIQP, :MIQCP] - model.has_int = true - end - if prob_type in [:QP, :MIQP, :QCP, :MIQCP] - model.has_qc = true - end -end - -function write_model(model::Model, filename::String) - if endswith(filename,".mps") - filetype = "MPS" - elseif endswith(filename,".lp") - filetype = "LP" - else - error("Unrecognized file extension: $filename (Only .mps and .lp are supported)") - end - stat = @cpx_ccall(writeprob, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cchar}, Ptr{Cchar}), model.env.ptr, model.lp, filename, filetype) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -## TODO: deep copy model, reset model - -function c_api_getobjsen(model::Model) - sense_int = @cpx_ccall(getobjsen, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - ), - model.env.ptr, model.lp) - - return sense_int -end -function get_sense(model::Model) - sense_int = c_api_getobjsen(model) - if sense_int == 1 - return :Min - elseif sense_int == -1 - return :Max - else - error("CPLEX: problem object or environment does not exist") - end -end - -function set_sense!(model::Model, sense) - if sense == :Min - @cpx_ccall(chgobjsen, Nothing, (Ptr{Cvoid}, Ptr{Cvoid}, Cint), model.env.ptr, model.lp, 1) - elseif sense == :Max - @cpx_ccall(chgobjsen, Nothing, (Ptr{Cvoid}, Ptr{Cvoid}, Cint), model.env.ptr, model.lp, -1) - else - error("Unrecognized objective sense $sense") - end -end - -function c_api_chgobjsen(model::Model, sense_int::Cint) - @cpx_ccall(chgobjsen, Nothing, (Ptr{Cvoid}, Ptr{Cvoid}, Cint), - model.env.ptr, model.lp, sense_int) -end - -function c_api_getobj(model::Model, sized_obj::FVec, - col_start::Cint, col_end::Cint) - - nvars = num_var(model) - stat = @cpx_ccall(getobj, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, sized_obj, - col_start - Cint(1), col_end - Cint(1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_obj(model::Model) - nvars = num_var(model) - obj = Vector{Cdouble}(undef, nvars) - stat = @cpx_ccall(getobj, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, obj, 0, nvars-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return obj -end - -const type_map = Dict( - 0 => :LP, - 1 => :MILP, - 3 => :FIXEDMILP, # actually fixed milp - 5 => :QP, - 7 => :MIQP, - 8 => :FIXEDMIQP, - 10 => :QCP, - 11 => :MIQCP -) - -const rev_prob_type_map = Dict( - :LP => 0, - :MILP => 1, - :FIXEDMILP => 3, - :QP => 5, - :MIQP => 7, - :FIXEDMIQP => 8, - :QCP => 10, - :MIQCP => 11 -) - -function get_prob_type(model::Model) - ret = @cpx_ccall(getprobtype, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}), - model.env.ptr, model.lp) - ret == -1 && error("No problem of environment") - return type_map[Int(ret)] -end - -function set_prob_type!(model::Model, tyint::Int) - stat = @cpx_ccall(chgprobtype, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint), - model.env.ptr, model.lp, tyint) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end -set_prob_type!(model::Model, ty::Symbol) = set_prob_type!(model, rev_prob_type_map[ty]) - - -function set_obj!(model::Model, c::Vector) - nvars = num_var(model) - stat = @cpx_ccall(chgobj, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, nvars, Cint[0:nvars-1;], float(c)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_chgobj(model::Model, indices::IVec, values::FVec) - nvars = length(indices) - stat = @cpx_ccall(chgobj, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, nvars, - indices .- Cint(1), values) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_chgobjoffset(model::Model, offset::Float64) - stat = @cpx_ccall( - chgobjoffset, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Cdouble), - model.env.ptr, model.lp, offset - ) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return -end - -function c_api_getobjoffset(model::Model) - objoffset_p = Ref{Float64}() - stat = @cpx_ccall( - getobjoffset, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cdouble}), - model.env.ptr, model.lp, objoffset_p - ) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return objoffset_p[] -end - -set_warm_start!(model::Model, x::Vector{Float64}, effortlevel::Integer = CPX_MIPSTART_AUTO) = set_warm_start!(model, Cint[1:length(x);], x, effortlevel) - -function set_warm_start!(model::Model, indx::IVec, val::FVec, effortlevel::Integer) - stat = @cpx_ccall(addmipstarts, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Ptr{Cchar}} - ), - model.env.ptr, model.lp, 1, length(indx), Cint[0], indx .- Cint(1), val, Cint[effortlevel], C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function free_problem(model::Model) - stat = @cpx_ccall(freeprob, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - model.lp = C_NULL - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function set_terminate(model::Model) - stat = @cpx_ccall(setterminate, Cint, (Ptr{Cvoid},Ptr{Cint}), model.env.ptr, model.terminator) - if stat != 0 - throw(CplexError(env, stat)) - end -end - -terminate(model::Model) = (model.terminator[1] = 1) - -mutable struct ConflictRefinerData - stat::Int - nrows::Int # number of rows participating in the conflict - rowind::Vector{Cint} # index of the rows that participate - rowstat::Vector{Cint} # state of the rows that participate - ncols::Int # number of columns participating in the conflict - colind::Vector{Cint} # index of the columns that participate - colstat::Vector{Cint} # state of the columns that participates -end - -function c_api_getconflict(model::Model) - # This function always calls refineconflict first, which starts the conflict refiner. - # In other words, any call to this function is expensive. - - # First, compute the conflict. - confnumrows_p = Ref{Cint}(0) - confnumcols_p = Ref{Cint}(0) - stat = @cpx_ccall( - refineconflict, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cint}, Ptr{Cint}), - model.env.ptr, model.lp, confnumrows_p, confnumcols_p) - if stat != 0 - throw(CplexError(model.env, stat)) - end - # Then, retrieve it. - confstat_p = Ref{Cint}() - rowind = Vector{Cint}(undef, confnumrows_p[]) - rowbdstat = Vector{Cint}(undef, confnumrows_p[]) - confnumrows_p = Ref{Cint}() - colind = Vector{Cint}(undef, confnumcols_p[]) - colbdstat = Vector{Cint}(undef, confnumcols_p[]) - confnumcols_p = Ref{Cint}() - stat = @cpx_ccall( - getconflict, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), - model.env.ptr, model.lp, confstat_p, rowind, rowbdstat, confnumrows_p, colind, colbdstat, confnumcols_p) - if stat != 0 - throw(CplexError(model.env, stat)) - end - - return ConflictRefinerData(confstat_p[], confnumrows_p[], rowind, rowbdstat, confnumcols_p[], colind, colbdstat) -end - -function c_api_chgname(model::Model, key::Cchar, ij::Cint, name::String) - stat = @cpx_ccall( - chgname, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint, Ptr{Cchar}), - model.env.ptr, model.lp, key, ij, name - ) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return -end diff --git a/src/cpx_params.jl b/src/cpx_params.jl deleted file mode 100644 index 8de2117d..00000000 --- a/src/cpx_params.jl +++ /dev/null @@ -1,145 +0,0 @@ -# const CPX_INFBOUND = 1e20 -# const CPX_STR_PARAM_MAX = 512 - -function get_param_type(env::Env, indx::Int) - ptype = Vector{Cint}(undef, 1) - stat = @cpx_ccall(getparamtype, Cint, ( - Ptr{Cvoid}, - Cint, - Ptr{Cint} - ), - env.ptr, convert(Cint,indx), ptype) - if stat != 0 - throw(CplexError(env, stat)) - end - if ptype[1] == 0 - ret = :None - elseif ptype[1] == 1 - ret = :Int - elseif ptype[1] == 2 - ret = :Double - elseif ptype[1] == 3 - ret = :String - elseif ptype[1] == 4 - ret = :Long - else - error("Parameter type not recognized") - end - - return ret -end - -get_param_type(env::Env, name::String) = get_param_type(env, paramName2Indx[name]) - -function set_param!(env::Env, _pindx::Int, val, ptype::Symbol) - pindx = convert(Cint, _pindx) - if ptype == :Int - stat = @cpx_ccall(setintparam, Cint, (Ptr{Cvoid}, Cint, Cint), env.ptr, pindx, convert(Cint,val)) - elseif ptype == :Double - stat = @cpx_ccall(setdblparam, Cint, (Ptr{Cvoid}, Cint, Cdouble), env.ptr, pindx, float(val)) - elseif ptype == :String - stat = @cpx_ccall(setstrparam, Cint, (Ptr{Cvoid}, Cint, Cstring), env.ptr, pindx, String(val)) - elseif ptype == :Long - stat = @cpx_ccall(setlongparam, Cint, (Ptr{Cvoid}, Cint, Clonglong), env.ptr, pindx, convert(Clonglong, val)) - elseif ptype == :None - warn("Trying to set a parameter of type None; doing nothing") - else - error("Unrecognized parameter type") - end - if stat != 0 - throw(CplexError(env, stat)) - end -end - -set_param!(env::Env, pindx::Int, val) = set_param!(env, pindx, val, get_param_type(env, pindx)) - -set_param!(env::Env, pname::String, val) = set_param!(env, paramName2Indx[pname], val) - -# set_params!(env::Env, args...) -# for (name, v) in args -# set_param!(prob, string(name), v) -# end -# end - -function get_param(env::Env, pindx::Int, ptype::Symbol) - if ptype == :Int - val_int = Vector{Cint}(undef, 1) - stat = @cpx_ccall(getintparam, Cint, (Ptr{Cvoid}, Cint, Ptr{Cint}), env.ptr, convert(Cint,pindx), val_int) - if stat != 0 - throw(CplexError(env, stat)) - end - return val_int[1] - elseif ptype == :Double - val_double = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getdblparam, Cint, (Ptr{Cvoid}, Cint, Ptr{Cdouble}), env.ptr, convert(Cint,pindx), val_double) - if stat != 0 - throw(CplexError(env, stat)) - end - return val_double[1] - elseif ptype == :String - buf = Vector{Cchar}(undef, CPX_STR_PARAM_MAX) # max str param length is 512 in Cplex 12.51 - stat = @cpx_ccall(getstrparam, Cint, (Ptr{Cvoid}, Cint, Ptr{Cchar}), env.ptr, convert(Cint,pindx), buf) - if stat != 0 - throw(CplexError(env, stat)) - end - return bytestring(pointer(buf)) - elseif ptype == :Long - val_long = Vector{Clonglong}(undef, 1) - stat = @cpx_ccall(getlongparam, Cint, (Ptr{Cvoid}, Cint, Ptr{Clonglong}), env.ptr, convert(Cint,pindx), val_long) - if stat != 0 - throw(CplexError(env, stat)) - end - return val_long[1] - elseif ptype == :None - warn("Trying to set a parameter of type None; doing nothing") - else - error("Unrecognized parameter type") - end - nothing -end - -get_param(env::Env, pindx::Int) = get_param(env, pindx, get_param_type(env, pindx)) - -get_param(env::Env, pname::String) = get_param(env, paramName2Indx[pname]) - -tune_param(model::Model) = tune_param(model, Dict(), Dict(), Dict()) - -function tune_param(model::Model, intfixed::Dict, dblfixed::Dict, strfixed::Dict) - intkeys = Cint[k for k in keys(intfixed)] - dblkeys = Cint[k for k in keys(dblfixed)] - strkeys = Cint[k for k in keys(strfixed)] - tune_stat = Vector{Cint}(undef, 1) - stat = @cpx_ccall(tuneparam, Cint, (Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cint}, - Cint, - Ptr{Cint}, - Ptr{Cdouble}, - Cint, - Ptr{Cint}, - Ptr{Ptr{Cchar}}, - Ptr{Cint}), - model.env, - model.lp, - convert(Cint, length(intkeys)), - intkeys, - Cint[intfixed[int(k)] for k in intkeys], - convert(Cint, length(dblkeys)), - dblkeys, - Cdouble[dblfixed[int(k)] for k in dblkeys], - convert(Cint, length(strkeys)), - strkeys, - [strkeys[int(k)] for k in strkeys], - tune_stat) - if stat != 0 - throw(CplexError(model.env, stat)) - end - for param in keys(paramName2Indx) - print(param * ": ") - val = get_param(model.env, param) - println(val) - end - return tune_stat[1] -end diff --git a/src/cpx_params_12100.jl b/src/cpx_params_12100.jl deleted file mode 100644 index d5e4dc6b..00000000 --- a/src/cpx_params_12100.jl +++ /dev/null @@ -1,379 +0,0 @@ -# grep "#define" cpxconst.h | grep "CPX_PARAM_|CPXPARAM" | awk '{ printf("\"%s\" => %s,\n",$2,$3) }' -const paramName2Indx = Dict( -"CPX_AUTO_SOLN" => 0, -"CPX_BASIC_SOLN" => 1, -"CPX_NONBASIC_SOLN" => 2, -"CPX_PRIMAL_SOLN" => 3, -"CPX_PARAM_ALL_MIN" => 1000, -"CPX_PARAM_ALL_MAX" => 6000, -"CPXPARAM_H" => 1, -"CPXPARAM_Advance" => 1001, -"CPXPARAM_Barrier_Algorithm" => 3007, -"CPXPARAM_Barrier_ColNonzeros" => 3009, -"CPXPARAM_Barrier_ConvergeTol" => 3002, -"CPXPARAM_Barrier_Crossover" => 3018, -"CPXPARAM_Barrier_Display" => 3010, -"CPXPARAM_Barrier_Limits_Corrections" => 3013, -"CPXPARAM_Barrier_Limits_Growth" => 3003, -"CPXPARAM_Barrier_Limits_Iteration" => 3012, -"CPXPARAM_Barrier_Limits_ObjRange" => 3004, -"CPXPARAM_Barrier_Ordering" => 3014, -"CPXPARAM_Barrier_QCPConvergeTol" => 3020, -"CPXPARAM_Barrier_StartAlg" => 3017, -"CPXPARAM_Benders_Strategy" => 1501, -"CPXPARAM_Benders_Tolerances_feasibilitycut" => 1509, -"CPXPARAM_Benders_Tolerances_optimalitycut" => 1510, -"CPXPARAM_Benders_WorkerAlgorithm" => 1500, -"CPXPARAM_ClockType" => 1006, -"CPXPARAM_Conflict_Algorithm" => 1073, -"CPXPARAM_Conflict_Display" => 1074, -"CPXPARAM_CPUmask" => 1144, -"CPXPARAM_DetTimeLimit" => 1127, -"CPXPARAM_DistMIP_Rampup_DetTimeLimit" => 2164, -"CPXPARAM_DistMIP_Rampup_Duration" => 2163, -"CPXPARAM_DistMIP_Rampup_TimeLimit" => 2165, -"CPXPARAM_Emphasis_Memory" => 1082, -"CPXPARAM_Emphasis_MIP" => 2058, -"CPXPARAM_Emphasis_Numerical" => 1083, -"CPXPARAM_Feasopt_Mode" => 1084, -"CPXPARAM_Feasopt_Tolerance" => 2073, -"CPXPARAM_LPMethod" => 1062, -"CPXPARAM_MIP_Cuts_BQP" => 2195, -"CPXPARAM_MIP_Cuts_Cliques" => 2003, -"CPXPARAM_MIP_Cuts_Covers" => 2005, -"CPXPARAM_MIP_Cuts_Disjunctive" => 2053, -"CPXPARAM_MIP_Cuts_FlowCovers" => 2040, -"CPXPARAM_MIP_Cuts_Gomory" => 2049, -"CPXPARAM_MIP_Cuts_GUBCovers" => 2044, -"CPXPARAM_MIP_Cuts_Implied" => 2041, -"CPXPARAM_MIP_Cuts_LiftProj" => 2152, -"CPXPARAM_MIP_Cuts_LocalImplied" => 2181, -"CPXPARAM_MIP_Cuts_MCFCut" => 2134, -"CPXPARAM_MIP_Cuts_MIRCut" => 2052, -"CPXPARAM_MIP_Cuts_PathCut" => 2051, -"CPXPARAM_MIP_Cuts_RLT" => 2196, -"CPXPARAM_MIP_Cuts_ZeroHalfCut" => 2111, -"CPXPARAM_MIP_Display" => 2012, -"CPXPARAM_MIP_Interval" => 2013, -"CPXPARAM_MIP_Limits_AggForCut" => 2054, -"CPXPARAM_MIP_Limits_AuxRootThreads" => 2139, -"CPXPARAM_MIP_Limits_CutPasses" => 2056, -"CPXPARAM_MIP_Limits_CutsFactor" => 2033, -"CPXPARAM_MIP_Limits_EachCutLimit" => 2102, -"CPXPARAM_MIP_Limits_GomoryCand" => 2048, -"CPXPARAM_MIP_Limits_GomoryPass" => 2050, -"CPXPARAM_MIP_Limits_Nodes" => 2017, -"CPXPARAM_MIP_Limits_PolishTime" => 2066, -"CPXPARAM_MIP_Limits_Populate" => 2108, -"CPXPARAM_MIP_Limits_ProbeDetTime" => 2150, -"CPXPARAM_MIP_Limits_ProbeTime" => 2065, -"CPXPARAM_MIP_Limits_RepairTries" => 2067, -"CPXPARAM_MIP_Limits_Solutions" => 2015, -"CPXPARAM_MIP_Limits_StrongCand" => 2045, -"CPXPARAM_MIP_Limits_StrongIt" => 2046, -"CPXPARAM_MIP_Limits_TreeMemory" => 2027, -"CPXPARAM_MIP_OrderType" => 2032, -"CPXPARAM_MIP_PolishAfter_AbsMIPGap" => 2126, -"CPXPARAM_MIP_PolishAfter_DetTime" => 2151, -"CPXPARAM_MIP_PolishAfter_MIPGap" => 2127, -"CPXPARAM_MIP_PolishAfter_Nodes" => 2128, -"CPXPARAM_MIP_PolishAfter_Solutions" => 2129, -"CPXPARAM_MIP_PolishAfter_Time" => 2130, -"CPXPARAM_MIP_Pool_AbsGap" => 2106, -"CPXPARAM_MIP_Pool_Capacity" => 2103, -"CPXPARAM_MIP_Pool_Intensity" => 2107, -"CPXPARAM_MIP_Pool_RelGap" => 2105, -"CPXPARAM_MIP_Pool_Replace" => 2104, -"CPXPARAM_MIP_Strategy_Backtrack" => 2002, -"CPXPARAM_MIP_Strategy_BBInterval" => 2039, -"CPXPARAM_MIP_Strategy_Branch" => 2001, -"CPXPARAM_MIP_Strategy_CallbackReducedLP" => 2055, -"CPXPARAM_MIP_Strategy_Dive" => 2060, -"CPXPARAM_MIP_Strategy_File" => 2016, -"CPXPARAM_MIP_Strategy_FPHeur" => 2098, -"CPXPARAM_MIP_Strategy_HeuristicEffort" => 2120, -"CPXPARAM_MIP_Strategy_HeuristicFreq" => 2031, -"CPXPARAM_MIP_Strategy_KappaStats" => 2137, -"CPXPARAM_MIP_Strategy_LBHeur" => 2063, -"CPXPARAM_MIP_Strategy_MIQCPStrat" => 2110, -"CPXPARAM_MIP_Strategy_NodeSelect" => 2018, -"CPXPARAM_MIP_Strategy_Order" => 2020, -"CPXPARAM_MIP_Strategy_PresolveNode" => 2037, -"CPXPARAM_MIP_Strategy_Probe" => 2042, -"CPXPARAM_MIP_Strategy_RINSHeur" => 2061, -"CPXPARAM_MIP_Strategy_Search" => 2109, -"CPXPARAM_MIP_Strategy_StartAlgorithm" => 2025, -"CPXPARAM_MIP_Strategy_SubAlgorithm" => 2026, -"CPXPARAM_MIP_Strategy_VariableSelect" => 2028, -"CPXPARAM_MIP_SubMIP_StartAlg" => 2205, -"CPXPARAM_MIP_SubMIP_SubAlg" => 2206, -"CPXPARAM_MIP_SubMIP_NodeLimit" => 2212, -"CPXPARAM_MIP_SubMIP_Scale" => 2207, -"CPXPARAM_MIP_Tolerances_AbsMIPGap" => 2008, -"CPXPARAM_MIP_Tolerances_Linearization" => 2068, -"CPXPARAM_MIP_Tolerances_Integrality" => 2010, -"CPXPARAM_MIP_Tolerances_LowerCutoff" => 2006, -"CPXPARAM_MIP_Tolerances_MIPGap" => 2009, -"CPXPARAM_MIP_Tolerances_ObjDifference" => 2019, -"CPXPARAM_MIP_Tolerances_RelObjDifference" => 2022, -"CPXPARAM_MIP_Tolerances_UpperCutoff" => 2007, -"CPXPARAM_MultiObjective_Display" => 1600, -"CPXPARAM_Network_Display" => 5005, -"CPXPARAM_Network_Iterations" => 5001, -"CPXPARAM_Network_NetFind" => 1022, -"CPXPARAM_Network_Pricing" => 5004, -"CPXPARAM_Network_Tolerances_Feasibility" => 5003, -"CPXPARAM_Network_Tolerances_Optimality" => 5002, -"CPXPARAM_OptimalityTarget" => 1131, -"CPXPARAM_Output_CloneLog" => 1132, -"CPXPARAM_Output_IntSolFilePrefix" => 2143, -"CPXPARAM_Output_MPSLong" => 1081, -"CPXPARAM_Output_WriteLevel" => 1114, -"CPXPARAM_Parallel" => 1109, -"CPXPARAM_ParamDisplay" => 1163, -"CPXPARAM_Preprocessing_Aggregator" => 1003, -"CPXPARAM_Preprocessing_BoundStrength" => 2029, -"CPXPARAM_Preprocessing_CoeffReduce" => 2004, -"CPXPARAM_Preprocessing_Dependency" => 1008, -"CPXPARAM_Preprocessing_Dual" => 1044, -"CPXPARAM_Preprocessing_Fill" => 1002, -"CPXPARAM_Preprocessing_Folding" => 1164, -"CPXPARAM_Preprocessing_Linear" => 1058, -"CPXPARAM_Preprocessing_NumPass" => 1052, -"CPXPARAM_Preprocessing_Presolve" => 1030, -"CPXPARAM_Preprocessing_QCPDuals" => 4003, -"CPXPARAM_Preprocessing_QPMakePSD" => 4010, -"CPXPARAM_Preprocessing_QToLin" => 4012, -"CPXPARAM_Preprocessing_Reduce" => 1057, -"CPXPARAM_Preprocessing_Relax" => 2034, -"CPXPARAM_Preprocessing_RepeatPresolve" => 2064, -"CPXPARAM_Preprocessing_Symmetry" => 2059, -"CPXPARAM_QPMethod" => 1063, -"CPXPARAM_RandomSeed" => 1124, -"CPXPARAM_Read_APIEncoding" => 1130, -"CPXPARAM_Read_Constraints" => 1021, -"CPXPARAM_Read_DataCheck" => 1056, -"CPXPARAM_Read_FileEncoding" => 1129, -"CPXPARAM_Read_Nonzeros" => 1024, -"CPXPARAM_Read_QPNonzeros" => 4001, -"CPXPARAM_Read_Scale" => 1034, -"CPXPARAM_Read_Variables" => 1023, -"CPXPARAM_Read_WarningLimit" => 1157, -"CPXPARAM_Record" => 1162, -"CPXPARAM_ScreenOutput" => 1035, -"CPXPARAM_Sifting_Algorithm" => 1077, -"CPXPARAM_Sifting_Simplex" => 1158, -"CPXPARAM_Sifting_Display" => 1076, -"CPXPARAM_Sifting_Iterations" => 1078, -"CPXPARAM_Simplex_Crash" => 1007, -"CPXPARAM_Simplex_DGradient" => 1009, -"CPXPARAM_Simplex_Display" => 1019, -"CPXPARAM_Simplex_DynamicRows" => 1161, -"CPXPARAM_Simplex_Limits_Iterations" => 1020, -"CPXPARAM_Simplex_Limits_LowerObj" => 1025, -"CPXPARAM_Simplex_Limits_Perturbation" => 1028, -"CPXPARAM_Simplex_Limits_Singularity" => 1037, -"CPXPARAM_Simplex_Limits_UpperObj" => 1026, -"CPXPARAM_Simplex_Perturbation_Constant" => 1015, -"CPXPARAM_Simplex_Perturbation_Indicator" => 1027, -"CPXPARAM_Simplex_PGradient" => 1029, -"CPXPARAM_Simplex_Pricing" => 1010, -"CPXPARAM_Simplex_Refactor" => 1031, -"CPXPARAM_Simplex_Tolerances_Feasibility" => 1016, -"CPXPARAM_Simplex_Tolerances_Markowitz" => 1013, -"CPXPARAM_Simplex_Tolerances_Optimality" => 1014, -"CPXPARAM_SolutionType" => 1147, -"CPXPARAM_Threads" => 1067, -"CPXPARAM_TimeLimit" => 1039, -"CPXPARAM_Tune_DetTimeLimit" => 1139, -"CPXPARAM_Tune_Display" => 1113, -"CPXPARAM_Tune_Measure" => 1110, -"CPXPARAM_Tune_Repeat" => 1111, -"CPXPARAM_Tune_TimeLimit" => 1112, -"CPXPARAM_WorkDir" => 1064, -"CPXPARAM_WorkMem" => 1065, -"CPX_PARAM_ADVIND" => 1001, -"CPX_PARAM_AGGFILL" => 1002, -"CPX_PARAM_AGGIND" => 1003, -"CPX_PARAM_CLOCKTYPE" => 1006, -"CPX_PARAM_CRAIND" => 1007, -"CPX_PARAM_DEPIND" => 1008, -"CPX_PARAM_DPRIIND" => 1009, -"CPX_PARAM_PRICELIM" => 1010, -"CPX_PARAM_EPMRK" => 1013, -"CPX_PARAM_EPOPT" => 1014, -"CPX_PARAM_EPPER" => 1015, -"CPX_PARAM_EPRHS" => 1016, -"CPX_PARAM_SIMDISPLAY" => 1019, -"CPX_PARAM_ITLIM" => 1020, -"CPX_PARAM_ROWREADLIM" => 1021, -"CPX_PARAM_NETFIND" => 1022, -"CPX_PARAM_COLREADLIM" => 1023, -"CPX_PARAM_NZREADLIM" => 1024, -"CPX_PARAM_OBJLLIM" => 1025, -"CPX_PARAM_OBJULIM" => 1026, -"CPX_PARAM_PERIND" => 1027, -"CPX_PARAM_PERLIM" => 1028, -"CPX_PARAM_PPRIIND" => 1029, -"CPX_PARAM_PREIND" => 1030, -"CPX_PARAM_REINV" => 1031, -"CPX_PARAM_SCAIND" => 1034, -"CPX_PARAM_SCRIND" => 1035, -"CPX_PARAM_SINGLIM" => 1037, -"CPX_PARAM_TILIM" => 1039, -"CPX_PARAM_PREDUAL" => 1044, -"CPX_PARAM_PREPASS" => 1052, -"CPX_PARAM_DATACHECK" => 1056, -"CPX_PARAM_REDUCE" => 1057, -"CPX_PARAM_PRELINEAR" => 1058, -"CPX_PARAM_LPMETHOD" => 1062, -"CPX_PARAM_QPMETHOD" => 1063, -"CPX_PARAM_WORKDIR" => 1064, -"CPX_PARAM_WORKMEM" => 1065, -"CPX_PARAM_THREADS" => 1067, -"CPX_PARAM_CONFLICTALG" => 1073, -"CPX_PARAM_CONFLICTDISPLAY" => 1074, -"CPX_PARAM_SIFTDISPLAY" => 1076, -"CPX_PARAM_SIFTALG" => 1077, -"CPX_PARAM_SIFTITLIM" => 1078, -"CPX_PARAM_MPSLONGNUM" => 1081, -"CPX_PARAM_MEMORYEMPHASIS" => 1082, -"CPX_PARAM_NUMERICALEMPHASIS" => 1083, -"CPX_PARAM_FEASOPTMODE" => 1084, -"CPX_PARAM_PARALLELMODE" => 1109, -"CPX_PARAM_TUNINGMEASURE" => 1110, -"CPX_PARAM_TUNINGREPEAT" => 1111, -"CPX_PARAM_TUNINGTILIM" => 1112, -"CPX_PARAM_TUNINGDISPLAY" => 1113, -"CPX_PARAM_WRITELEVEL" => 1114, -"CPX_PARAM_RANDOMSEED" => 1124, -"CPX_PARAM_DETTILIM" => 1127, -"CPX_PARAM_FILEENCODING" => 1129, -"CPX_PARAM_APIENCODING" => 1130, -"CPX_PARAM_OPTIMALITYTARGET" => 1131, -"CPX_PARAM_CLONELOG" => 1132, -"CPX_PARAM_TUNINGDETTILIM" => 1139, -"CPX_PARAM_CPUMASK" => 1144, -"CPX_PARAM_SOLUTIONTYPE" => 1147, -"CPX_PARAM_WARNLIM" => 1157, -"CPX_PARAM_SIFTSIM" => 1158, -"CPX_PARAM_DYNAMICROWS" => 1161, -"CPX_PARAM_RECORD" => 1162, -"CPX_PARAM_PARAMDISPLAY" => 1163, -"CPX_PARAM_FOLDING" => 1164, -"CPX_PARAM_WORKERALG" => 1500, -"CPX_PARAM_BENDERSSTRATEGY" => 1501, -"CPX_PARAM_BENDERSFEASCUTTOL" => 1509, -"CPX_PARAM_BENDERSOPTCUTTOL" => 1510, -"CPX_PARAM_MULTIOBJDISPLAY" => 1600, -"CPX_PARAM_BRDIR" => 2001, -"CPX_PARAM_BTTOL" => 2002, -"CPX_PARAM_CLIQUES" => 2003, -"CPX_PARAM_COEREDIND" => 2004, -"CPX_PARAM_COVERS" => 2005, -"CPX_PARAM_CUTLO" => 2006, -"CPX_PARAM_CUTUP" => 2007, -"CPX_PARAM_EPAGAP" => 2008, -"CPX_PARAM_EPGAP" => 2009, -"CPX_PARAM_EPINT" => 2010, -"CPX_PARAM_MIPDISPLAY" => 2012, -"CPX_PARAM_MIPINTERVAL" => 2013, -"CPX_PARAM_INTSOLLIM" => 2015, -"CPX_PARAM_NODEFILEIND" => 2016, -"CPX_PARAM_NODELIM" => 2017, -"CPX_PARAM_NODESEL" => 2018, -"CPX_PARAM_OBJDIF" => 2019, -"CPX_PARAM_MIPORDIND" => 2020, -"CPX_PARAM_RELOBJDIF" => 2022, -"CPX_PARAM_STARTALG" => 2025, -"CPX_PARAM_SUBALG" => 2026, -"CPX_PARAM_TRELIM" => 2027, -"CPX_PARAM_VARSEL" => 2028, -"CPX_PARAM_BNDSTRENIND" => 2029, -"CPX_PARAM_HEURFREQ" => 2031, -"CPX_PARAM_MIPORDTYPE" => 2032, -"CPX_PARAM_CUTSFACTOR" => 2033, -"CPX_PARAM_RELAXPREIND" => 2034, -"CPX_PARAM_PRESLVND" => 2037, -"CPX_PARAM_BBINTERVAL" => 2039, -"CPX_PARAM_FLOWCOVERS" => 2040, -"CPX_PARAM_IMPLBD" => 2041, -"CPX_PARAM_PROBE" => 2042, -"CPX_PARAM_GUBCOVERS" => 2044, -"CPX_PARAM_STRONGCANDLIM" => 2045, -"CPX_PARAM_STRONGITLIM" => 2046, -"CPX_PARAM_FRACCAND" => 2048, -"CPX_PARAM_FRACCUTS" => 2049, -"CPX_PARAM_FRACPASS" => 2050, -"CPX_PARAM_FLOWPATHS" => 2051, -"CPX_PARAM_MIRCUTS" => 2052, -"CPX_PARAM_DISJCUTS" => 2053, -"CPX_PARAM_AGGCUTLIM" => 2054, -"CPX_PARAM_MIPCBREDLP" => 2055, -"CPX_PARAM_CUTPASS" => 2056, -"CPX_PARAM_MIPEMPHASIS" => 2058, -"CPX_PARAM_SYMMETRY" => 2059, -"CPX_PARAM_DIVETYPE" => 2060, -"CPX_PARAM_RINSHEUR" => 2061, -"CPX_PARAM_LBHEUR" => 2063, -"CPX_PARAM_REPEATPRESOLVE" => 2064, -"CPX_PARAM_PROBETIME" => 2065, -"CPX_PARAM_POLISHTIME" => 2066, -"CPX_PARAM_REPAIRTRIES" => 2067, -"CPX_PARAM_EPLIN" => 2068, -"CPX_PARAM_EPRELAX" => 2073, -"CPX_PARAM_FPHEUR" => 2098, -"CPX_PARAM_EACHCUTLIM" => 2102, -"CPX_PARAM_SOLNPOOLCAPACITY" => 2103, -"CPX_PARAM_SOLNPOOLREPLACE" => 2104, -"CPX_PARAM_SOLNPOOLGAP" => 2105, -"CPX_PARAM_SOLNPOOLAGAP" => 2106, -"CPX_PARAM_SOLNPOOLINTENSITY" => 2107, -"CPX_PARAM_POPULATELIM" => 2108, -"CPX_PARAM_MIPSEARCH" => 2109, -"CPX_PARAM_MIQCPSTRAT" => 2110, -"CPX_PARAM_ZEROHALFCUTS" => 2111, -"CPX_PARAM_POLISHAFTEREPAGAP" => 2126, -"CPX_PARAM_POLISHAFTEREPGAP" => 2127, -"CPX_PARAM_POLISHAFTERNODE" => 2128, -"CPX_PARAM_POLISHAFTERINTSOL" => 2129, -"CPX_PARAM_POLISHAFTERTIME" => 2130, -"CPX_PARAM_MCFCUTS" => 2134, -"CPX_PARAM_MIPKAPPASTATS" => 2137, -"CPX_PARAM_AUXROOTTHREADS" => 2139, -"CPX_PARAM_INTSOLFILEPREFIX" => 2143, -"CPX_PARAM_PROBEDETTIME" => 2150, -"CPX_PARAM_POLISHAFTERDETTIME" => 2151, -"CPX_PARAM_LANDPCUTS" => 2152, -"CPX_PARAM_RAMPUPDURATION" => 2163, -"CPX_PARAM_RAMPUPDETTILIM" => 2164, -"CPX_PARAM_RAMPUPTILIM" => 2165, -"CPX_PARAM_LOCALIMPLBD" => 2181, -"CPX_PARAM_BQPCUTS" => 2195, -"CPX_PARAM_RLTCUTS" => 2196, -"CPX_PARAM_SUBMIPSTARTALG" => 2205, -"CPX_PARAM_SUBMIPSUBALG" => 2206, -"CPX_PARAM_SUBMIPSCAIND" => 2207, -"CPX_PARAM_SUBMIPNODELIMIT" => 2212, -"CPX_PARAM_BAREPCOMP" => 3002, -"CPX_PARAM_BARGROWTH" => 3003, -"CPX_PARAM_BAROBJRNG" => 3004, -"CPX_PARAM_BARALG" => 3007, -"CPX_PARAM_BARCOLNZ" => 3009, -"CPX_PARAM_BARDISPLAY" => 3010, -"CPX_PARAM_BARITLIM" => 3012, -"CPX_PARAM_BARMAXCOR" => 3013, -"CPX_PARAM_BARORDER" => 3014, -"CPX_PARAM_BARSTARTALG" => 3017, -"CPX_PARAM_BARCROSSALG" => 3018, -"CPX_PARAM_BARQCPEPCOMP" => 3020, -"CPX_PARAM_QPNZREADLIM" => 4001, -"CPX_PARAM_CALCQCPDUALS" => 4003, -"CPX_PARAM_QPMAKEPSDIND" => 4010, -"CPX_PARAM_QTOLININD" => 4012, -"CPX_PARAM_NETITLIM" => 5001, -"CPX_PARAM_NETEPOPT" => 5002, -"CPX_PARAM_NETEPRHS" => 5003, -"CPX_PARAM_NETPPRIIND" => 5004, -"CPX_PARAM_NETDISPLAY" => 5005, -) diff --git a/src/cpx_params_1280.jl b/src/cpx_params_1280.jl deleted file mode 100644 index d9b4d766..00000000 --- a/src/cpx_params_1280.jl +++ /dev/null @@ -1,368 +0,0 @@ -# grep "#define" cpxconst.h | grep "CPX_PARAM_|CPXPARAM" | awk '{ printf("\"%s\" => %s,\n",$2,$3) }' -const paramName2Indx = Dict( -"CPX_PARAM_ADVIND" => 1001, -"CPX_PARAM_AGGFILL" => 1002, -"CPX_PARAM_AGGIND" => 1003, -"CPX_PARAM_CLOCKTYPE" => 1006, -"CPX_PARAM_CRAIND" => 1007, -"CPX_PARAM_DEPIND" => 1008, -"CPX_PARAM_DPRIIND" => 1009, -"CPX_PARAM_PRICELIM" => 1010, -"CPX_PARAM_EPMRK" => 1013, -"CPX_PARAM_EPOPT" => 1014, -"CPX_PARAM_EPPER" => 1015, -"CPX_PARAM_EPRHS" => 1016, -"CPX_PARAM_SIMDISPLAY" => 1019, -"CPX_PARAM_ITLIM" => 1020, -"CPX_PARAM_ROWREADLIM" => 1021, -"CPX_PARAM_NETFIND" => 1022, -"CPX_PARAM_COLREADLIM" => 1023, -"CPX_PARAM_NZREADLIM" => 1024, -"CPX_PARAM_OBJLLIM" => 1025, -"CPX_PARAM_OBJULIM" => 1026, -"CPX_PARAM_PERIND" => 1027, -"CPX_PARAM_PERLIM" => 1028, -"CPX_PARAM_PPRIIND" => 1029, -"CPX_PARAM_PREIND" => 1030, -"CPX_PARAM_REINV" => 1031, -"CPX_PARAM_SCAIND" => 1034, -"CPX_PARAM_SCRIND" => 1035, -"CPX_PARAM_SINGLIM" => 1037, -"CPX_PARAM_TILIM" => 1039, -"CPX_PARAM_PREDUAL" => 1044, -"CPX_PARAM_PREPASS" => 1052, -"CPX_PARAM_DATACHECK" => 1056, -"CPX_PARAM_REDUCE" => 1057, -"CPX_PARAM_PRELINEAR" => 1058, -"CPX_PARAM_LPMETHOD" => 1062, -"CPX_PARAM_QPMETHOD" => 1063, -"CPX_PARAM_WORKDIR" => 1064, -"CPX_PARAM_WORKMEM" => 1065, -"CPX_PARAM_THREADS" => 1067, -"CPX_PARAM_CONFLICTALG" => 1073, -"CPX_PARAM_CONFLICTDISPLAY" => 1074, -"CPX_PARAM_SIFTDISPLAY" => 1076, -"CPX_PARAM_SIFTALG" => 1077, -"CPX_PARAM_SIFTITLIM" => 1078, -"CPX_PARAM_MPSLONGNUM" => 1081, -"CPX_PARAM_MEMORYEMPHASIS" => 1082, -"CPX_PARAM_NUMERICALEMPHASIS" => 1083, -"CPX_PARAM_FEASOPTMODE" => 1084, -"CPX_PARAM_PARALLELMODE" => 1109, -"CPX_PARAM_TUNINGMEASURE" => 1110, -"CPX_PARAM_TUNINGREPEAT" => 1111, -"CPX_PARAM_TUNINGTILIM" => 1112, -"CPX_PARAM_TUNINGDISPLAY" => 1113, -"CPX_PARAM_WRITELEVEL" => 1114, -"CPX_PARAM_RANDOMSEED" => 1124, -"CPX_PARAM_DETTILIM" => 1127, -"CPX_PARAM_FILEENCODING" => 1129, -"CPX_PARAM_APIENCODING" => 1130, -"CPX_PARAM_OPTIMALITYTARGET" => 1131, -"CPX_PARAM_CLONELOG" => 1132, -"CPX_PARAM_TUNINGDETTILIM" => 1139, -"CPX_PARAM_CPUMASK" => 1144, -"CPX_PARAM_SOLUTIONTYPE" => 1147, -"CPX_PARAM_SIFTSIM" => 1158, -"CPX_PARAM_DYNAMICROWS" => 1161, -"CPX_PARAM_RECORD" => 1162, -"CPX_PARAM_PARAMDISPLAY" => 1163, -"CPX_PARAM_WORKERALG" => 1500, -"CPX_PARAM_BENDERSSTRATEGY" => 1501, -"CPX_PARAM_BENDERSFEASCUTTOL" => 1509, -"CPX_PARAM_BENDERSOPTCUTTOL" => 1510, -"CPX_PARAM_BRDIR" => 2001, -"CPX_PARAM_BTTOL" => 2002, -"CPX_PARAM_CLIQUES" => 2003, -"CPX_PARAM_COEREDIND" => 2004, -"CPX_PARAM_COVERS" => 2005, -"CPX_PARAM_CUTLO" => 2006, -"CPX_PARAM_CUTUP" => 2007, -"CPX_PARAM_EPAGAP" => 2008, -"CPX_PARAM_EPGAP" => 2009, -"CPX_PARAM_EPINT" => 2010, -"CPX_PARAM_MIPDISPLAY" => 2012, -"CPX_PARAM_MIPINTERVAL" => 2013, -"CPX_PARAM_INTSOLLIM" => 2015, -"CPX_PARAM_NODEFILEIND" => 2016, -"CPX_PARAM_NODELIM" => 2017, -"CPX_PARAM_NODESEL" => 2018, -"CPX_PARAM_OBJDIF" => 2019, -"CPX_PARAM_MIPORDIND" => 2020, -"CPX_PARAM_RELOBJDIF" => 2022, -"CPX_PARAM_STARTALG" => 2025, -"CPX_PARAM_SUBALG" => 2026, -"CPX_PARAM_TRELIM" => 2027, -"CPX_PARAM_VARSEL" => 2028, -"CPX_PARAM_BNDSTRENIND" => 2029, -"CPX_PARAM_HEURFREQ" => 2031, -"CPX_PARAM_MIPORDTYPE" => 2032, -"CPX_PARAM_CUTSFACTOR" => 2033, -"CPX_PARAM_RELAXPREIND" => 2034, -"CPX_PARAM_PRESLVND" => 2037, -"CPX_PARAM_BBINTERVAL" => 2039, -"CPX_PARAM_FLOWCOVERS" => 2040, -"CPX_PARAM_IMPLBD" => 2041, -"CPX_PARAM_PROBE" => 2042, -"CPX_PARAM_GUBCOVERS" => 2044, -"CPX_PARAM_STRONGCANDLIM" => 2045, -"CPX_PARAM_STRONGITLIM" => 2046, -"CPX_PARAM_FRACCAND" => 2048, -"CPX_PARAM_FRACCUTS" => 2049, -"CPX_PARAM_FRACPASS" => 2050, -"CPX_PARAM_FLOWPATHS" => 2051, -"CPX_PARAM_MIRCUTS" => 2052, -"CPX_PARAM_DISJCUTS" => 2053, -"CPX_PARAM_AGGCUTLIM" => 2054, -"CPX_PARAM_MIPCBREDLP" => 2055, -"CPX_PARAM_CUTPASS" => 2056, -"CPX_PARAM_MIPEMPHASIS" => 2058, -"CPX_PARAM_SYMMETRY" => 2059, -"CPX_PARAM_DIVETYPE" => 2060, -"CPX_PARAM_RINSHEUR" => 2061, -"CPX_PARAM_SUBMIPNODELIM" => 2062, -"CPX_PARAM_LBHEUR" => 2063, -"CPX_PARAM_REPEATPRESOLVE" => 2064, -"CPX_PARAM_PROBETIME" => 2065, -"CPX_PARAM_POLISHTIME" => 2066, -"CPX_PARAM_REPAIRTRIES" => 2067, -"CPX_PARAM_EPLIN" => 2068, -"CPX_PARAM_EPRELAX" => 2073, -"CPX_PARAM_FPHEUR" => 2098, -"CPX_PARAM_EACHCUTLIM" => 2102, -"CPX_PARAM_SOLNPOOLCAPACITY" => 2103, -"CPX_PARAM_SOLNPOOLREPLACE" => 2104, -"CPX_PARAM_SOLNPOOLGAP" => 2105, -"CPX_PARAM_SOLNPOOLAGAP" => 2106, -"CPX_PARAM_SOLNPOOLINTENSITY" => 2107, -"CPX_PARAM_POPULATELIM" => 2108, -"CPX_PARAM_MIPSEARCH" => 2109, -"CPX_PARAM_MIQCPSTRAT" => 2110, -"CPX_PARAM_ZEROHALFCUTS" => 2111, -"CPX_PARAM_POLISHAFTEREPAGAP" => 2126, -"CPX_PARAM_POLISHAFTEREPGAP" => 2127, -"CPX_PARAM_POLISHAFTERNODE" => 2128, -"CPX_PARAM_POLISHAFTERINTSOL" => 2129, -"CPX_PARAM_POLISHAFTERTIME" => 2130, -"CPX_PARAM_MCFCUTS" => 2134, -"CPX_PARAM_MIPKAPPASTATS" => 2137, -"CPX_PARAM_AUXROOTTHREADS" => 2139, -"CPX_PARAM_INTSOLFILEPREFIX" => 2143, -"CPX_PARAM_PROBEDETTIME" => 2150, -"CPX_PARAM_POLISHAFTERDETTIME" => 2151, -"CPX_PARAM_LANDPCUTS" => 2152, -"CPX_PARAM_RAMPUPDURATION" => 2163, -"CPX_PARAM_RAMPUPDETTILIM" => 2164, -"CPX_PARAM_RAMPUPTILIM" => 2165, -"CPX_PARAM_LOCALIMPLBD" => 2181, -"CPX_PARAM_BQPCUTS" => 2195, -"CPX_PARAM_RLTCUTS" => 2196, -"CPX_PARAM_SUBMIPSTARTALG" => 2205, -"CPX_PARAM_SUBMIPSUBALG" => 2206, -"CPX_PARAM_SUBMIPSCAIND" => 2207, -"CPX_PARAM_SUBMIPNODELIMIT" => 2212, -"CPX_PARAM_BAREPCOMP" => 3002, -"CPX_PARAM_BARGROWTH" => 3003, -"CPX_PARAM_BAROBJRNG" => 3004, -"CPX_PARAM_BARALG" => 3007, -"CPX_PARAM_BARCOLNZ" => 3009, -"CPX_PARAM_BARDISPLAY" => 3010, -"CPX_PARAM_BARITLIM" => 3012, -"CPX_PARAM_BARMAXCOR" => 3013, -"CPX_PARAM_BARORDER" => 3014, -"CPX_PARAM_BARSTARTALG" => 3017, -"CPX_PARAM_BARCROSSALG" => 3018, -"CPX_PARAM_BARQCPEPCOMP" => 3020, -"CPX_PARAM_QPNZREADLIM" => 4001, -"CPX_PARAM_CALCQCPDUALS" => 4003, -"CPX_PARAM_QPMAKEPSDIND" => 4010, -"CPX_PARAM_QTOLININD" => 4012, -"CPX_PARAM_NETITLIM" => 5001, -"CPX_PARAM_NETEPOPT" => 5002, -"CPX_PARAM_NETEPRHS" => 5003, -"CPX_PARAM_NETPPRIIND" => 5004, -"CPX_PARAM_NETDISPLAY" => 5005, -"CPXPARAM_H" => 1, -"CPXPARAM_Advance" => 1001, -"CPXPARAM_Barrier_Algorithm" => 3007, -"CPXPARAM_Barrier_ColNonzeros" => 3009, -"CPXPARAM_Barrier_ConvergeTol" => 3002, -"CPXPARAM_Barrier_Crossover" => 3018, -"CPXPARAM_Barrier_Display" => 3010, -"CPXPARAM_Barrier_Limits_Corrections" => 3013, -"CPXPARAM_Barrier_Limits_Growth" => 3003, -"CPXPARAM_Barrier_Limits_Iteration" => 3012, -"CPXPARAM_Barrier_Limits_ObjRange" => 3004, -"CPXPARAM_Barrier_Ordering" => 3014, -"CPXPARAM_Barrier_QCPConvergeTol" => 3020, -"CPXPARAM_Barrier_StartAlg" => 3017, -"CPXPARAM_Benders_Strategy" => 1501, -"CPXPARAM_Benders_Tolerances_feasibilitycut" => 1509, -"CPXPARAM_Benders_Tolerances_optimalitycut" => 1510, -"CPXPARAM_Benders_WorkerAlgorithm" => 1500, -"CPXPARAM_ClockType" => 1006, -"CPXPARAM_Conflict_Algorithm" => 1073, -"CPXPARAM_Conflict_Display" => 1074, -"CPXPARAM_CPUmask" => 1144, -"CPXPARAM_DetTimeLimit" => 1127, -"CPXPARAM_DistMIP_Rampup_DetTimeLimit" => 2164, -"CPXPARAM_DistMIP_Rampup_Duration" => 2163, -"CPXPARAM_DistMIP_Rampup_TimeLimit" => 2165, -"CPXPARAM_Emphasis_Memory" => 1082, -"CPXPARAM_Emphasis_MIP" => 2058, -"CPXPARAM_Emphasis_Numerical" => 1083, -"CPXPARAM_Feasopt_Mode" => 1084, -"CPXPARAM_Feasopt_Tolerance" => 2073, -"CPXPARAM_LPMethod" => 1062, -"CPXPARAM_MIP_Cuts_BQP" => 2195, -"CPXPARAM_MIP_Cuts_Cliques" => 2003, -"CPXPARAM_MIP_Cuts_Covers" => 2005, -"CPXPARAM_MIP_Cuts_Disjunctive" => 2053, -"CPXPARAM_MIP_Cuts_FlowCovers" => 2040, -"CPXPARAM_MIP_Cuts_Gomory" => 2049, -"CPXPARAM_MIP_Cuts_GUBCovers" => 2044, -"CPXPARAM_MIP_Cuts_Implied" => 2041, -"CPXPARAM_MIP_Cuts_LiftProj" => 2152, -"CPXPARAM_MIP_Cuts_LocalImplied" => 2181, -"CPXPARAM_MIP_Cuts_MCFCut" => 2134, -"CPXPARAM_MIP_Cuts_MIRCut" => 2052, -"CPXPARAM_MIP_Cuts_PathCut" => 2051, -"CPXPARAM_MIP_Cuts_RLT" => 2196, -"CPXPARAM_MIP_Cuts_ZeroHalfCut" => 2111, -"CPXPARAM_MIP_Display" => 2012, -"CPXPARAM_MIP_Interval" => 2013, -"CPXPARAM_MIP_Limits_AggForCut" => 2054, -"CPXPARAM_MIP_Limits_AuxRootThreads" => 2139, -"CPXPARAM_MIP_Limits_CutPasses" => 2056, -"CPXPARAM_MIP_Limits_CutsFactor" => 2033, -"CPXPARAM_MIP_Limits_EachCutLimit" => 2102, -"CPXPARAM_MIP_Limits_GomoryCand" => 2048, -"CPXPARAM_MIP_Limits_GomoryPass" => 2050, -"CPXPARAM_MIP_Limits_Nodes" => 2017, -"CPXPARAM_MIP_Limits_PolishTime" => 2066, -"CPXPARAM_MIP_Limits_Populate" => 2108, -"CPXPARAM_MIP_Limits_ProbeDetTime" => 2150, -"CPXPARAM_MIP_Limits_ProbeTime" => 2065, -"CPXPARAM_MIP_Limits_RepairTries" => 2067, -"CPXPARAM_MIP_Limits_Solutions" => 2015, -"CPXPARAM_MIP_Limits_StrongCand" => 2045, -"CPXPARAM_MIP_Limits_StrongIt" => 2046, -"CPXPARAM_MIP_Limits_SubMIPNodeLim" => 2062, -"CPXPARAM_MIP_Limits_TreeMemory" => 2027, -"CPXPARAM_MIP_OrderType" => 2032, -"CPXPARAM_MIP_PolishAfter_AbsMIPGap" => 2126, -"CPXPARAM_MIP_PolishAfter_DetTime" => 2151, -"CPXPARAM_MIP_PolishAfter_MIPGap" => 2127, -"CPXPARAM_MIP_PolishAfter_Nodes" => 2128, -"CPXPARAM_MIP_PolishAfter_Solutions" => 2129, -"CPXPARAM_MIP_PolishAfter_Time" => 2130, -"CPXPARAM_MIP_Pool_AbsGap" => 2106, -"CPXPARAM_MIP_Pool_Capacity" => 2103, -"CPXPARAM_MIP_Pool_Intensity" => 2107, -"CPXPARAM_MIP_Pool_RelGap" => 2105, -"CPXPARAM_MIP_Pool_Replace" => 2104, -"CPXPARAM_MIP_SubMIP_StartAlg" => 2205, -"CPXPARAM_MIP_SubMIP_SubAlg" => 2206, -"CPXPARAM_MIP_SubMIP_NodeLimit" => 2212, -"CPXPARAM_MIP_SubMIP_Scale" => 2207, -"CPXPARAM_MIP_Strategy_Backtrack" => 2002, -"CPXPARAM_MIP_Strategy_BBInterval" => 2039, -"CPXPARAM_MIP_Strategy_Branch" => 2001, -"CPXPARAM_MIP_Strategy_CallbackReducedLP" => 2055, -"CPXPARAM_MIP_Strategy_Dive" => 2060, -"CPXPARAM_MIP_Strategy_File" => 2016, -"CPXPARAM_MIP_Strategy_FPHeur" => 2098, -"CPXPARAM_MIP_Strategy_HeuristicFreq" => 2031, -"CPXPARAM_MIP_Strategy_KappaStats" => 2137, -"CPXPARAM_MIP_Strategy_LBHeur" => 2063, -"CPXPARAM_MIP_Strategy_MIQCPStrat" => 2110, -"CPXPARAM_MIP_Strategy_NodeSelect" => 2018, -"CPXPARAM_MIP_Strategy_Order" => 2020, -"CPXPARAM_MIP_Strategy_PresolveNode" => 2037, -"CPXPARAM_MIP_Strategy_Probe" => 2042, -"CPXPARAM_MIP_Strategy_RINSHeur" => 2061, -"CPXPARAM_MIP_Strategy_Search" => 2109, -"CPXPARAM_MIP_Strategy_StartAlgorithm" => 2025, -"CPXPARAM_MIP_Strategy_SubAlgorithm" => 2026, -"CPXPARAM_MIP_Strategy_VariableSelect" => 2028, -"CPXPARAM_MIP_Tolerances_AbsMIPGap" => 2008, -"CPXPARAM_MIP_Tolerances_Linearization" => 2068, -"CPXPARAM_MIP_Tolerances_Integrality" => 2010, -"CPXPARAM_MIP_Tolerances_LowerCutoff" => 2006, -"CPXPARAM_MIP_Tolerances_MIPGap" => 2009, -"CPXPARAM_MIP_Tolerances_ObjDifference" => 2019, -"CPXPARAM_MIP_Tolerances_RelObjDifference" => 2022, -"CPXPARAM_MIP_Tolerances_UpperCutoff" => 2007, -"CPXPARAM_Network_Display" => 5005, -"CPXPARAM_Network_Iterations" => 5001, -"CPXPARAM_Network_NetFind" => 1022, -"CPXPARAM_Network_Pricing" => 5004, -"CPXPARAM_Network_Tolerances_Feasibility" => 5003, -"CPXPARAM_Network_Tolerances_Optimality" => 5002, -"CPXPARAM_OptimalityTarget" => 1131, -"CPXPARAM_Output_CloneLog" => 1132, -"CPXPARAM_Output_IntSolFilePrefix" => 2143, -"CPXPARAM_Output_MPSLong" => 1081, -"CPXPARAM_Output_WriteLevel" => 1114, -"CPXPARAM_Parallel" => 1109, -"CPXPARAM_ParamDisplay" => 1163, -"CPXPARAM_Preprocessing_Aggregator" => 1003, -"CPXPARAM_Preprocessing_BoundStrength" => 2029, -"CPXPARAM_Preprocessing_CoeffReduce" => 2004, -"CPXPARAM_Preprocessing_Dependency" => 1008, -"CPXPARAM_Preprocessing_Dual" => 1044, -"CPXPARAM_Preprocessing_Fill" => 1002, -"CPXPARAM_Preprocessing_Linear" => 1058, -"CPXPARAM_Preprocessing_NumPass" => 1052, -"CPXPARAM_Preprocessing_Presolve" => 1030, -"CPXPARAM_Preprocessing_QCPDuals" => 4003, -"CPXPARAM_Preprocessing_QPMakePSD" => 4010, -"CPXPARAM_Preprocessing_QToLin" => 4012, -"CPXPARAM_Preprocessing_Reduce" => 1057, -"CPXPARAM_Preprocessing_Relax" => 2034, -"CPXPARAM_Preprocessing_RepeatPresolve" => 2064, -"CPXPARAM_Preprocessing_Symmetry" => 2059, -"CPXPARAM_QPMethod" => 1063, -"CPXPARAM_RandomSeed" => 1124, -"CPXPARAM_Read_APIEncoding" => 1130, -"CPXPARAM_Read_Constraints" => 1021, -"CPXPARAM_Read_DataCheck" => 1056, -"CPXPARAM_Read_FileEncoding" => 1129, -"CPXPARAM_Read_Nonzeros" => 1024, -"CPXPARAM_Read_QPNonzeros" => 4001, -"CPXPARAM_Read_Scale" => 1034, -"CPXPARAM_Read_Variables" => 1023, -"CPXPARAM_Record" => 1162, -"CPXPARAM_ScreenOutput" => 1035, -"CPXPARAM_Sifting_Algorithm" => 1077, -"CPXPARAM_Sifting_Simplex" => 1158, -"CPXPARAM_Sifting_Display" => 1076, -"CPXPARAM_Sifting_Iterations" => 1078, -"CPXPARAM_Simplex_Crash" => 1007, -"CPXPARAM_Simplex_DGradient" => 1009, -"CPXPARAM_Simplex_Display" => 1019, -"CPXPARAM_Simplex_DynamicRows" => 1161, -"CPXPARAM_Simplex_Limits_Iterations" => 1020, -"CPXPARAM_Simplex_Limits_LowerObj" => 1025, -"CPXPARAM_Simplex_Limits_Perturbation" => 1028, -"CPXPARAM_Simplex_Limits_Singularity" => 1037, -"CPXPARAM_Simplex_Limits_UpperObj" => 1026, -"CPXPARAM_Simplex_Perturbation_Constant" => 1015, -"CPXPARAM_Simplex_Perturbation_Indicator" => 1027, -"CPXPARAM_Simplex_PGradient" => 1029, -"CPXPARAM_Simplex_Pricing" => 1010, -"CPXPARAM_Simplex_Refactor" => 1031, -"CPXPARAM_Simplex_Tolerances_Feasibility" => 1016, -"CPXPARAM_Simplex_Tolerances_Markowitz" => 1013, -"CPXPARAM_Simplex_Tolerances_Optimality" => 1014, -"CPXPARAM_SolutionType" => 1147, -"CPXPARAM_Threads" => 1067, -"CPXPARAM_TimeLimit" => 1039, -"CPXPARAM_Tune_DetTimeLimit" => 1139, -"CPXPARAM_Tune_Display" => 1113, -"CPXPARAM_Tune_Measure" => 1110, -"CPXPARAM_Tune_Repeat" => 1111, -"CPXPARAM_Tune_TimeLimit" => 1112, -"CPXPARAM_WorkDir" => 1064, -"CPXPARAM_WorkMem" => 1065, -) diff --git a/src/cpx_params_1290.jl b/src/cpx_params_1290.jl deleted file mode 100644 index 4dd487f3..00000000 --- a/src/cpx_params_1290.jl +++ /dev/null @@ -1,378 +0,0 @@ -# grep "#define" cpxconst.h | grep "CPX_PARAM_|CPXPARAM" | awk '{ printf("\"%s\" => %s,\n",$2,$3) }' -const paramName2Indx = Dict( -"CPX_AUTO_SOLN" => 0, -"CPX_BASIC_SOLN" => 1, -"CPX_NONBASIC_SOLN" => 2, -"CPX_PRIMAL_SOLN" => 3, -"CPX_PARAM_ALL_MIN" => 1000, -"CPX_PARAM_ALL_MAX" => 6000, -"CPXPARAM_H" => 1, -"CPXPARAM_Advance" => 1001, -"CPXPARAM_Barrier_Algorithm" => 3007, -"CPXPARAM_Barrier_ColNonzeros" => 3009, -"CPXPARAM_Barrier_ConvergeTol" => 3002, -"CPXPARAM_Barrier_Crossover" => 3018, -"CPXPARAM_Barrier_Display" => 3010, -"CPXPARAM_Barrier_Limits_Corrections" => 3013, -"CPXPARAM_Barrier_Limits_Growth" => 3003, -"CPXPARAM_Barrier_Limits_Iteration" => 3012, -"CPXPARAM_Barrier_Limits_ObjRange" => 3004, -"CPXPARAM_Barrier_Ordering" => 3014, -"CPXPARAM_Barrier_QCPConvergeTol" => 3020, -"CPXPARAM_Barrier_StartAlg" => 3017, -"CPXPARAM_Benders_Strategy" => 1501, -"CPXPARAM_Benders_Tolerances_feasibilitycut" => 1509, -"CPXPARAM_Benders_Tolerances_optimalitycut" => 1510, -"CPXPARAM_Benders_WorkerAlgorithm" => 1500, -"CPXPARAM_ClockType" => 1006, -"CPXPARAM_Conflict_Algorithm" => 1073, -"CPXPARAM_Conflict_Display" => 1074, -"CPXPARAM_CPUmask" => 1144, -"CPXPARAM_DetTimeLimit" => 1127, -"CPXPARAM_DistMIP_Rampup_DetTimeLimit" => 2164, -"CPXPARAM_DistMIP_Rampup_Duration" => 2163, -"CPXPARAM_DistMIP_Rampup_TimeLimit" => 2165, -"CPXPARAM_Emphasis_Memory" => 1082, -"CPXPARAM_Emphasis_MIP" => 2058, -"CPXPARAM_Emphasis_Numerical" => 1083, -"CPXPARAM_Feasopt_Mode" => 1084, -"CPXPARAM_Feasopt_Tolerance" => 2073, -"CPXPARAM_LPMethod" => 1062, -"CPXPARAM_MIP_Cuts_BQP" => 2195, -"CPXPARAM_MIP_Cuts_Cliques" => 2003, -"CPXPARAM_MIP_Cuts_Covers" => 2005, -"CPXPARAM_MIP_Cuts_Disjunctive" => 2053, -"CPXPARAM_MIP_Cuts_FlowCovers" => 2040, -"CPXPARAM_MIP_Cuts_Gomory" => 2049, -"CPXPARAM_MIP_Cuts_GUBCovers" => 2044, -"CPXPARAM_MIP_Cuts_Implied" => 2041, -"CPXPARAM_MIP_Cuts_LiftProj" => 2152, -"CPXPARAM_MIP_Cuts_LocalImplied" => 2181, -"CPXPARAM_MIP_Cuts_MCFCut" => 2134, -"CPXPARAM_MIP_Cuts_MIRCut" => 2052, -"CPXPARAM_MIP_Cuts_PathCut" => 2051, -"CPXPARAM_MIP_Cuts_RLT" => 2196, -"CPXPARAM_MIP_Cuts_ZeroHalfCut" => 2111, -"CPXPARAM_MIP_Display" => 2012, -"CPXPARAM_MIP_Interval" => 2013, -"CPXPARAM_MIP_Limits_AggForCut" => 2054, -"CPXPARAM_MIP_Limits_AuxRootThreads" => 2139, -"CPXPARAM_MIP_Limits_CutPasses" => 2056, -"CPXPARAM_MIP_Limits_CutsFactor" => 2033, -"CPXPARAM_MIP_Limits_EachCutLimit" => 2102, -"CPXPARAM_MIP_Limits_GomoryCand" => 2048, -"CPXPARAM_MIP_Limits_GomoryPass" => 2050, -"CPXPARAM_MIP_Limits_Nodes" => 2017, -"CPXPARAM_MIP_Limits_PolishTime" => 2066, -"CPXPARAM_MIP_Limits_Populate" => 2108, -"CPXPARAM_MIP_Limits_ProbeDetTime" => 2150, -"CPXPARAM_MIP_Limits_ProbeTime" => 2065, -"CPXPARAM_MIP_Limits_RepairTries" => 2067, -"CPXPARAM_MIP_Limits_Solutions" => 2015, -"CPXPARAM_MIP_Limits_StrongCand" => 2045, -"CPXPARAM_MIP_Limits_StrongIt" => 2046, -"CPXPARAM_MIP_Limits_TreeMemory" => 2027, -"CPXPARAM_MIP_OrderType" => 2032, -"CPXPARAM_MIP_PolishAfter_AbsMIPGap" => 2126, -"CPXPARAM_MIP_PolishAfter_DetTime" => 2151, -"CPXPARAM_MIP_PolishAfter_MIPGap" => 2127, -"CPXPARAM_MIP_PolishAfter_Nodes" => 2128, -"CPXPARAM_MIP_PolishAfter_Solutions" => 2129, -"CPXPARAM_MIP_PolishAfter_Time" => 2130, -"CPXPARAM_MIP_Pool_AbsGap" => 2106, -"CPXPARAM_MIP_Pool_Capacity" => 2103, -"CPXPARAM_MIP_Pool_Intensity" => 2107, -"CPXPARAM_MIP_Pool_RelGap" => 2105, -"CPXPARAM_MIP_Pool_Replace" => 2104, -"CPXPARAM_MIP_Strategy_Backtrack" => 2002, -"CPXPARAM_MIP_Strategy_BBInterval" => 2039, -"CPXPARAM_MIP_Strategy_Branch" => 2001, -"CPXPARAM_MIP_Strategy_CallbackReducedLP" => 2055, -"CPXPARAM_MIP_Strategy_Dive" => 2060, -"CPXPARAM_MIP_Strategy_File" => 2016, -"CPXPARAM_MIP_Strategy_FPHeur" => 2098, -"CPXPARAM_MIP_Strategy_HeuristicFreq" => 2031, -"CPXPARAM_MIP_Strategy_KappaStats" => 2137, -"CPXPARAM_MIP_Strategy_LBHeur" => 2063, -"CPXPARAM_MIP_Strategy_MIQCPStrat" => 2110, -"CPXPARAM_MIP_Strategy_NodeSelect" => 2018, -"CPXPARAM_MIP_Strategy_Order" => 2020, -"CPXPARAM_MIP_Strategy_PresolveNode" => 2037, -"CPXPARAM_MIP_Strategy_Probe" => 2042, -"CPXPARAM_MIP_Strategy_RINSHeur" => 2061, -"CPXPARAM_MIP_Strategy_Search" => 2109, -"CPXPARAM_MIP_Strategy_StartAlgorithm" => 2025, -"CPXPARAM_MIP_Strategy_SubAlgorithm" => 2026, -"CPXPARAM_MIP_Strategy_VariableSelect" => 2028, -"CPXPARAM_MIP_SubMIP_StartAlg" => 2205, -"CPXPARAM_MIP_SubMIP_SubAlg" => 2206, -"CPXPARAM_MIP_SubMIP_NodeLimit" => 2212, -"CPXPARAM_MIP_SubMIP_Scale" => 2207, -"CPXPARAM_MIP_Tolerances_AbsMIPGap" => 2008, -"CPXPARAM_MIP_Tolerances_Linearization" => 2068, -"CPXPARAM_MIP_Tolerances_Integrality" => 2010, -"CPXPARAM_MIP_Tolerances_LowerCutoff" => 2006, -"CPXPARAM_MIP_Tolerances_MIPGap" => 2009, -"CPXPARAM_MIP_Tolerances_ObjDifference" => 2019, -"CPXPARAM_MIP_Tolerances_RelObjDifference" => 2022, -"CPXPARAM_MIP_Tolerances_UpperCutoff" => 2007, -"CPXPARAM_MultiObjective_Display" => 1600, -"CPXPARAM_Network_Display" => 5005, -"CPXPARAM_Network_Iterations" => 5001, -"CPXPARAM_Network_NetFind" => 1022, -"CPXPARAM_Network_Pricing" => 5004, -"CPXPARAM_Network_Tolerances_Feasibility" => 5003, -"CPXPARAM_Network_Tolerances_Optimality" => 5002, -"CPXPARAM_OptimalityTarget" => 1131, -"CPXPARAM_Output_CloneLog" => 1132, -"CPXPARAM_Output_IntSolFilePrefix" => 2143, -"CPXPARAM_Output_MPSLong" => 1081, -"CPXPARAM_Output_WriteLevel" => 1114, -"CPXPARAM_Parallel" => 1109, -"CPXPARAM_ParamDisplay" => 1163, -"CPXPARAM_Preprocessing_Aggregator" => 1003, -"CPXPARAM_Preprocessing_BoundStrength" => 2029, -"CPXPARAM_Preprocessing_CoeffReduce" => 2004, -"CPXPARAM_Preprocessing_Dependency" => 1008, -"CPXPARAM_Preprocessing_Dual" => 1044, -"CPXPARAM_Preprocessing_Fill" => 1002, -"CPXPARAM_Preprocessing_Folding" => 1164, -"CPXPARAM_Preprocessing_Linear" => 1058, -"CPXPARAM_Preprocessing_NumPass" => 1052, -"CPXPARAM_Preprocessing_Presolve" => 1030, -"CPXPARAM_Preprocessing_QCPDuals" => 4003, -"CPXPARAM_Preprocessing_QPMakePSD" => 4010, -"CPXPARAM_Preprocessing_QToLin" => 4012, -"CPXPARAM_Preprocessing_Reduce" => 1057, -"CPXPARAM_Preprocessing_Relax" => 2034, -"CPXPARAM_Preprocessing_RepeatPresolve" => 2064, -"CPXPARAM_Preprocessing_Symmetry" => 2059, -"CPXPARAM_QPMethod" => 1063, -"CPXPARAM_RandomSeed" => 1124, -"CPXPARAM_Read_APIEncoding" => 1130, -"CPXPARAM_Read_Constraints" => 1021, -"CPXPARAM_Read_DataCheck" => 1056, -"CPXPARAM_Read_FileEncoding" => 1129, -"CPXPARAM_Read_Nonzeros" => 1024, -"CPXPARAM_Read_QPNonzeros" => 4001, -"CPXPARAM_Read_Scale" => 1034, -"CPXPARAM_Read_Variables" => 1023, -"CPXPARAM_Read_WarningLimit" => 1157, -"CPXPARAM_Record" => 1162, -"CPXPARAM_ScreenOutput" => 1035, -"CPXPARAM_Sifting_Algorithm" => 1077, -"CPXPARAM_Sifting_Simplex" => 1158, -"CPXPARAM_Sifting_Display" => 1076, -"CPXPARAM_Sifting_Iterations" => 1078, -"CPXPARAM_Simplex_Crash" => 1007, -"CPXPARAM_Simplex_DGradient" => 1009, -"CPXPARAM_Simplex_Display" => 1019, -"CPXPARAM_Simplex_DynamicRows" => 1161, -"CPXPARAM_Simplex_Limits_Iterations" => 1020, -"CPXPARAM_Simplex_Limits_LowerObj" => 1025, -"CPXPARAM_Simplex_Limits_Perturbation" => 1028, -"CPXPARAM_Simplex_Limits_Singularity" => 1037, -"CPXPARAM_Simplex_Limits_UpperObj" => 1026, -"CPXPARAM_Simplex_Perturbation_Constant" => 1015, -"CPXPARAM_Simplex_Perturbation_Indicator" => 1027, -"CPXPARAM_Simplex_PGradient" => 1029, -"CPXPARAM_Simplex_Pricing" => 1010, -"CPXPARAM_Simplex_Refactor" => 1031, -"CPXPARAM_Simplex_Tolerances_Feasibility" => 1016, -"CPXPARAM_Simplex_Tolerances_Markowitz" => 1013, -"CPXPARAM_Simplex_Tolerances_Optimality" => 1014, -"CPXPARAM_SolutionType" => 1147, -"CPXPARAM_Threads" => 1067, -"CPXPARAM_TimeLimit" => 1039, -"CPXPARAM_Tune_DetTimeLimit" => 1139, -"CPXPARAM_Tune_Display" => 1113, -"CPXPARAM_Tune_Measure" => 1110, -"CPXPARAM_Tune_Repeat" => 1111, -"CPXPARAM_Tune_TimeLimit" => 1112, -"CPXPARAM_WorkDir" => 1064, -"CPXPARAM_WorkMem" => 1065, -"CPX_PARAM_ADVIND" => 1001, -"CPX_PARAM_AGGFILL" => 1002, -"CPX_PARAM_AGGIND" => 1003, -"CPX_PARAM_CLOCKTYPE" => 1006, -"CPX_PARAM_CRAIND" => 1007, -"CPX_PARAM_DEPIND" => 1008, -"CPX_PARAM_DPRIIND" => 1009, -"CPX_PARAM_PRICELIM" => 1010, -"CPX_PARAM_EPMRK" => 1013, -"CPX_PARAM_EPOPT" => 1014, -"CPX_PARAM_EPPER" => 1015, -"CPX_PARAM_EPRHS" => 1016, -"CPX_PARAM_SIMDISPLAY" => 1019, -"CPX_PARAM_ITLIM" => 1020, -"CPX_PARAM_ROWREADLIM" => 1021, -"CPX_PARAM_NETFIND" => 1022, -"CPX_PARAM_COLREADLIM" => 1023, -"CPX_PARAM_NZREADLIM" => 1024, -"CPX_PARAM_OBJLLIM" => 1025, -"CPX_PARAM_OBJULIM" => 1026, -"CPX_PARAM_PERIND" => 1027, -"CPX_PARAM_PERLIM" => 1028, -"CPX_PARAM_PPRIIND" => 1029, -"CPX_PARAM_PREIND" => 1030, -"CPX_PARAM_REINV" => 1031, -"CPX_PARAM_SCAIND" => 1034, -"CPX_PARAM_SCRIND" => 1035, -"CPX_PARAM_SINGLIM" => 1037, -"CPX_PARAM_TILIM" => 1039, -"CPX_PARAM_PREDUAL" => 1044, -"CPX_PARAM_PREPASS" => 1052, -"CPX_PARAM_DATACHECK" => 1056, -"CPX_PARAM_REDUCE" => 1057, -"CPX_PARAM_PRELINEAR" => 1058, -"CPX_PARAM_LPMETHOD" => 1062, -"CPX_PARAM_QPMETHOD" => 1063, -"CPX_PARAM_WORKDIR" => 1064, -"CPX_PARAM_WORKMEM" => 1065, -"CPX_PARAM_THREADS" => 1067, -"CPX_PARAM_CONFLICTALG" => 1073, -"CPX_PARAM_CONFLICTDISPLAY" => 1074, -"CPX_PARAM_SIFTDISPLAY" => 1076, -"CPX_PARAM_SIFTALG" => 1077, -"CPX_PARAM_SIFTITLIM" => 1078, -"CPX_PARAM_MPSLONGNUM" => 1081, -"CPX_PARAM_MEMORYEMPHASIS" => 1082, -"CPX_PARAM_NUMERICALEMPHASIS" => 1083, -"CPX_PARAM_FEASOPTMODE" => 1084, -"CPX_PARAM_PARALLELMODE" => 1109, -"CPX_PARAM_TUNINGMEASURE" => 1110, -"CPX_PARAM_TUNINGREPEAT" => 1111, -"CPX_PARAM_TUNINGTILIM" => 1112, -"CPX_PARAM_TUNINGDISPLAY" => 1113, -"CPX_PARAM_WRITELEVEL" => 1114, -"CPX_PARAM_RANDOMSEED" => 1124, -"CPX_PARAM_DETTILIM" => 1127, -"CPX_PARAM_FILEENCODING" => 1129, -"CPX_PARAM_APIENCODING" => 1130, -"CPX_PARAM_OPTIMALITYTARGET" => 1131, -"CPX_PARAM_CLONELOG" => 1132, -"CPX_PARAM_TUNINGDETTILIM" => 1139, -"CPX_PARAM_CPUMASK" => 1144, -"CPX_PARAM_SOLUTIONTYPE" => 1147, -"CPX_PARAM_WARNLIM" => 1157, -"CPX_PARAM_SIFTSIM" => 1158, -"CPX_PARAM_DYNAMICROWS" => 1161, -"CPX_PARAM_RECORD" => 1162, -"CPX_PARAM_PARAMDISPLAY" => 1163, -"CPX_PARAM_FOLDING" => 1164, -"CPX_PARAM_WORKERALG" => 1500, -"CPX_PARAM_BENDERSSTRATEGY" => 1501, -"CPX_PARAM_BENDERSFEASCUTTOL" => 1509, -"CPX_PARAM_BENDERSOPTCUTTOL" => 1510, -"CPX_PARAM_MULTIOBJDISPLAY" => 1600, -"CPX_PARAM_BRDIR" => 2001, -"CPX_PARAM_BTTOL" => 2002, -"CPX_PARAM_CLIQUES" => 2003, -"CPX_PARAM_COEREDIND" => 2004, -"CPX_PARAM_COVERS" => 2005, -"CPX_PARAM_CUTLO" => 2006, -"CPX_PARAM_CUTUP" => 2007, -"CPX_PARAM_EPAGAP" => 2008, -"CPX_PARAM_EPGAP" => 2009, -"CPX_PARAM_EPINT" => 2010, -"CPX_PARAM_MIPDISPLAY" => 2012, -"CPX_PARAM_MIPINTERVAL" => 2013, -"CPX_PARAM_INTSOLLIM" => 2015, -"CPX_PARAM_NODEFILEIND" => 2016, -"CPX_PARAM_NODELIM" => 2017, -"CPX_PARAM_NODESEL" => 2018, -"CPX_PARAM_OBJDIF" => 2019, -"CPX_PARAM_MIPORDIND" => 2020, -"CPX_PARAM_RELOBJDIF" => 2022, -"CPX_PARAM_STARTALG" => 2025, -"CPX_PARAM_SUBALG" => 2026, -"CPX_PARAM_TRELIM" => 2027, -"CPX_PARAM_VARSEL" => 2028, -"CPX_PARAM_BNDSTRENIND" => 2029, -"CPX_PARAM_HEURFREQ" => 2031, -"CPX_PARAM_MIPORDTYPE" => 2032, -"CPX_PARAM_CUTSFACTOR" => 2033, -"CPX_PARAM_RELAXPREIND" => 2034, -"CPX_PARAM_PRESLVND" => 2037, -"CPX_PARAM_BBINTERVAL" => 2039, -"CPX_PARAM_FLOWCOVERS" => 2040, -"CPX_PARAM_IMPLBD" => 2041, -"CPX_PARAM_PROBE" => 2042, -"CPX_PARAM_GUBCOVERS" => 2044, -"CPX_PARAM_STRONGCANDLIM" => 2045, -"CPX_PARAM_STRONGITLIM" => 2046, -"CPX_PARAM_FRACCAND" => 2048, -"CPX_PARAM_FRACCUTS" => 2049, -"CPX_PARAM_FRACPASS" => 2050, -"CPX_PARAM_FLOWPATHS" => 2051, -"CPX_PARAM_MIRCUTS" => 2052, -"CPX_PARAM_DISJCUTS" => 2053, -"CPX_PARAM_AGGCUTLIM" => 2054, -"CPX_PARAM_MIPCBREDLP" => 2055, -"CPX_PARAM_CUTPASS" => 2056, -"CPX_PARAM_MIPEMPHASIS" => 2058, -"CPX_PARAM_SYMMETRY" => 2059, -"CPX_PARAM_DIVETYPE" => 2060, -"CPX_PARAM_RINSHEUR" => 2061, -"CPX_PARAM_LBHEUR" => 2063, -"CPX_PARAM_REPEATPRESOLVE" => 2064, -"CPX_PARAM_PROBETIME" => 2065, -"CPX_PARAM_POLISHTIME" => 2066, -"CPX_PARAM_REPAIRTRIES" => 2067, -"CPX_PARAM_EPLIN" => 2068, -"CPX_PARAM_EPRELAX" => 2073, -"CPX_PARAM_FPHEUR" => 2098, -"CPX_PARAM_EACHCUTLIM" => 2102, -"CPX_PARAM_SOLNPOOLCAPACITY" => 2103, -"CPX_PARAM_SOLNPOOLREPLACE" => 2104, -"CPX_PARAM_SOLNPOOLGAP" => 2105, -"CPX_PARAM_SOLNPOOLAGAP" => 2106, -"CPX_PARAM_SOLNPOOLINTENSITY" => 2107, -"CPX_PARAM_POPULATELIM" => 2108, -"CPX_PARAM_MIPSEARCH" => 2109, -"CPX_PARAM_MIQCPSTRAT" => 2110, -"CPX_PARAM_ZEROHALFCUTS" => 2111, -"CPX_PARAM_POLISHAFTEREPAGAP" => 2126, -"CPX_PARAM_POLISHAFTEREPGAP" => 2127, -"CPX_PARAM_POLISHAFTERNODE" => 2128, -"CPX_PARAM_POLISHAFTERINTSOL" => 2129, -"CPX_PARAM_POLISHAFTERTIME" => 2130, -"CPX_PARAM_MCFCUTS" => 2134, -"CPX_PARAM_MIPKAPPASTATS" => 2137, -"CPX_PARAM_AUXROOTTHREADS" => 2139, -"CPX_PARAM_INTSOLFILEPREFIX" => 2143, -"CPX_PARAM_PROBEDETTIME" => 2150, -"CPX_PARAM_POLISHAFTERDETTIME" => 2151, -"CPX_PARAM_LANDPCUTS" => 2152, -"CPX_PARAM_RAMPUPDURATION" => 2163, -"CPX_PARAM_RAMPUPDETTILIM" => 2164, -"CPX_PARAM_RAMPUPTILIM" => 2165, -"CPX_PARAM_LOCALIMPLBD" => 2181, -"CPX_PARAM_BQPCUTS" => 2195, -"CPX_PARAM_RLTCUTS" => 2196, -"CPX_PARAM_SUBMIPSTARTALG" => 2205, -"CPX_PARAM_SUBMIPSUBALG" => 2206, -"CPX_PARAM_SUBMIPSCAIND" => 2207, -"CPX_PARAM_SUBMIPNODELIMIT" => 2212, -"CPX_PARAM_BAREPCOMP" => 3002, -"CPX_PARAM_BARGROWTH" => 3003, -"CPX_PARAM_BAROBJRNG" => 3004, -"CPX_PARAM_BARALG" => 3007, -"CPX_PARAM_BARCOLNZ" => 3009, -"CPX_PARAM_BARDISPLAY" => 3010, -"CPX_PARAM_BARITLIM" => 3012, -"CPX_PARAM_BARMAXCOR" => 3013, -"CPX_PARAM_BARORDER" => 3014, -"CPX_PARAM_BARSTARTALG" => 3017, -"CPX_PARAM_BARCROSSALG" => 3018, -"CPX_PARAM_BARQCPEPCOMP" => 3020, -"CPX_PARAM_QPNZREADLIM" => 4001, -"CPX_PARAM_CALCQCPDUALS" => 4003, -"CPX_PARAM_QPMAKEPSDIND" => 4010, -"CPX_PARAM_QTOLININD" => 4012, -"CPX_PARAM_NETITLIM" => 5001, -"CPX_PARAM_NETEPOPT" => 5002, -"CPX_PARAM_NETEPRHS" => 5003, -"CPX_PARAM_NETPPRIIND" => 5004, -"CPX_PARAM_NETDISPLAY" => 5005, -) diff --git a/src/cpx_quad.jl b/src/cpx_quad.jl deleted file mode 100644 index 5056508d..00000000 --- a/src/cpx_quad.jl +++ /dev/null @@ -1,265 +0,0 @@ -# Quadratic terms & constraints -# - -function add_qpterms!(model::Model, qr::IVec, qc::IVec, qv::FVec) - n = num_var(model) - ((m = length(qr)) == length(qc) == length(qv)) || error("Inconsistent argument dimensions.") - nqv = copy(qv) - Q = sparse(qr, qc, nqv, n, n) - if istriu(Q) || istril(Q) || issymmetric(Q) - if VERSION >= v"0.7.0-DEV.3382" - diag_matrix = spdiagm(0 => diag(Q)) - else - diag_matrix = spdiagm(diag(Q)) - end - Q = Q + Q' - diag_matrix # reconstruct full matrix like CPLEX wants - else - error("Matrix Q must be either symmetric or triangular") - end - qmatcnt = Vector{Cint}(undef, n) - for k = 1:n - qmatcnt[k] = Q.colptr[k+1] - Q.colptr[k] - end - stat = @cpx_ccall(copyquad, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, convert(Array{Cint,1}, Q.colptr[1:end-1].-1), convert(Array{Cint,1},qmatcnt), convert(Array{Cint,1}, Q.rowval.-1), Q.nzval) - if stat != 0 - throw(CplexError(model.env, stat)) - end - model.has_qc = true - nothing -end - -function add_qpterms!(model::Model, qr::Vector, qc::Vector, qv::Vector) - add_qpterms!(model, ivec(qr), ivec(qc), fvec(qv)) -end - - -function add_qpterms!(model, H::SparseMatrixCSC{Float64}) # H must be symmetric - n = num_var(model) - (H.m == n && H.n == n) || error("H must be an n-by-n symmetric matrix.") - - nnz_h = nnz(H) - qr = Vector{Cint}(undef, nnz_h) - qc = Vector{Cint}(undef, nnz_h) - qv = Vector{Float64}(undef, nnz_h) - k = 0 - - colptr::Vector{Int} = H.colptr - nzval::Vector{Float64} = H.nzval - - for i = 1 : n - qi::Cint = convert(Cint, i) - for j = colptr[i]:(colptr[i+1]-1) - qj = convert(Cint, H.rowval[j]) - - if qi <= qj - k += 1 - qr[k] = qi - qc[k] = qj - qv[k] = nzval[j] - end - end - end - - add_qpterms!(model, qr[1:k], qc[1:k], qv[1:k]) -end - -function add_qpterms!(model, H::Matrix{Float64}) # H must be symmetric - n = num_var(model) - size(H) == (n, n) || error("H must be an n-by-n symmetric matrix.") - - nmax = div(n * (n + 1), 2) - qr = Vector{Cint}(undef, nmax) - qc = Vector{Cint}(undef, nmax) - qv = Vector{Float64}(undef, nmax) - k::Int = 0 - - for i = 1 : n - qi = convert(Cint, i) - for j = i : n - v = H[j, i] - if v != 0. - k += 1 - qr[k] = qi - qc[k] = convert(Cint, j) - qv[k] = v - end - end - end - - add_qpterms!(model, qr[1:k], qc[1:k], qv[1:k]) -end - -function add_diag_qpterms!(model, H::Vector) # H stores only the diagonal element - n = num_var(model) - n == length(H) || error("Incompatible dimensions.") - q = [convert(Cint,1):convert(Cint,n)] - add_qpterms!(model, q, q, fvec(h)) -end - -function add_diag_qpterms!(model, hv::Real) # all diagonal elements are H - n = num_var(model) - q = [convert(Cint,1):convert(Cint,n)] - add_qpterms!(model, q, q, fill(float64(hv), n)) -end - - -# add_qconstr! - -function add_qconstr!(model::Model, lind::IVec, lval::FVec, qr::IVec, qc::IVec, qv::FVec, rel::Cchar, rhs::Float64) - qnnz = length(qr) - qnnz == length(qc) == length(qv) || error("Inconsistent argument dimensions.") - - lnnz = length(lind) - lnnz == length(lval) || error("Inconsistent argument dimensions.") - - if qnnz > 0 || lnnz > 0 - stat = @cpx_ccall(addqconstr, Cint, ( - Ptr{Cvoid}, # env - Ptr{Cvoid}, # model - Cint, # lnnz - Cint, # qnnz - Float64, # rhs - Cchar, # sense - Ptr{Cint}, # lind - Ptr{Float64}, # lval - Ptr{Cint}, # qrow - Ptr{Cint}, # qcol - Ptr{Float64}, # qval - Ptr{UInt8} # name - ), - model.env.ptr, model.lp, lnnz, qnnz, rhs, rel, - lind .- Cint(1), lval, qr .- Cint(1), qc .- Cint(1), - qv, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - model.has_qc = true - end - nothing -end - -const sensemap = Dict('=' => 'E', '<' => 'L', '>' => 'G') -function add_qconstr!(model::Model, lind::Vector, lval::Vector, qr::Vector, qc::Vector, qv::Vector{Float64}, rel::GChars, rhs::Real) - add_qconstr!(model, ivec(lind), fvec(lval), ivec(qr), ivec(qc), fvec(qv), cchar(sensemap[rel]), float(rhs)) -end - -function num_qconstr(model::Model) - return @cpx_ccall(getnumqconstrs, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), - model.env.ptr, model.lp) -end - -function c_api_getqconstr(model::Model, row::Int) - # In the first call, we ask CPLEX how many non-zero elements there are in - # the affine (-linsurplus_p ) and quadratic (-quadsurplus_p) components. - rhs_p = Ref{Cdouble}() - sense_p = Ref{Cchar}() - linsurplus_p = Ref{Cint}() - quadsurplus_p = Ref{Cint}() - stat = @cpx_ccall( - getqconstr, - Cint, ( - Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cint}, Ptr{Cint}, Ptr{Float64}, Ptr{Cchar}, - Ptr{Cint}, Ptr{Float64}, Cint, Ptr{Cint}, - Ptr{Cint}, Ptr{Cint}, Ptr{Float64}, Cint, Ptr{Cint}, - Cint), - model.env.ptr, model.lp, - C_NULL, C_NULL, rhs_p, sense_p, - C_NULL, C_NULL, 0, linsurplus_p, - C_NULL, C_NULL, C_NULL, 0, quadsurplus_p, - Cint(row-1)) - # In the second call, we initialize arrays to contain the number of non-zero - # elements computed in the first part and then actually query the - # coefficients. - linspace = -linsurplus_p[] - quadspace = -quadsurplus_p[] - linind = fill(Cint(0), linspace) - linval = fill(Cdouble(0.0), linspace) - quadrow = fill(Cint(0), quadspace) - quadcol = fill(Cint(0), quadspace) - quadval = fill(Cdouble(0.0), quadspace) - linnzcnt_p = Ref{Cint}() - quadnzcnt_p = Ref{Cint}() - stat = @cpx_ccall( - getqconstr, - Cint, ( - Ptr{Cvoid}, Ptr{Cvoid}, - Ptr{Cint}, Ptr{Cint}, Ptr{Float64}, Ptr{Cchar}, - Ptr{Cint}, Ptr{Float64}, Cint, Ptr{Cint}, - Ptr{Cint}, Ptr{Cint}, Ptr{Float64}, Cint, Ptr{Cint}, - Cint), - model.env.ptr, model.lp, - linnzcnt_p, quadnzcnt_p, rhs_p, sense_p, - linind, linval, linspace, linsurplus_p, - quadrow, quadcol, quadval, quadspace, quadsurplus_p, - Cint(row-1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end - if quadsurplus_p[] < 0 || linsurplus_p[] < 0 - error("Unable to query quadratic constraint, there were more " * - "non-zero elements than expected.") - end - return linind, linval, quadrow, quadcol, quadval, sense_p[], rhs_p[] -end - -function c_api_getquad(model::Model) - num_variables = num_var(model) - # In the first call, we ask CPLEX how many non-zero elements there are. - surplus_p = Ref{Cint}() - stat = @cpx_ccall( - getquad, - Cint, ( - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cint}, - Ptr{Cint}, Ptr{Cint}, Ptr{Float64}, - Cint, Ptr{Cint}, Cint, Cint), - model.env.ptr, model.lp, C_NULL, - C_NULL, C_NULL, C_NULL, - 0, surplus_p, 0, num_variables - 1) - # In the second call, we initialize arrays to contain the number of - # non-zero elements computed in the first part and then actually query the - # coefficients. - nzcnt_p = Ref{Cint}() - qmatbeg = fill(Cint(0), num_variables) - qmatind = fill(Cint(0), -surplus_p[]) - qmatval = fill(0.0, -surplus_p[]) - stat = @cpx_ccall( - getquad, - Cint, ( - Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cint}, - Ptr{Cint}, Ptr{Cint}, Ptr{Float64}, - Cint, Ptr{Cint}, Cint, Cint), - model.env.ptr, model.lp, nzcnt_p, - qmatbeg, qmatind, qmatval, - -surplus_p[], surplus_p, 0, num_variables - 1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - if surplus_p[] < 0 || nzcnt_p[] != length(qmatind) - error("Unable to query quadratic constraint, there were more " * - "non-zero elements than expected.") - end - return qmatbeg, qmatind, qmatval -end - -# int CPXdelqconstrs( CPXCENVptr env, CPXLPptr lp, int begin, int end ) -function c_api_delqconstrs(model::Model, first::Cint, last::Cint) - stat = @cpx_ccall( - delqconstrs, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), - model.env.ptr, model.lp, first, last - ) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return -end diff --git a/src/cpx_solve.jl b/src/cpx_solve.jl deleted file mode 100644 index 2c761e1d..00000000 --- a/src/cpx_solve.jl +++ /dev/null @@ -1,398 +0,0 @@ -function optimize!(model::Model) - @assert is_valid(model.env) - stat = (if model.has_int - if VERSION < v"0.7.0-DEV.3382" - @cpx_ccall_intercept(model, mipopt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - else - @cpx_ccall(mipopt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - end - elseif model.has_qc - if VERSION < v"0.7.0-DEV.3382" - @cpx_ccall_intercept(model, qpopt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - else - @cpx_ccall(qpopt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - end - else - if VERSION < v"0.7.0-DEV.3382" - @cpx_ccall_intercept(model, lpopt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - else - @cpx_ccall(lpopt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp) - end - end) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -set_branching_priority(model::Model, priority) = - set_branching_priority(model, Cint[1:num_var(model)], priority) - -set_branching_priority(model::Model, indices, priority) = - set_branching_priority(model, indices, priority, C_NULL) - -set_branching_priority(model, indices, priority, direction) = - set_branching_priority(model, convert(Vector{Cint},indices), convert(Vector{Cint},priority), direction) - -function set_branching_priority(model::Model, indices::Vector{Cint}, priority::Vector{Cint}, direction) - @assert (cnt = length(indices)) == length(priority) - isa(direction,Vector) && @assert cnt == length(direction) - stat = @cpx_ccall(copyorder, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}), - model.env.ptr, model.lp, cnt, indices .- Cint(1), priority, direction) - stat == 0 || throw(CplexError(model.env, stat)) - return nothing -end - - -function newlongannotation(model::Model, name::String, defval::Clong) - stat = @cpx_ccall(newlongannotation, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cchar}, - Clong), - model.env.ptr, model.lp, name, defval) - stat == 0 || throw(CplexError(model.env, stat)) - - return nothing -end - -function setlongannotations(model::Model, idx::Cint, objtype::Cint, cnt::Cint, indexArr::Array{Cint}, - valArr::Array{Clong}) - stat = @cpx_ccall(setlongannotations, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Cint, - Ptr{Cvoid}, - Ptr{Cvoid}), - model.env.ptr, model.lp, idx, objtype, cnt, indexArr, valArr) - stat == 0 || throw(CplexError(model.env, stat)) - return nothing -end - -export setlongannotations, newlongannotation - -function c_api_getobjval(model::Model) - objval = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getobjval, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, objval) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return objval[1] -end -get_objval(model::Model) = c_api_getobjval(model) - -function c_api_solninfo(model::Model) - solnmethod_p = Ref{Cint}() - solntype_p = Ref{Cint}() - pfeasind_p = Ref{Cint}() - dfeasind_p = Ref{Cint}() - stat = @cpx_ccall(solninfo, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint} - ), - model.env.ptr, model.lp, solnmethod_p, solntype_p, - pfeasind_p, dfeasind_p) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return (solnmethod_p[], solntype_p[], pfeasind_p[], dfeasind_p[]) -end - -function c_api_getx(model::Model, x::FVec) - nvars = num_var(model) - stat = @cpx_ccall(getx, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, x, 0, nvars-Cint(1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_solution(model::Model) - nvars = num_var(model) - x = Vector{Cdouble}(undef, nvars) - c_api_getx(model, x) - return x -end - -function c_api_getdj(model::Model, p::FVec) - nvars = num_var(model) - stat = @cpx_ccall(getdj, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, p, 0, nvars-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_reduced_costs(model::Model) - nvars = num_var(model) - p = Vector{Cdouble}(undef, nvars) - c_api_getdj(model, p) - return p -end - -function c_api_getpi(model::Model, p::FVec) - ncons = num_constr(model) - stat = @cpx_ccall(getpi, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, p, 0, ncons-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_getqconstrslack(model::Model, dest::Vector{Float64}) - ncons = num_qconstr(model) - stat = @cpx_ccall(getqconstrslack, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, dest, 0, ncons-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_constr_duals(model::Model) - ncons = num_constr(model) - p = Vector{Cdouble}(undef, ncons) - c_api_getpi(model, p) - return p -end - -function c_api_getax(model::Model, Ax::FVec) - ncons = num_constr(model) - stat = @cpx_ccall(getax, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, Ax, 0, ncons-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_getxqxax(model::Model, dest::Vector{Float64}) - ncons = num_qconstr(model) - stat = @cpx_ccall(getxqxax, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, dest, 0, ncons-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function get_constr_solution(model::Model) - ncons = num_constr(model) - Ax = Vector{Cdouble}(undef, ncons) - c_api_getax(model, Ax) - return Ax -end - -function get_infeasibility_ray(model::Model) - ncons = num_constr(model) - y = Vector{Cdouble}(undef, ncons) - proof_p = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(dualfarkas, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, y, proof_p) - if stat != 0 - error("CPLEX is unable to grab infeasible ray; consider resolving with presolve turned off") - throw(CplexError(model.env, stat)) - end - return y -end - -function get_unbounded_ray(model::Model) - solve_stat = get_status(model) - if solve_stat == :CPX_STAT_UNBOUNDED - n = num_var(model) - z = Vector{Cdouble}(undef, n) - stat = @cpx_ccall(getray, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, z) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return z - else - error("CPLEX is unable to grab unbounded ray; consider resolving with presolve turned off") - end -end - -const varmap = Dict( - 0 => :NonbasicAtLower, - 1 => :Basic, - 2 => :NonbasicAtUpper, - 3 => :Free -) - -const conmap = Dict( - 0 => :NonbasicAtLower, - 1 => :Basic, - 2 => :NonbasicAtUpper -) - -function get_basis(model::Model) - cval = Vector{Cint}(undef, num_var(model)) - rval = Vector{Cint}(undef, num_constr(model)) - stat = @cpx_ccall(getbase, Cint, (Ptr{Cvoid},Ptr{Cvoid},Ptr{Cint},Ptr{Cint}), - model.env.ptr, model.lp, cval, rval) - stat != 0 && throw(CplexError(model.env, stat)) - - csense = get_constr_senses(model) - cbasis = Vector{Symbol}(undef, num_var(model)) - rbasis = Vector{Symbol}(undef, num_constr(model)) - for it in 1:num_var(model) - cbasis[it] = varmap[cval[it]] - end - for it in 1:num_constr(model) - rbasis[it] = conmap[rval[it]] - if (rbasis[it] == :NonbasicAtLower) && (csense[it] == convert(Cchar,'L')) - rbasis[it] = :NonbasicAtUpper - end - end - return cbasis, rbasis -end - -get_node_count(model::Model) = @cpx_ccall(getnodecnt, Cint, (Ptr{Cvoid},Ptr{Cvoid}), model.env.ptr, model.lp) - -function get_rel_gap(model::Model) - ret = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getmiprelgap, Cint, (Ptr{Cvoid},Ptr{Cvoid},Ptr{Cdouble}), model.env.ptr, model.lp, ret) - if stat != 0 - throw(CplexError(model.env, stat)) - end - ret[1] -end - - -function get_num_cuts(model::Model,cuttype) - cutcount = Vector{Cint}(undef, 1) - - stat = @cpx_ccall(getnumcuts, Cint, (Ptr{Cvoid},Ptr{Cvoid},Cint,Ptr{Cvoid}), model.env.ptr , model.lp, cuttype, cutcount) - if stat != 0 - error(CplexError(model.inner.env, stat).msg) - end - return cutcount[1] -end - -const status_symbols = Dict( - 1 => :CPX_STAT_OPTIMAL, - 2 => :CPX_STAT_UNBOUNDED, - 3 => :CPX_STAT_INFEASIBLE, - 4 => :CPX_STAT_INForUNBD, - 5 => :CPX_STAT_OPTIMAL_INFEAS, - 6 => :CPX_STAT_NUM_BEST, - 7 => :CPX_STAT_FEASIBLE_RELAXED, - 8 => :CPX_STAT_OPTIMAL_RELAXED, - 10 => :CPX_STAT_ABORT_IT_LIM, - 11 => :CPX_STAT_ABORT_TIME_LIM, - 12 => :CPX_STAT_ABORT_OBJ_LIM, - 13 => :CPX_STAT_ABORT_USER, - 20 => :CPX_STAT_OPTIMAL_FACE_UNBOUNDED, - 21 => :CPX_STAT_ABORT_PRIM_OBJ_LIM, - 22 => :CPX_STAT_ABORT_DUAL_OBJ_LIM, - 101 => :CPXMIP_OPTIMAL, - 102 => :CPXMIP_OPTIMAL_TOL, - 103 => :CPXMIP_INFEASIBLE, - 104 => :CPXMIP_SOL_LIM, - 105 => :CPXMIP_NODE_LIM_FEAS, - 106 => :CPXMIP_NODE_LIM_INFEAS, - 107 => :CPXMIP_TIME_LIM_FEAS, - 108 => :CPXMIP_TIME_LIM_INFEAS, - 109 => :CPXMIP_FAIL_FEAS, - 110 => :CPXMIP_FAIL_INFEAS, - 111 => :CPXMIP_MEM_LIM_FEAS, - 112 => :CPXMIP_MEM_LIM_INFEAS, - 113 => :CPXMIP_ABORT_FEAS, - 114 => :CPXMIP_ABORT_INFEAS, - 115 => :CPXMIP_OPTIMAL_INFEAS, - 116 => :CPXMIP_FAIL_FEAS_NO_TREE, - 117 => :CPXMIP_FAIL_INFEAS_NO_TREE, - 118 => :CPXMIP_UNBOUNDED, - 119 => :CPXMIP_INForUNBD, - 120 => :CPXMIP_FEASIBLE_RELAXED, - 121 => :CPXMIP_OPTIMAL_RELAXED -) - -get_status(model::Model) = status_symbols[Int(get_status_code(model))]::Symbol - -function c_api_getstat(model::Model) - return @cpx_ccall(getstat, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), - model.env.ptr, model.lp) -end -get_status_code(model::Model) = c_api_getstat(model) - -function c_api_getstatstring(model::Model, statind::Cint) - buffer_str = Vector{Cchar}(undef, 1024) - @cpx_ccall( - getstatstring, - Ptr{Cvoid}, - (Ptr{Cvoid}, Cint, Ptr{Cchar}), - model.env.ptr, statind, buffer_str - ) - return unsafe_string(pointer(buffer_str)) -end - -function c_api_getitcnt(model::Model) - return @cpx_ccall( - getitcnt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp - ) -end - -function c_api_getbaritcnt(model::Model) - return @cpx_ccall( - getbaritcnt, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), model.env.ptr, model.lp - ) -end diff --git a/src/cpx_vars.jl b/src/cpx_vars.jl deleted file mode 100644 index 78ef359e..00000000 --- a/src/cpx_vars.jl +++ /dev/null @@ -1,283 +0,0 @@ -function add_vars!(model::Model, obj::Vector, l_in::Bounds, u_in::Bounds) - nvars = length(obj) - obj = fvec(obj) - l = fvecx(copy(l_in), nvars) - u = fvecx(copy(u_in), nvars) - for i = 1:nvars - if l[i] == -Inf - l[i] = -CPX_INFBOUND - end - if u[i] == Inf - u[i] = CPX_INFBOUND - end - end - if nvars > 0 - stat = @cpx_ccall(newcols, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cchar}, - Ptr{Ptr{Cchar}} - ), - model.env.ptr, model.lp, nvars, float(obj), float(l), float(u), C_NULL, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - end -end - -add_var!(model::Model, obj::Vector, l::Vector, u::Vector) = add_vars!(model, obj, l, u) - -function add_var!(model::Model, constridx::IVec, constrcoef::FVec, l::FVec, u::FVec, objcoef::FVec) - nvars = length(objcoef) - (nvars == length(l) == length(u)) || error("Inconsistent dimensions when adding variables.") - for i = 1:nvars - if l[i] == -Inf - l[i] = -CPX_INFBOUND - end - if u[i] == Inf - u[i] = CPX_INFBOUND - end - end - if nvars > 0 - stat = @cpx_ccall(addcols, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Ptr{Cchar}} - ), - model.env.ptr, model.lp, nvars, length(constridx), - objcoef, Cint[0], constridx .- Cint(1), constrcoef, - l, u, C_NULL) - if stat != 0 - throw(CplexError(model.env, stat)) - end - end -end - -add_var!(model::Model, obj, l, u) = add_vars!(model, Cdouble[obj], Cdouble[l], Cdouble[u]) - -function add_var!(model::Model, constridx, constrcoef, l, u, objcoef) - return add_var!(model, - convert(Vector{Cint}, vec(collect(constridx))), - convert(Vector{Cdouble},vec(collect(constrcoef))), - convert(Vector{Cdouble},vec(collect(l))), - convert(Vector{Cdouble},vec(collect(u))), - convert(Vector{Cdouble},vec(collect(objcoef)))) -end - -function add_var!(model::Model, constridx::Vector, constrcoef::Vector, l::Vector, u::Vector, objcoef::Vector) - return add_var!(model, ivec(constridx), fvec(constrcoef), fvec(l), fvec(u), fvec(objcoef)) -end - -function c_api_getlb(model::Model, col_start::Cint, col_end::Cint) - lb = Vector{Cdouble}(undef, col_end - col_start + 1) - stat = @cpx_ccall(getlb, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, lb, - col_start - Cint(1), col_end - Cint(1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return lb -end - -function get_varLB(model::Model) - nvars = num_var(model) - lb = Vector{Cdouble}(undef, nvars) - stat = @cpx_ccall(getlb, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, lb, 0, nvars-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return lb -end - -function c_api_chgbds(model::Model, indices::IVec, lu::CVec, bd::FVec) - cnt = length(indices) - stat = @cpx_ccall(chgbds, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cchar}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, cnt, indices .- Cint(1), lu, bd) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function set_varLB!(model::Model, l::FVec) - nvars = num_var(model) - for i = 1:nvars - if l[i] == -Inf - l[i] = -CPX_INFBOUND - end - end - stat = @cpx_ccall(chgbds, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cchar}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, nvars, Cint[0:nvars-1;], fill(convert(Cchar, 'L'), nvars), l) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_getub(model::Model, col_start::Cint, col_end::Cint) - ub = Vector{Cdouble}(undef, 1) - stat = @cpx_ccall(getub, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, ub, - col_start - Cint(1), col_end - Cint(1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return ub[1] -end - -function get_varUB(model::Model) - nvars = num_var(model) - ub = Vector{Cdouble}(undef, nvars) - stat = @cpx_ccall(getub, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cdouble}, - Cint, - Cint - ), - model.env.ptr, model.lp, ub, 0, nvars-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return ub -end - -function set_varUB!(model::Model, u::FVec) - nvars = num_var(model) - for i = 1:nvars - if u[i] == Inf - u[i] = CPX_INFBOUND - end - end - stat = @cpx_ccall(chgbds, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Cchar}, - Ptr{Cdouble} - ), - model.env.ptr, model.lp, nvars, Cint[0:nvars-1;], fill(convert(Cchar, 'U'), nvars), u) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_chgctype(model::Model, indices::Vector{Cint}, types::Vector{Cchar}) - nvars = length(indices) - stat = @cpx_ccall(chgctype, - Cint, - (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{Cchar}), - model.env.ptr, model.lp, nvars, indices .- Cint(1), types) - if any(c_type -> c_type != Cchar('C'), types) - model.has_int = true - end - if stat != 0 - throw(CplexError(model.env, stat)) - end - return stat -end - -function set_vartype!(model::Model, vtype::Vector{Char}) - return c_api_chgctype(model, Cint.(1:length(vtype)), Cchar.(vtype)) -end - -function get_vartype(model::Model) - nvars = num_var(model) - vartypes = Vector{Cchar}(undef, nvars) - stat = @cpx_ccall(getctype, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Ptr{Cchar}, - Cint, - Cint - ), - model.env.ptr, model.lp, vartypes, 0, nvars-1) - if stat != 0 - throw(CplexError(model.env, stat)) - end - return convert(Vector{Char},vartypes) -end - -function c_api_getnumcols(model::Model) - nvar = @cpx_ccall(getnumcols, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid} - ), - model.env.ptr, model.lp) - return(nvar) -end -num_var(model::Model) = c_api_getnumcols(model) - -function set_varname!(model::Model, idx::Integer, name::String) - s = bytestring(name) - @assert isascii(name) - - stat = @cpx_ccall(chgcolname, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Ptr{Cint}, - Ptr{Ptr{UInt8}} - ), - model.env.ptr, model.lp, 1, Cint[idx-1], [pointer(s)]) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end - -function c_api_delcols(model::Model, first::Cint, last::Cint) - stat = @cpx_ccall(delcols, Cint, ( - Ptr{Cvoid}, - Ptr{Cvoid}, - Cint, - Cint - ), - model.env.ptr, model.lp, first - Cint(1), last - Cint(1)) - if stat != 0 - throw(CplexError(model.env, stat)) - end -end diff --git a/src/deprecated_functions.jl b/src/deprecated_functions.jl new file mode 100644 index 00000000..8ffcc757 --- /dev/null +++ b/src/deprecated_functions.jl @@ -0,0 +1,411 @@ +const _DEPRECATED_ERROR_MESSAGE = """ +The C API of CPLEX.jl has been rewritten to expose the complete C API, and +all old functions have been removed. + +For example: + + is_point = CPLEX.cbcandidateispoint(cb_data) + +is now + + is_point_P = Ref{Cint}() + CPXcallbackcandidateispoint(cb_data, is_point_P) + if ret != 0 + # Do something because the call failed + end + is_point = is_point_P[] + +For users of `CPLEX.Optimizer`, `model.inner` has been replaced by the fields +`model.env` and `model.lp`, which correspond to the environment and problem +pointers at the C API level. + +For example: + + stat = CPLEX.get_status(model.inner) + +is now: + + stat = CPXgetstat(model.env, model.lp) + +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.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/refcallablelibrary/groups/homepagecallable.html + +To revert to the old API, use: + + import Pkg + Pkg.add(Pkg.PackageSpec(name = "CPLEX", version = v"0.6")) + +Then restart Julia for the change to take effect. +""" +add_constr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_constrs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_constrs_t!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_diag_qpterms!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_indicator_constraint(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_qconstr!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_qpterms!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_rangeconstrs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_rangeconstrs_t!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_sos!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_var!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +add_vars!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_addrows(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgbds(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgcoef(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgctype(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgname(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgobj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgobjoffset(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgobjsen(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgrhs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_chgsense(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_delcols(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_delqconstrs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_delrows(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_delsos(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getax(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getbaritcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getconflict(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getdj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getitcnt(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getlb(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getnumcols(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getnumrows(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getobj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getobjoffset(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getobjsen(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getobjval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getpi(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getqconstr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getqconstrslack(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getquad(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getrhs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getrows(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getsos(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getstat(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getstatstring(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getub(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getx(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_getxqxax(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +c_api_solninfo(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +callback_wrapper(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +callbackgetcandidatepoint(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +callbackgetrelaxationpoint(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbabort(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbaddboundbranchdown!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbaddboundbranchdown! + +cbaddboundbranchup!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbaddboundbranchup! + +cbaddconstrbranch!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbaddusercuts(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbbranch(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbbranchconstr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbcandidateispoint(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbcut(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbcutlocal(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbgetcandidatepoint(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbgetdetstarttime(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetdetstarttime + +cbgetdettimestamp(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetdettimestamp + +cbgetfeasibility(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetfeasibility + +cbgetgap(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetgap + +cbgetintfeas(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetintfeas + +cbgetmipiterations(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetmipiterations + +cbgetnodelb(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetnodelb + +cbgetnodeobjval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetnodeobjval + +cbgetnodesleft(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetnodesleft + +cbgetnodeub(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetnodeub + +cbgetrelaxationpoint(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbgetstarttime(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgetstarttime + +cbgettimestamp(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export cbgettimestamp + +cblazy(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cblazylocal(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbpostheursoln(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbprocessincumbent!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbrejectcandidate(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cbsetfunc(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cchar(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +check_moi_callback_validity(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +close_CPLEX(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +compute_conflict(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cplex_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cvec(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +cvecx(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +default_moi_callback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +eval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +free_problem(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +fvec(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +fvecx(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_basis(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_best_bound(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_constrLB(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_constrUB(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_constr_duals(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_constr_matrix(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_constr_senses(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_constr_solution(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_error_msg(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_infeasibility_ray(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_nnz(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_node_count(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_num_cuts(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_num_sos(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_obj(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_objval(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_param(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_param_type(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_prob_type(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_reduced_costs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_rel_gap(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_rhs(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_sense(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_solution(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_status(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_status_code(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_unbounded_ray(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_varLB(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_varUB(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +get_vartype(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +getdettime(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +include(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +intervalize(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +is_valid(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +ivec(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +masterbranchcallback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +mastercallback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +masterheuristiccallback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +masterincumbentcallback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +masterinfocallback(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +newlongannotation(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export newlongannotation + +notify_freed_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +notify_new_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +num_constr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +num_qconstr(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +num_var(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +optimize!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +read_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +return_status_or_throw(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_branching_priority(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_constrLB!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_constrUB!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_constr_senses!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_logfile(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_obj!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_param!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_prob_type!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_rhs!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_sense!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_terminate(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_varLB!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_varUB!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_varname!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_vartype!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +set_warm_start!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setbranchcallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setcallbackcut(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setcallbackcutlocal(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setincumbentcallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setlongannotations(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export setlongannotations + +setmathprogbranchcallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) +export setmathprogbranchcallback! + +setmathprogcutcallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setmathprogheuristiccallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setmathprogincumbentcallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setmathproginfocallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +setmathproglazycallback!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +terminate(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +toggleproblemtype!(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +tune_param(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +version(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + +write_model(args...; kwargs...) = error(_DEPRECATED_ERROR_MESSAGE) + diff --git a/src/full_defines_12100.jl b/src/full_defines_12100.jl deleted file mode 100644 index d2fb80b4..00000000 --- a/src/full_defines_12100.jl +++ /dev/null @@ -1,1262 +0,0 @@ -# This list was obtained through AWK with Cplex 12.7.1 (and then pared down). -# Some Cint manually changed to Cchar, removed convert around floating point constants -# grep "#define" cpxconst.h | awk '{ printf("const %s = convert(Cint,%s)\n",$2,$3) }' - -#const CPX_FEATURES_H = convert(Cint,1) -#const CPX_INTWIDTH_H = convert(Cint,) -#const CPXINT_MAX = convert(Cint,INT_MAX) -#const CPXINT_MIN = convert(Cint,INT_MIN) -#const CPX_PUBCONST_H = convert(Cint,) -#const CPXPUBLIC = convert(Cint,__stdcall) -#const CPXPUBVARARGS = convert(Cint,__cdecl) -#const CPXCDECL = convert(Cint,__cdecl) -#const CPXPUBLIC = convert(Cint,) -#const CPXPUBVARARGS = convert(Cint,) -#const CPXCDECL = convert(Cint,) - -const CPX_STR_PARAM_MAX = convert(Cint,512) -const CPX_VERSION = convert(Cint,12100000) -const CPX_VERSION_VERSION = convert(Cint,12) -const CPX_VERSION_RELEASE = convert(Cint,10) -const CPX_VERSION_MODIFICATION = convert(Cint,0) -const CPX_VERSION_FIX = convert(Cint,0) -const CPX_INFBOUND = 1.0E+20 #convert(Cint,1.0E+20) -const CPX_MINBOUND = 1.0E-13 #convert(Cint,1.0E-13) -const CPX_PARAMTYPE_NONE = convert(Cint,0) -const CPX_PARAMTYPE_INT = convert(Cint,1) -const CPX_PARAMTYPE_DOUBLE = convert(Cint,2) -const CPX_PARAMTYPE_STRING = convert(Cint,3) -const CPX_PARAMTYPE_LONG = convert(Cint,4) -const CPX_NO_SOLN = convert(Cint,0) -const CPX_AUTO_SOLN = convert(Cint,0) -const CPX_BASIC_SOLN = convert(Cint,1) -const CPX_NONBASIC_SOLN = convert(Cint,2) -const CPX_PRIMAL_SOLN = convert(Cint,3) -const CPX_PRECOL_LOW = convert(Cint,-1) -const CPX_PRECOL_UP = convert(Cint,-2) -const CPX_PRECOL_FIX = convert(Cint,-3) -const CPX_PRECOL_AGG = convert(Cint,-4) -const CPX_PRECOL_OTHER = convert(Cint,-5) -const CPX_PREROW_RED = convert(Cint,-1) -const CPX_PREROW_AGG = convert(Cint,-2) -const CPX_PREROW_OTHER = convert(Cint,-3) -const CPX_AUTO = convert(Cint,-1) -const CPX_ON = convert(Cint,1) -const CPX_OFF = convert(Cint,0) -const CPX_MAX = convert(Cint,-1) -const CPX_MIN = convert(Cint,1) -const CPX_DATACHECK_OFF = convert(Cint,0) -const CPX_DATACHECK_WARN = convert(Cint,1) -const CPX_DATACHECK_ASSIST = convert(Cint,2) -const CPX_PPRIIND_PARTIAL = convert(Cint,-1) -const CPX_PPRIIND_AUTO = convert(Cint,0) -const CPX_PPRIIND_DEVEX = convert(Cint,1) -const CPX_PPRIIND_STEEP = convert(Cint,2) -const CPX_PPRIIND_STEEPQSTART = convert(Cint,3) -const CPX_PPRIIND_FULL = convert(Cint,4) -const CPX_DPRIIND_AUTO = convert(Cint,0) -const CPX_DPRIIND_FULL = convert(Cint,1) -const CPX_DPRIIND_STEEP = convert(Cint,2) -const CPX_DPRIIND_FULLSTEEP = convert(Cint,3) -const CPX_DPRIIND_STEEPQSTART = convert(Cint,4) -const CPX_DPRIIND_DEVEX = convert(Cint,5) -const CPX_PARALLEL_DETERMINISTIC = convert(Cint,1) -const CPX_PARALLEL_AUTO = convert(Cint,0) -const CPX_PARALLEL_OPPORTUNISTIC = convert(Cint,-1) -const CPX_WRITELEVEL_AUTO = convert(Cint,0) -const CPX_WRITELEVEL_ALLVARS = convert(Cint,1) -const CPX_WRITELEVEL_DISCRETEVARS = convert(Cint,2) -const CPX_WRITELEVEL_NONZEROVARS = convert(Cint,3) -const CPX_WRITELEVEL_NONZERODISCRETEVARS = convert(Cint,4) -const CPX_OPTIMALITYTARGET_AUTO = convert(Cint,0) -const CPX_OPTIMALITYTARGET_OPTIMALCONVEX = convert(Cint,1) -const CPX_OPTIMALITYTARGET_FIRSTORDER = convert(Cint,2) -const CPX_OPTIMALITYTARGET_OPTIMALGLOBAL = convert(Cint,3) -const CPX_ALG_NONE = convert(Cint,-1) -const CPX_ALG_AUTOMATIC = convert(Cint,0) -const CPX_ALG_PRIMAL = convert(Cint,1) -const CPX_ALG_DUAL = convert(Cint,2) -const CPX_ALG_NET = convert(Cint,3) -const CPX_ALG_BARRIER = convert(Cint,4) -const CPX_ALG_SIFTING = convert(Cint,5) -const CPX_ALG_CONCURRENT = convert(Cint,6) -const CPX_ALG_BAROPT = convert(Cint,7) -const CPX_ALG_PIVOTIN = convert(Cint,8) -const CPX_ALG_PIVOTOUT = convert(Cint,9) -const CPX_ALG_PIVOT = convert(Cint,10) -const CPX_ALG_FEASOPT = convert(Cint,11) -const CPX_ALG_MIP = convert(Cint,12) -const CPX_ALG_BENDERS = convert(Cint,13) -const CPX_ALG_MULTIOBJ = convert(Cint,14) -const CPX_ALG_ROBUST = convert(Cint,15) -const CPX_AT_LOWER = convert(Cint,0) -const CPX_BASIC = convert(Cint,1) -const CPX_AT_UPPER = convert(Cint,2) -const CPX_FREE_SUPER = convert(Cint,3) -const CPX_NO_VARIABLE = convert(Cint,2100000000) -const CPX_CONTINUOUS = convert(Cchar,'C') -const CPX_BINARY = convert(Cchar,'B') -const CPX_INTEGER = convert(Cchar,'I') -const CPX_SEMICONT = convert(Cchar,'S') -const CPX_SEMIINT = convert(Cchar,'N') -const CPX_PREREDUCE_PRIMALANDDUAL = convert(Cint,3) -const CPX_PREREDUCE_DUALONLY = convert(Cint,2) -const CPX_PREREDUCE_PRIMALONLY = convert(Cint,1) -const CPX_PREREDUCE_NOPRIMALORDUAL = convert(Cint,0) -const CPX_CONFLICT_EXCLUDED = convert(Cint,-1) -const CPX_CONFLICT_POSSIBLE_MEMBER = convert(Cint,0) -const CPX_CONFLICT_POSSIBLE_LB = convert(Cint,1) -const CPX_CONFLICT_POSSIBLE_UB = convert(Cint,2) -const CPX_CONFLICT_MEMBER = convert(Cint,3) -const CPX_CONFLICT_LB = convert(Cint,4) -const CPX_CONFLICT_UB = convert(Cint,5) -const CPX_CONFLICTALG_AUTO = convert(Cint,0) -const CPX_CONFLICTALG_FAST = convert(Cint,1) -const CPX_CONFLICTALG_PROPAGATE = convert(Cint,2) -const CPX_CONFLICTALG_PRESOLVE = convert(Cint,3) -const CPX_CONFLICTALG_IIS = convert(Cint,4) -const CPX_CONFLICTALG_LIMITSOLVE = convert(Cint,5) -const CPX_CONFLICTALG_SOLVE = convert(Cint,6) -const CPXPROB_LP = convert(Cint,0) -const CPXPROB_MILP = convert(Cint,1) -const CPXPROB_FIXEDMILP = convert(Cint,3) -const CPXPROB_NODELP = convert(Cint,4) -const CPXPROB_QP = convert(Cint,5) -const CPXPROB_MIQP = convert(Cint,7) -const CPXPROB_FIXEDMIQP = convert(Cint,8) -const CPXPROB_NODEQP = convert(Cint,9) -const CPXPROB_QCP = convert(Cint,10) -const CPXPROB_MIQCP = convert(Cint,11) -const CPXPROB_NODEQCP = convert(Cint,12) -const CPX_LPREADER_LEGACY = convert(Cint,0) -const CPX_LPREADER_NEW = convert(Cint,1) -const CPX_PARAM_ALL_MIN = convert(Cint,1000) -const CPX_PARAM_ALL_MAX = convert(Cint,6000) -const CPX_CALLBACK_PRIMAL = convert(Cint,1) -const CPX_CALLBACK_DUAL = convert(Cint,2) -const CPX_CALLBACK_NETWORK = convert(Cint,3) -const CPX_CALLBACK_PRIMAL_CROSSOVER = convert(Cint,4) -const CPX_CALLBACK_DUAL_CROSSOVER = convert(Cint,5) -const CPX_CALLBACK_BARRIER = convert(Cint,6) -const CPX_CALLBACK_PRESOLVE = convert(Cint,7) -const CPX_CALLBACK_QPBARRIER = convert(Cint,8) -const CPX_CALLBACK_QPSIMPLEX = convert(Cint,9) -const CPX_CALLBACK_TUNING = convert(Cint,10) -const CPX_CALLBACK_INFO_PRIMAL_OBJ = convert(Cint,1) -const CPX_CALLBACK_INFO_DUAL_OBJ = convert(Cint,2) -const CPX_CALLBACK_INFO_PRIMAL_INFMEAS = convert(Cint,3) -const CPX_CALLBACK_INFO_DUAL_INFMEAS = convert(Cint,4) -const CPX_CALLBACK_INFO_PRIMAL_FEAS = convert(Cint,5) -const CPX_CALLBACK_INFO_DUAL_FEAS = convert(Cint,6) -const CPX_CALLBACK_INFO_ITCOUNT = convert(Cint,7) -const CPX_CALLBACK_INFO_CROSSOVER_PPUSH = convert(Cint,8) -const CPX_CALLBACK_INFO_CROSSOVER_PEXCH = convert(Cint,9) -const CPX_CALLBACK_INFO_CROSSOVER_DPUSH = convert(Cint,10) -const CPX_CALLBACK_INFO_CROSSOVER_DEXCH = convert(Cint,11) -const CPX_CALLBACK_INFO_CROSSOVER_SBCNT = convert(Cint,12) -const CPX_CALLBACK_INFO_PRESOLVE_ROWSGONE = convert(Cint,13) -const CPX_CALLBACK_INFO_PRESOLVE_COLSGONE = convert(Cint,14) -const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST = convert(Cint,15) -const CPX_CALLBACK_INFO_PRESOLVE_COEFFS = convert(Cint,16) -const CPX_CALLBACK_INFO_USER_PROBLEM = convert(Cint,17) -const CPX_CALLBACK_INFO_TUNING_PROGRESS = convert(Cint,18) -const CPX_CALLBACK_INFO_ENDTIME = convert(Cint,19) -const CPX_CALLBACK_INFO_ITCOUNT_LONG = convert(Cint,20) -const CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG = convert(Cint,21) -const CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG = convert(Cint,22) -const CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG = convert(Cint,23) -const CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG = convert(Cint,24) -const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST_LONG = convert(Cint,25) -const CPX_CALLBACK_INFO_PRESOLVE_COEFFS_LONG = convert(Cint,26) -const CPX_CALLBACK_INFO_ENDDETTIME = convert(Cint,27) -const CPX_CALLBACK_INFO_STARTTIME = convert(Cint,28) -const CPX_CALLBACK_INFO_STARTDETTIME = convert(Cint,29) -const CPX_TUNE_AVERAGE = convert(Cint,1) -const CPX_TUNE_MINMAX = convert(Cint,2) -const CPX_TUNE_ABORT = convert(Cint,1) -const CPX_TUNE_TILIM = convert(Cint,2) -const CPX_TUNE_DETTILIM = convert(Cint,3) -const CPX_FEASOPT_MIN_SUM = convert(Cint,0) -const CPX_FEASOPT_OPT_SUM = convert(Cint,1) -const CPX_FEASOPT_MIN_INF = convert(Cint,2) -const CPX_FEASOPT_OPT_INF = convert(Cint,3) -const CPX_FEASOPT_MIN_QUAD = convert(Cint,4) -const CPX_FEASOPT_OPT_QUAD = convert(Cint,5) -const CPX_BENDERSSTRATEGY_OFF = convert(Cint,-1) -const CPX_BENDERSSTRATEGY_AUTO = convert(Cint,0) -const CPX_BENDERSSTRATEGY_USER = convert(Cint,1) -const CPX_BENDERSSTRATEGY_WORKERS = convert(Cint,2) -const CPX_BENDERSSTRATEGY_FULL = convert(Cint,3) -const CPX_ANNOTATIONDATA_LONG = convert(Cint,1) -const CPX_ANNOTATIONDATA_DOUBLE = convert(Cint,2) -const CPX_ANNOTATIONOBJ_OBJ = convert(Cint,0) -const CPX_ANNOTATIONOBJ_COL = convert(Cint,1) -const CPX_ANNOTATIONOBJ_ROW = convert(Cint,2) -const CPX_ANNOTATIONOBJ_SOS = convert(Cint,3) -const CPX_ANNOTATIONOBJ_IND = convert(Cint,4) -const CPX_ANNOTATIONOBJ_QC = convert(Cint,5) -const CPX_ANNOTATIONOBJ_LAST = convert(Cint,6) -const CPXIIS_COMPLETE = convert(Cint,1) -const CPXIIS_PARTIAL = convert(Cint,2) -const CPXIIS_AT_LOWER = convert(Cint,0) -const CPXIIS_FIXED = convert(Cint,1) -const CPXIIS_AT_UPPER = convert(Cint,2) -# const CPX_BARCONST_H = convert(Cint,) -const CPX_BARORDER_AUTO = convert(Cint,0) -const CPX_BARORDER_AMD = convert(Cint,1) -const CPX_BARORDER_AMF = convert(Cint,2) -const CPX_BARORDER_ND = convert(Cint,3) -# const CPX_MIPCONST_H = convert(Cint,) -const CPX_MIPEMPHASIS_BALANCED = convert(Cint,0) -const CPX_MIPEMPHASIS_FEASIBILITY = convert(Cint,1) -const CPX_MIPEMPHASIS_OPTIMALITY = convert(Cint,2) -const CPX_MIPEMPHASIS_BESTBOUND = convert(Cint,3) -const CPX_MIPEMPHASIS_HIDDENFEAS = convert(Cint,4) -const CPX_TYPE_VAR = convert(Cchar,'0') -const CPX_TYPE_SOS1 = convert(Cchar,'1') -const CPX_TYPE_SOS2 = convert(Cchar,'2') -const CPX_TYPE_USER = convert(Cchar,'X') -const CPX_TYPE_ANY = convert(Cchar,'A') -const CPX_VARSEL_MININFEAS = convert(Cint,-1) -const CPX_VARSEL_DEFAULT = convert(Cint,0) -const CPX_VARSEL_MAXINFEAS = convert(Cint,1) -const CPX_VARSEL_PSEUDO = convert(Cint,2) -const CPX_VARSEL_STRONG = convert(Cint,3) -const CPX_VARSEL_PSEUDOREDUCED = convert(Cint,4) -const CPX_NODESEL_DFS = convert(Cint,0) -const CPX_NODESEL_BESTBOUND = convert(Cint,1) -const CPX_NODESEL_BESTEST = convert(Cint,2) -const CPX_NODESEL_BESTEST_ALT = convert(Cint,3) -const CPX_MIPORDER_COST = convert(Cint,1) -const CPX_MIPORDER_BOUNDS = convert(Cint,2) -const CPX_MIPORDER_SCALEDCOST = convert(Cint,3) -const CPX_BRANCH_GLOBAL = convert(Cint,0) -const CPX_BRANCH_DOWN = convert(Cint,-1) -const CPX_BRANCH_UP = convert(Cint,1) -const CPX_BRDIR_DOWN = convert(Cint,-1) -const CPX_BRDIR_AUTO = convert(Cint,0) -const CPX_BRDIR_UP = convert(Cint,1) -const CPX_CUT_COVER = convert(Cint,0) -const CPX_CUT_GUBCOVER = convert(Cint,1) -const CPX_CUT_FLOWCOVER = convert(Cint,2) -const CPX_CUT_CLIQUE = convert(Cint,3) -const CPX_CUT_FRAC = convert(Cint,4) -const CPX_CUT_MIR = convert(Cint,5) -const CPX_CUT_FLOWPATH = convert(Cint,6) -const CPX_CUT_DISJ = convert(Cint,7) -const CPX_CUT_IMPLBD = convert(Cint,8) -const CPX_CUT_ZEROHALF = convert(Cint,9) -const CPX_CUT_MCF = convert(Cint,10) -const CPX_CUT_LOCALCOVER = convert(Cint,11) -const CPX_CUT_TIGHTEN = convert(Cint,12) -const CPX_CUT_OBJDISJ = convert(Cint,13) -const CPX_CUT_LANDP = convert(Cint,14) -const CPX_CUT_USER = convert(Cint,15) -const CPX_CUT_TABLE = convert(Cint,16) -const CPX_CUT_SOLNPOOL = convert(Cint,17) -const CPX_CUT_LOCALIMPLBD = convert(Cint,18) -const CPX_CUT_BQP = convert(Cint,19) -const CPX_CUT_RLT = convert(Cint,20) -const CPX_CUT_BENDERS = convert(Cint,21) -const CPX_CUT_NUM_TYPES = convert(Cint,22) -const CPX_MIPSEARCH_AUTO = convert(Cint,0) -const CPX_MIPSEARCH_TRADITIONAL = convert(Cint,1) -const CPX_MIPSEARCH_DYNAMIC = convert(Cint,2) -const CPX_MIPKAPPA_OFF = convert(Cint,-1) -const CPX_MIPKAPPA_AUTO = convert(Cint,0) -const CPX_MIPKAPPA_SAMPLE = convert(Cint,1) -const CPX_MIPKAPPA_FULL = convert(Cint,2) -const CPX_MIPSTART_AUTO = convert(Cint,0) -const CPX_MIPSTART_CHECKFEAS = convert(Cint,1) -const CPX_MIPSTART_SOLVEFIXED = convert(Cint,2) -const CPX_MIPSTART_SOLVEMIP = convert(Cint,3) -const CPX_MIPSTART_REPAIR = convert(Cint,4) -const CPX_MIPSTART_NOCHECK = convert(Cint,5) -const CPX_CALLBACK_MIP = convert(Cint,101) -const CPX_CALLBACK_MIP_BRANCH = convert(Cint,102) -const CPX_CALLBACK_MIP_NODE = convert(Cint,103) -const CPX_CALLBACK_MIP_HEURISTIC = convert(Cint,104) -const CPX_CALLBACK_MIP_SOLVE = convert(Cint,105) -const CPX_CALLBACK_MIP_CUT_LOOP = convert(Cint,106) -const CPX_CALLBACK_MIP_PROBE = convert(Cint,107) -const CPX_CALLBACK_MIP_FRACCUT = convert(Cint,108) -const CPX_CALLBACK_MIP_DISJCUT = convert(Cint,109) -const CPX_CALLBACK_MIP_FLOWMIR = convert(Cint,110) -const CPX_CALLBACK_MIP_INCUMBENT_NODESOLN = convert(Cint,111) -const CPX_CALLBACK_MIP_DELETENODE = convert(Cint,112) -const CPX_CALLBACK_MIP_BRANCH_NOSOLN = convert(Cint,113) -const CPX_CALLBACK_MIP_CUT_LAST = convert(Cint,114) -const CPX_CALLBACK_MIP_CUT_FEAS = convert(Cint,115) -const CPX_CALLBACK_MIP_CUT_UNBD = convert(Cint,116) -const CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN = convert(Cint,117) -const CPX_CALLBACK_MIP_INCUMBENT_USERSOLN = convert(Cint,118) -const CPX_CALLBACK_MIP_INCUMBENT_MIPSTART = convert(Cint,119) -const CPX_CALLBACK_INFO_BEST_INTEGER = convert(Cint,101) -const CPX_CALLBACK_INFO_BEST_REMAINING = convert(Cint,102) -const CPX_CALLBACK_INFO_NODE_COUNT = convert(Cint,103) -const CPX_CALLBACK_INFO_NODES_LEFT = convert(Cint,104) -const CPX_CALLBACK_INFO_MIP_ITERATIONS = convert(Cint,105) -const CPX_CALLBACK_INFO_CUTOFF = convert(Cint,106) -const CPX_CALLBACK_INFO_CLIQUE_COUNT = convert(Cint,107) -const CPX_CALLBACK_INFO_COVER_COUNT = convert(Cint,108) -const CPX_CALLBACK_INFO_MIP_FEAS = convert(Cint,109) -const CPX_CALLBACK_INFO_FLOWCOVER_COUNT = convert(Cint,110) -const CPX_CALLBACK_INFO_GUBCOVER_COUNT = convert(Cint,111) -const CPX_CALLBACK_INFO_IMPLBD_COUNT = convert(Cint,112) -const CPX_CALLBACK_INFO_PROBE_PHASE = convert(Cint,113) -const CPX_CALLBACK_INFO_PROBE_PROGRESS = convert(Cint,114) -const CPX_CALLBACK_INFO_FRACCUT_COUNT = convert(Cint,115) -const CPX_CALLBACK_INFO_FRACCUT_PROGRESS = convert(Cint,116) -const CPX_CALLBACK_INFO_DISJCUT_COUNT = convert(Cint,117) -const CPX_CALLBACK_INFO_DISJCUT_PROGRESS = convert(Cint,118) -const CPX_CALLBACK_INFO_FLOWPATH_COUNT = convert(Cint,119) -const CPX_CALLBACK_INFO_MIRCUT_COUNT = convert(Cint,120) -const CPX_CALLBACK_INFO_FLOWMIR_PROGRESS = convert(Cint,121) -const CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT = convert(Cint,122) -const CPX_CALLBACK_INFO_MY_THREAD_NUM = convert(Cint,123) -const CPX_CALLBACK_INFO_USER_THREADS = convert(Cint,124) -const CPX_CALLBACK_INFO_MIP_REL_GAP = convert(Cint,125) -const CPX_CALLBACK_INFO_MCFCUT_COUNT = convert(Cint,126) -const CPX_CALLBACK_INFO_KAPPA_STABLE = convert(Cint,127) -const CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS = convert(Cint,128) -const CPX_CALLBACK_INFO_KAPPA_UNSTABLE = convert(Cint,129) -const CPX_CALLBACK_INFO_KAPPA_ILLPOSED = convert(Cint,130) -const CPX_CALLBACK_INFO_KAPPA_MAX = convert(Cint,131) -const CPX_CALLBACK_INFO_KAPPA_ATTENTION = convert(Cint,132) -const CPX_CALLBACK_INFO_LANDPCUT_COUNT = convert(Cint,133) -const CPX_CALLBACK_INFO_USERCUT_COUNT = convert(Cint,134) -const CPX_CALLBACK_INFO_TABLECUT_COUNT = convert(Cint,135) -const CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT = convert(Cint,136) -const CPX_CALLBACK_INFO_BENDERS_COUNT = convert(Cint,137) -const CPX_CALLBACK_INFO_NODE_COUNT_LONG = convert(Cint,140) -const CPX_CALLBACK_INFO_NODES_LEFT_LONG = convert(Cint,141) -const CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG = convert(Cint,142) -const CPX_CALLBACK_INFO_LAZY_SOURCE = convert(Cint,143) -const CPX_CALLBACK_INFO_NODE_SIINF = convert(Cint,201) -const CPX_CALLBACK_INFO_NODE_NIINF = convert(Cint,202) -const CPX_CALLBACK_INFO_NODE_ESTIMATE = convert(Cint,203) -const CPX_CALLBACK_INFO_NODE_DEPTH = convert(Cint,204) -const CPX_CALLBACK_INFO_NODE_OBJVAL = convert(Cint,205) -const CPX_CALLBACK_INFO_NODE_TYPE = convert(Cint,206) -const CPX_CALLBACK_INFO_NODE_VAR = convert(Cint,207) -const CPX_CALLBACK_INFO_NODE_SOS = convert(Cint,208) -const CPX_CALLBACK_INFO_NODE_SEQNUM = convert(Cint,209) -const CPX_CALLBACK_INFO_NODE_USERHANDLE = convert(Cint,210) -const CPX_CALLBACK_INFO_NODE_NODENUM = convert(Cint,211) -const CPX_CALLBACK_INFO_NODE_SEQNUM_LONG = convert(Cint,220) -const CPX_CALLBACK_INFO_NODE_NODENUM_LONG = convert(Cint,221) -const CPX_CALLBACK_INFO_NODE_DEPTH_LONG = convert(Cint,222) -const CPX_CALLBACK_INFO_SOS_TYPE = convert(Cint,240) -const CPX_CALLBACK_INFO_SOS_SIZE = convert(Cint,241) -const CPX_CALLBACK_INFO_SOS_IS_FEASIBLE = convert(Cint,242) -const CPX_CALLBACK_INFO_SOS_MEMBER_INDEX = convert(Cint,244) -const CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL = convert(Cint,246) -const CPX_CALLBACK_INFO_SOS_NUM = convert(Cint,247) -const CPX_CALLBACK_INFO_IC_NUM = convert(Cint,260) -const CPX_CALLBACK_INFO_IC_IMPLYING_VAR = convert(Cint,261) -const CPX_CALLBACK_INFO_IC_IMPLIED_VAR = convert(Cint,262) -const CPX_CALLBACK_INFO_IC_SENSE = convert(Cint,263) -const CPX_CALLBACK_INFO_IC_COMPL = convert(Cint,264) -const CPX_CALLBACK_INFO_IC_RHS = convert(Cint,265) -const CPX_CALLBACK_INFO_IC_IS_FEASIBLE = convert(Cint,266) -const CPX_INCUMBENT_ID = convert(Cint,-1) -const CPX_RAMPUP_DISABLED = convert(Cint,-1) -const CPX_RAMPUP_AUTO = convert(Cint,0) -const CPX_RAMPUP_DYNAMIC = convert(Cint,1) -const CPX_RAMPUP_INFINITE = convert(Cint,2) -const CPX_CALLBACK_DEFAULT = convert(Cint,0) -const CPX_CALLBACK_FAIL = convert(Cint,1) -const CPX_CALLBACK_SET = convert(Cint,2) -const CPX_CALLBACK_ABORT_CUT_LOOP = convert(Cint,3) -const CPX_USECUT_FORCE = convert(Cint,0) -const CPX_USECUT_PURGE = convert(Cint,1) -const CPX_USECUT_FILTER = convert(Cint,2) -const CPX_INTEGER_FEASIBLE = convert(Cint,0) -const CPX_INTEGER_INFEASIBLE = convert(Cint,1) -const CPX_IMPLIED_INTEGER_FEASIBLE = convert(Cint,2) -# const CPX_GCCONST_H = convert(Cint,) -const CPX_CON_LOWER_BOUND = convert(Cint,1) -const CPX_CON_UPPER_BOUND = convert(Cint,2) -const CPX_CON_LINEAR = convert(Cint,3) -const CPX_CON_QUADRATIC = convert(Cint,4) -const CPX_CON_SOS = convert(Cint,5) -const CPX_CON_INDICATOR = convert(Cint,6) -const CPX_CON_PWL = convert(Cint,7) -const CPX_CON_ABS = convert(Cint,7) -const CPX_CON_MINEXPR = convert(Cint,8) -const CPX_CON_MAXEXPR = convert(Cint,9) -const CPX_CON_LAST_CONTYPE = convert(Cint,10) -const CPX_INDICATOR_IF = convert(Cint,1) -const CPX_INDICATOR_ONLYIF = convert(Cint,2) -const CPX_INDICATOR_IFANDONLYIF = convert(Cint,3) -# const CPX_NETCONST_H = convert(Cint,) -const CPXNET_NO_DISPLAY_OBJECTIVE = convert(Cint,0) -const CPXNET_TRUE_OBJECTIVE = convert(Cint,1) -const CPXNET_PENALIZED_OBJECTIVE = convert(Cint,2) -const CPXNET_PRICE_AUTO = convert(Cint,0) -const CPXNET_PRICE_PARTIAL = convert(Cint,1) -const CPXNET_PRICE_MULT_PART = convert(Cint,2) -const CPXNET_PRICE_SORT_MULT_PART = convert(Cint,3) -const CPX_NETFIND_PURE = convert(Cint,1) -const CPX_NETFIND_REFLECT = convert(Cint,2) -const CPX_NETFIND_SCALE = convert(Cint,3) -# const CPX_QPCONST_H = convert(Cint,) -const CPX_QCPDUALS_NO = convert(Cint,0) -const CPX_QCPDUALS_IFPOSSIBLE = convert(Cint,1) -const CPX_QCPDUALS_FORCE = convert(Cint,2) -# const CPX_SOCPCONST_H = convert(Cint,) -# const CPX_BENDERS_ANNOTATION = convert(Cint,"cpxBendersPartition") -const CPX_BENDERS_MASTERVALUE = convert(Cint,0) -const CPX_BIGINT = convert(Cint,2100000000) -# const CPX_BIGLONG = convert(Clong,9223372036800000000LL) -const CPX_CALLBACKCONTEXT_CANDIDATE = convert(Clong,0x0020) -const CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS = convert(Clong,0x0010) -const CPX_CALLBACKCONTEXT_LOCAL_PROGRESS = convert(Clong,0x0008) -const CPX_CALLBACKCONTEXT_RELAXATION = convert(Clong,0x0040) -const CPX_CALLBACKCONTEXT_THREAD_DOWN = convert(Clong,0x0004) -const CPX_CALLBACKCONTEXT_THREAD_UP = convert(Clong,0x0002) -const CPX_DUAL_OBJ = convert(Cint,41) -const CPX_EXACT_KAPPA = convert(Cint,51) -const CPX_KAPPA = convert(Cint,39) -const CPX_KAPPA_ATTENTION = convert(Cint,57) -const CPX_KAPPA_ILLPOSED = convert(Cint,55) -const CPX_KAPPA_MAX = convert(Cint,56) -const CPX_KAPPA_STABLE = convert(Cint,52) -const CPX_KAPPA_SUSPICIOUS = convert(Cint,53) -const CPX_KAPPA_UNSTABLE = convert(Cint,54) -const CPX_LAZYCONSTRAINTCALLBACK_HEUR = CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN -const CPX_LAZYCONSTRAINTCALLBACK_MIPSTART = CPX_CALLBACK_MIP_INCUMBENT_MIPSTART -const CPX_LAZYCONSTRAINTCALLBACK_NODE = CPX_CALLBACK_MIP_INCUMBENT_NODESOLN -const CPX_MAX_COMP_SLACK = convert(Cint,19) -const CPX_MAX_DUAL_INFEAS = convert(Cint,5) -const CPX_MAX_DUAL_RESIDUAL = convert(Cint,15) -const CPX_MAX_INDSLACK_INFEAS = convert(Cint,49) -const CPX_MAX_INT_INFEAS = convert(Cint,9) -const CPX_MAX_PI = convert(Cint,25) -const CPX_MAX_PRIMAL_INFEAS = convert(Cint,1) -const CPX_MAX_PRIMAL_RESIDUAL = convert(Cint,11) -const CPX_MAX_PWLSLACK_INFEAS = convert(Cint,58) -const CPX_MAX_QCPRIMAL_RESIDUAL = convert(Cint,43) -const CPX_MAX_QCSLACK = convert(Cint,47) -const CPX_MAX_QCSLACK_INFEAS = convert(Cint,45) -const CPX_MAX_RED_COST = convert(Cint,29) -const CPX_MAX_SCALED_DUAL_INFEAS = convert(Cint,6) -const CPX_MAX_SCALED_DUAL_RESIDUAL = convert(Cint,16) -const CPX_MAX_SCALED_PI = convert(Cint,26) -const CPX_MAX_SCALED_PRIMAL_INFEAS = convert(Cint,2) -const CPX_MAX_SCALED_PRIMAL_RESIDUAL = convert(Cint,12) -const CPX_MAX_SCALED_RED_COST = convert(Cint,30) -const CPX_MAX_SCALED_SLACK = convert(Cint,28) -const CPX_MAX_SCALED_X = convert(Cint,24) -const CPX_MAX_SLACK = convert(Cint,27) -const CPX_MAX_X = convert(Cint,23) -const CPX_MULTIOBJ_BARITCNT = convert(Cint,4) -const CPX_MULTIOBJ_BESTOBJVAL = convert(Cint,15) -const CPX_MULTIOBJ_BLEND = convert(Cint,20) -const CPX_MULTIOBJ_DEGCNT = convert(Cint,7) -const CPX_MULTIOBJ_DETTIME = convert(Cint,3) -const CPX_MULTIOBJ_DEXCH = convert(Cint,13) -const CPX_MULTIOBJ_DPUSH = convert(Cint,12) -const CPX_MULTIOBJ_ERROR = convert(Cint,0) -const CPX_MULTIOBJ_ITCNT = convert(Cint,8) -const CPX_MULTIOBJ_METHOD = convert(Cint,18) -const CPX_MULTIOBJ_NODECNT = convert(Cint,16) -const CPX_MULTIOBJ_NODELEFTCNT = convert(Cint,19) -const CPX_MULTIOBJ_OBJVAL = convert(Cint,14) -const CPX_MULTIOBJ_PEXCH = convert(Cint,11) -const CPX_MULTIOBJ_PHASE1CNT = convert(Cint,9) -const CPX_MULTIOBJ_PPUSH = convert(Cint,10) -const CPX_MULTIOBJ_PRIORITY = convert(Cint,17) -const CPX_MULTIOBJ_SIFTITCNT = convert(Cint,5) -const CPX_MULTIOBJ_SIFTPHASE1CNT = convert(Cint,6) -const CPX_MULTIOBJ_STATUS = convert(Cint,1) -const CPX_MULTIOBJ_TIME = convert(Cint,2) -#const CPX_NO_ABSTOL_CHANGE = convert(Cint,NAN) -#const CPX_NO_OFFSET_CHANGE = convert(Cint,NAN) -const CPX_NO_PRIORITY_CHANGE = convert(Cint,-1) -#const CPX_NO_RELTOL_CHANGE = convert(Cint,NAN) -#const CPX_NO_WEIGHT_CHANGE = convert(Cint,NAN) -const CPX_OBJ_GAP = convert(Cint,40) -const CPX_PRIMAL_OBJ = convert(Cint,42) -const CPX_SOLNPOOL_DIV = convert(Cint,2) -const CPX_SOLNPOOL_FIFO = convert(Cint,0) -const CPX_SOLNPOOL_FILTER_DIVERSITY = convert(Cint,1) -const CPX_SOLNPOOL_FILTER_RANGE = convert(Cint,2) -const CPX_SOLNPOOL_OBJ = convert(Cint,1) -const CPX_STAT_ABORT_DETTIME_LIM = convert(Cint,25) -const CPX_STAT_ABORT_DUAL_OBJ_LIM = convert(Cint,22) -const CPX_STAT_ABORT_IT_LIM = convert(Cint,10) -const CPX_STAT_ABORT_OBJ_LIM = convert(Cint,12) -const CPX_STAT_ABORT_PRIM_OBJ_LIM = convert(Cint,21) -const CPX_STAT_ABORT_TIME_LIM = convert(Cint,11) -const CPX_STAT_ABORT_USER = convert(Cint,13) -const CPX_STAT_BENDERS_MASTER_UNBOUNDED = convert(Cint,40) -const CPX_STAT_BENDERS_NUM_BEST = convert(Cint,41) -const CPX_STAT_CONFLICT_ABORT_CONTRADICTION = convert(Cint,32) -const CPX_STAT_CONFLICT_ABORT_DETTIME_LIM = convert(Cint,39) -const CPX_STAT_CONFLICT_ABORT_IT_LIM = convert(Cint,34) -const CPX_STAT_CONFLICT_ABORT_MEM_LIM = convert(Cint,37) -const CPX_STAT_CONFLICT_ABORT_NODE_LIM = convert(Cint,35) -const CPX_STAT_CONFLICT_ABORT_OBJ_LIM = convert(Cint,36) -const CPX_STAT_CONFLICT_ABORT_TIME_LIM = convert(Cint,33) -const CPX_STAT_CONFLICT_ABORT_USER = convert(Cint,38) -const CPX_STAT_CONFLICT_FEASIBLE = convert(Cint,30) -const CPX_STAT_CONFLICT_MINIMAL = convert(Cint,31) -const CPX_STAT_FEASIBLE = convert(Cint,23) -const CPX_STAT_FEASIBLE_RELAXED_INF = convert(Cint,16) -const CPX_STAT_FEASIBLE_RELAXED_QUAD = convert(Cint,18) -const CPX_STAT_FEASIBLE_RELAXED_SUM = convert(Cint,14) -const CPX_STAT_FIRSTORDER = convert(Cint,24) -const CPX_STAT_INFEASIBLE = convert(Cint,3) -const CPX_STAT_INForUNBD = convert(Cint,4) -const CPX_STAT_MULTIOBJ_INFEASIBLE = convert(Cint,302) -const CPX_STAT_MULTIOBJ_INForUNBD = convert(Cint,303) -const CPX_STAT_MULTIOBJ_NON_OPTIMAL = convert(Cint,305) -const CPX_STAT_MULTIOBJ_OPTIMAL = convert(Cint,301) -const CPX_STAT_MULTIOBJ_STOPPED = convert(Cint,306) -const CPX_STAT_MULTIOBJ_UNBOUNDED = convert(Cint,304) -const CPX_STAT_NUM_BEST = convert(Cint,6) -const CPX_STAT_OPTIMAL = convert(Cint,1) -const CPX_STAT_OPTIMAL_FACE_UNBOUNDED = convert(Cint,20) -const CPX_STAT_OPTIMAL_INFEAS = convert(Cint,5) -const CPX_STAT_OPTIMAL_RELAXED_INF = convert(Cint,17) -const CPX_STAT_OPTIMAL_RELAXED_QUAD = convert(Cint,19) -const CPX_STAT_OPTIMAL_RELAXED_SUM = convert(Cint,15) -const CPX_STAT_UNBOUNDED = convert(Cint,2) -const CPX_SUM_COMP_SLACK = convert(Cint,21) -const CPX_SUM_DUAL_INFEAS = convert(Cint,7) -const CPX_SUM_DUAL_RESIDUAL = convert(Cint,17) -const CPX_SUM_INDSLACK_INFEAS = convert(Cint,50) -const CPX_SUM_INT_INFEAS = convert(Cint,10) -const CPX_SUM_PI = convert(Cint,33) -const CPX_SUM_PRIMAL_INFEAS = convert(Cint,3) -const CPX_SUM_PRIMAL_RESIDUAL = convert(Cint,13) -const CPX_SUM_PWLSLACK_INFEAS = convert(Cint,59) -const CPX_SUM_QCPRIMAL_RESIDUAL = convert(Cint,44) -const CPX_SUM_QCSLACK = convert(Cint,48) -const CPX_SUM_QCSLACK_INFEAS = convert(Cint,46) -const CPX_SUM_RED_COST = convert(Cint,37) -const CPX_SUM_SCALED_DUAL_INFEAS = convert(Cint,8) -const CPX_SUM_SCALED_DUAL_RESIDUAL = convert(Cint,18) -const CPX_SUM_SCALED_PI = convert(Cint,34) -const CPX_SUM_SCALED_PRIMAL_INFEAS = convert(Cint,4) -const CPX_SUM_SCALED_PRIMAL_RESIDUAL = convert(Cint,14) -const CPX_SUM_SCALED_RED_COST = convert(Cint,38) -const CPX_SUM_SCALED_SLACK = convert(Cint,36) -const CPX_SUM_SCALED_X = convert(Cint,32) -const CPX_SUM_SLACK = convert(Cint,35) -const CPX_SUM_X = convert(Cint,31) -const CPXERR_ABORT_STRONGBRANCH = convert(Cint,1263) -const CPXERR_ADJ_SIGN_QUAD = convert(Cint,1606) -const CPXERR_ADJ_SIGN_SENSE = convert(Cint,1604) -const CPXERR_ADJ_SIGNS = convert(Cint,1602) -const CPXERR_ARC_INDEX_RANGE = convert(Cint,1231) -const CPXERR_ARRAY_BAD_SOS_TYPE = convert(Cint,3009) -const CPXERR_ARRAY_NOT_ASCENDING = convert(Cint,1226) -const CPXERR_ARRAY_TOO_LONG = convert(Cint,1208) -const CPXERR_BAD_ARGUMENT = convert(Cint,1003) -const CPXERR_BAD_BOUND_SENSE = convert(Cint,1622) -const CPXERR_BAD_BOUND_TYPE = convert(Cint,1457) -const CPXERR_BAD_CHAR = convert(Cint,1537) -const CPXERR_BAD_CTYPE = convert(Cint,3021) -const CPXERR_BAD_DECOMPOSITION = convert(Cint,2002) -const CPXERR_BAD_DIRECTION = convert(Cint,3012) -const CPXERR_BAD_EXPO_RANGE = convert(Cint,1435) -const CPXERR_BAD_EXPONENT = convert(Cint,1618) -const CPXERR_BAD_FILETYPE = convert(Cint,1424) -const CPXERR_BAD_ID = convert(Cint,1617) -const CPXERR_BAD_INDCONSTR = convert(Cint,1439) -const CPXERR_BAD_INDICATOR = convert(Cint,1551) -const CPXERR_BAD_INDTYPE = convert(Cint,1216) -const CPXERR_BAD_LAZY_UCUT = convert(Cint,1438) -const CPXERR_BAD_LUB = convert(Cint,1229) -const CPXERR_BAD_METHOD = convert(Cint,1292) -const CPXERR_BAD_MULTIOBJ_ATTR = convert(Cint,1488) -const CPXERR_BAD_NUMBER = convert(Cint,1434) -const CPXERR_BAD_OBJ_SENSE = convert(Cint,1487) -const CPXERR_BAD_PARAM_NAME = convert(Cint,1028) -const CPXERR_BAD_PARAM_NUM = convert(Cint,1013) -const CPXERR_BAD_PIVOT = convert(Cint,1267) -const CPXERR_BAD_PRIORITY = convert(Cint,3006) -const CPXERR_BAD_PROB_TYPE = convert(Cint,1022) -const CPXERR_BAD_ROW_ID = convert(Cint,1532) -const CPXERR_BAD_SECTION_BOUNDS = convert(Cint,1473) -const CPXERR_BAD_SECTION_ENDATA = convert(Cint,1462) -const CPXERR_BAD_SECTION_QMATRIX = convert(Cint,1475) -const CPXERR_BAD_SENSE = convert(Cint,1215) -const CPXERR_BAD_SOS_TYPE = convert(Cint,1442) -const CPXERR_BAD_STATUS = convert(Cint,1253) -const CPXERR_BAS_FILE_SHORT = convert(Cint,1550) -const CPXERR_BAS_FILE_SIZE = convert(Cint,1555) -const CPXERR_BENDERS_MASTER_SOLVE = convert(Cint,2001) -const CPXERR_CALLBACK = convert(Cint,1006) -const CPXERR_CALLBACK_INCONSISTENT = convert(Cint,1060) -const CPXERR_CAND_NOT_POINT = convert(Cint,3025) -const CPXERR_CAND_NOT_RAY = convert(Cint,3026) -const CPXERR_CNTRL_IN_NAME = convert(Cint,1236) -const CPXERR_COL_INDEX_RANGE = convert(Cint,1201) -const CPXERR_COL_REPEAT_PRINT = convert(Cint,1478) -const CPXERR_COL_REPEATS = convert(Cint,1446) -const CPXERR_COL_ROW_REPEATS = convert(Cint,1443) -const CPXERR_COL_UNKNOWN = convert(Cint,1449) -const CPXERR_CONFLICT_UNSTABLE = convert(Cint,1720) -const CPXERR_COUNT_OVERLAP = convert(Cint,1228) -const CPXERR_COUNT_RANGE = convert(Cint,1227) -const CPXERR_CPUBINDING_FAILURE = convert(Cint,3700) -const CPXERR_DBL_MAX = convert(Cint,1233) -const CPXERR_DECOMPRESSION = convert(Cint,1027) -const CPXERR_DETTILIM_STRONGBRANCH = convert(Cint,1270) -const CPXERR_DUP_ENTRY = convert(Cint,1222) -const CPXERR_DYNFUNC = convert(Cint,1815) -const CPXERR_DYNLOAD = convert(Cint,1814) -const CPXERR_ENCODING_CONVERSION = convert(Cint,1235) -const CPXERR_EXTRA_BV_BOUND = convert(Cint,1456) -const CPXERR_EXTRA_FR_BOUND = convert(Cint,1455) -const CPXERR_EXTRA_FX_BOUND = convert(Cint,1454) -const CPXERR_EXTRA_INTEND = convert(Cint,1481) -const CPXERR_EXTRA_INTORG = convert(Cint,1480) -const CPXERR_EXTRA_SOSEND = convert(Cint,1483) -const CPXERR_EXTRA_SOSORG = convert(Cint,1482) -const CPXERR_FAIL_OPEN_READ = convert(Cint,1423) -const CPXERR_FAIL_OPEN_WRITE = convert(Cint,1422) -const CPXERR_FILE_ENTRIES = convert(Cint,1553) -const CPXERR_FILE_FORMAT = convert(Cint,1563) -const CPXERR_FILE_IO = convert(Cint,1426) -const CPXERR_FILTER_VARIABLE_TYPE = convert(Cint,3414) -const CPXERR_ILL_DEFINED_PWL = convert(Cint,1213) -const CPXERR_IN_INFOCALLBACK = convert(Cint,1804) -const CPXERR_INDEX_NOT_BASIC = convert(Cint,1251) -const CPXERR_INDEX_RANGE = convert(Cint,1200) -const CPXERR_INDEX_RANGE_HIGH = convert(Cint,1206) -const CPXERR_INDEX_RANGE_LOW = convert(Cint,1205) -const CPXERR_INT_TOO_BIG = convert(Cint,3018) -const CPXERR_INT_TOO_BIG_INPUT = convert(Cint,1463) -const CPXERR_INVALID_NUMBER = convert(Cint,1650) -const CPXERR_LIMITS_TOO_BIG = convert(Cint,1012) -const CPXERR_LINE_TOO_LONG = convert(Cint,1465) -const CPXERR_LO_BOUND_REPEATS = convert(Cint,1459) -const CPXERR_LOCK_CREATE = convert(Cint,1808) -const CPXERR_LP_NOT_IN_ENVIRONMENT = convert(Cint,1806) -const CPXERR_LP_PARSE = convert(Cint,1427) -const CPXERR_MASTER_SOLVE = convert(Cint,2005) -const CPXERR_MIPSEARCH_WITH_CALLBACKS = convert(Cint,1805) -const CPXERR_MISS_SOS_TYPE = convert(Cint,3301) -const CPXERR_MSG_NO_CHANNEL = convert(Cint,1051) -const CPXERR_MSG_NO_FILEPTR = convert(Cint,1052) -const CPXERR_MSG_NO_FUNCTION = convert(Cint,1053) -const CPXERR_MULTIOBJ_SUBPROB_SOLVE = convert(Cint,1300) -const CPXERR_MULTIPLE_PROBS_IN_REMOTE_ENVIRONMENT = convert(Cint,1816) -const CPXERR_NAME_CREATION = convert(Cint,1209) -const CPXERR_NAME_NOT_FOUND = convert(Cint,1210) -const CPXERR_NAME_TOO_LONG = convert(Cint,1464) -const CPXERR_NAN = convert(Cint,1225) -const CPXERR_NEED_OPT_SOLN = convert(Cint,1252) -const CPXERR_NEGATIVE_SURPLUS = convert(Cint,1207) -const CPXERR_NET_DATA = convert(Cint,1530) -const CPXERR_NET_FILE_SHORT = convert(Cint,1538) -const CPXERR_NO_BARRIER_SOLN = convert(Cint,1223) -const CPXERR_NO_BASIC_SOLN = convert(Cint,1261) -const CPXERR_NO_BASIS = convert(Cint,1262) -const CPXERR_NO_BOUND_SENSE = convert(Cint,1621) -const CPXERR_NO_BOUND_TYPE = convert(Cint,1460) -const CPXERR_NO_COLUMNS_SECTION = convert(Cint,1472) -const CPXERR_NO_CONFLICT = convert(Cint,1719) -const CPXERR_NO_DECOMPOSITION = convert(Cint,2000) -const CPXERR_NO_DUAL_SOLN = convert(Cint,1232) -const CPXERR_NO_ENDATA = convert(Cint,1552) -const CPXERR_NO_ENVIRONMENT = convert(Cint,1002) -const CPXERR_NO_FILENAME = convert(Cint,1421) -const CPXERR_NO_ID = convert(Cint,1616) -const CPXERR_NO_ID_FIRST = convert(Cint,1609) -const CPXERR_NO_INT_X = convert(Cint,3023) -const CPXERR_NO_KAPPASTATS = convert(Cint,1269) -const CPXERR_NO_LU_FACTOR = convert(Cint,1258) -const CPXERR_NO_MEMORY = convert(Cint,1001) -const CPXERR_NO_MIPSTART = convert(Cint,3020) -const CPXERR_NO_NAME_SECTION = convert(Cint,1441) -const CPXERR_NO_NAMES = convert(Cint,1219) -const CPXERR_NO_NORMS = convert(Cint,1264) -const CPXERR_NO_NUMBER = convert(Cint,1615) -const CPXERR_NO_NUMBER_BOUND = convert(Cint,1623) -const CPXERR_NO_NUMBER_FIRST = convert(Cint,1611) -const CPXERR_NO_OBJ_NAME = convert(Cint,1489) -const CPXERR_NO_OBJ_SENSE = convert(Cint,1436) -const CPXERR_NO_OBJECTIVE = convert(Cint,1476) -const CPXERR_NO_OP_OR_SENSE = convert(Cint,1608) -const CPXERR_NO_OPERATOR = convert(Cint,1607) -const CPXERR_NO_ORDER = convert(Cint,3016) -const CPXERR_NO_PROBLEM = convert(Cint,1009) -const CPXERR_NO_QP_OPERATOR = convert(Cint,1614) -const CPXERR_NO_QUAD_EXP = convert(Cint,1612) -const CPXERR_NO_RHS_COEFF = convert(Cint,1610) -const CPXERR_NO_RHS_IN_OBJ = convert(Cint,1211) -const CPXERR_NO_ROW_NAME = convert(Cint,1486) -const CPXERR_NO_ROW_SENSE = convert(Cint,1453) -const CPXERR_NO_ROWS_SECTION = convert(Cint,1471) -const CPXERR_NO_SENSIT = convert(Cint,1260) -const CPXERR_NO_SOLN = convert(Cint,1217) -const CPXERR_NO_SOLNPOOL = convert(Cint,3024) -const CPXERR_NO_SOS = convert(Cint,3015) -const CPXERR_NO_TREE = convert(Cint,3412) -const CPXERR_NO_VECTOR_SOLN = convert(Cint,1556) -const CPXERR_NODE_INDEX_RANGE = convert(Cint,1230) -const CPXERR_NODE_ON_DISK = convert(Cint,3504) -const CPXERR_NOT_DUAL_UNBOUNDED = convert(Cint,1265) -const CPXERR_NOT_FIXED = convert(Cint,1221) -const CPXERR_NOT_FOR_BENDERS = convert(Cint,2004) -const CPXERR_NOT_FOR_DISTMIP = convert(Cint,1071) -const CPXERR_NOT_FOR_MIP = convert(Cint,1017) -const CPXERR_NOT_FOR_MULTIOBJ = convert(Cint,1070) -const CPXERR_NOT_FOR_QCP = convert(Cint,1031) -const CPXERR_NOT_FOR_QP = convert(Cint,1018) -const CPXERR_NOT_MILPCLASS = convert(Cint,1024) -const CPXERR_NOT_MIN_COST_FLOW = convert(Cint,1531) -const CPXERR_NOT_MIP = convert(Cint,3003) -const CPXERR_NOT_MIQPCLASS = convert(Cint,1029) -const CPXERR_NOT_ONE_PROBLEM = convert(Cint,1023) -const CPXERR_NOT_QP = convert(Cint,5004) -const CPXERR_NOT_SAV_FILE = convert(Cint,1560) -const CPXERR_NOT_UNBOUNDED = convert(Cint,1254) -const CPXERR_NULL_POINTER = convert(Cint,1004) -const CPXERR_ORDER_BAD_DIRECTION = convert(Cint,3007) -const CPXERR_OVERFLOW = convert(Cint,1810) -const CPXERR_PARAM_INCOMPATIBLE = convert(Cint,1807) -const CPXERR_PARAM_TOO_BIG = convert(Cint,1015) -const CPXERR_PARAM_TOO_SMALL = convert(Cint,1014) -const CPXERR_PRESLV_ABORT = convert(Cint,1106) -const CPXERR_PRESLV_BAD_PARAM = convert(Cint,1122) -const CPXERR_PRESLV_BASIS_MEM = convert(Cint,1107) -const CPXERR_PRESLV_COPYORDER = convert(Cint,1109) -const CPXERR_PRESLV_COPYSOS = convert(Cint,1108) -const CPXERR_PRESLV_CRUSHFORM = convert(Cint,1121) -const CPXERR_PRESLV_DETTIME_LIM = convert(Cint,1124) -const CPXERR_PRESLV_DUAL = convert(Cint,1119) -const CPXERR_PRESLV_FAIL_BASIS = convert(Cint,1114) -const CPXERR_PRESLV_INF = convert(Cint,1117) -const CPXERR_PRESLV_INForUNBD = convert(Cint,1101) -const CPXERR_PRESLV_NO_BASIS = convert(Cint,1115) -const CPXERR_PRESLV_NO_PROB = convert(Cint,1103) -const CPXERR_PRESLV_SOLN_MIP = convert(Cint,1110) -const CPXERR_PRESLV_SOLN_QP = convert(Cint,1111) -const CPXERR_PRESLV_START_LP = convert(Cint,1112) -const CPXERR_PRESLV_TIME_LIM = convert(Cint,1123) -const CPXERR_PRESLV_UNBD = convert(Cint,1118) -const CPXERR_PRESLV_UNCRUSHFORM = convert(Cint,1120) -const CPXERR_PRIIND = convert(Cint,1257) -const CPXERR_PRM_DATA = convert(Cint,1660) -# const CPXERR_PRM_HEADER = convert(Cint,1661) -const CPXERR_PROTOCOL = convert(Cint,1812) -const CPXERR_Q_DIVISOR = convert(Cint,1619) -const CPXERR_Q_DUP_ENTRY = convert(Cint,5011) -const CPXERR_Q_NOT_INDEF = convert(Cint,5014) -const CPXERR_Q_NOT_POS_DEF = convert(Cint,5002) -const CPXERR_Q_NOT_SYMMETRIC = convert(Cint,5012) -const CPXERR_QCP_SENSE = convert(Cint,6002) -const CPXERR_QCP_SENSE_FILE = convert(Cint,1437) -const CPXERR_QUAD_EXP_NOT_2 = convert(Cint,1613) -const CPXERR_QUAD_IN_ROW = convert(Cint,1605) -const CPXERR_RANGE_SECTION_ORDER = convert(Cint,1474) -const CPXERR_RESTRICTED_VERSION = convert(Cint,1016) -const CPXERR_RHS_IN_OBJ = convert(Cint,1603) -const CPXERR_RIM_REPEATS = convert(Cint,1447) -const CPXERR_RIM_ROW_REPEATS = convert(Cint,1444) -const CPXERR_RIMNZ_REPEATS = convert(Cint,1479) -const CPXERR_ROW_INDEX_RANGE = convert(Cint,1203) -const CPXERR_ROW_REPEAT_PRINT = convert(Cint,1477) -const CPXERR_ROW_REPEATS = convert(Cint,1445) -const CPXERR_ROW_UNKNOWN = convert(Cint,1448) -const CPXERR_SAV_FILE_DATA = convert(Cint,1561) -const CPXERR_SAV_FILE_VALUE = convert(Cint,1564) -const CPXERR_SAV_FILE_WRITE = convert(Cint,1562) -const CPXERR_SBASE_ILLEGAL = convert(Cint,1554) -const CPXERR_SBASE_INCOMPAT = convert(Cint,1255) -const CPXERR_SINGULAR = convert(Cint,1256) -const CPXERR_STR_PARAM_TOO_LONG = convert(Cint,1026) -const CPXERR_SUBPROB_SOLVE = convert(Cint,3019) -const CPXERR_SYNCPRIM_CREATE = convert(Cint,1809) -const CPXERR_SYSCALL = convert(Cint,1813) -const CPXERR_THREAD_FAILED = convert(Cint,1234) -const CPXERR_TILIM_CONDITION_NO = convert(Cint,1268) -const CPXERR_TILIM_STRONGBRANCH = convert(Cint,1266) -const CPXERR_TOO_MANY_COEFFS = convert(Cint,1433) -const CPXERR_TOO_MANY_COLS = convert(Cint,1432) -const CPXERR_TOO_MANY_RIMNZ = convert(Cint,1485) -const CPXERR_TOO_MANY_RIMS = convert(Cint,1484) -const CPXERR_TOO_MANY_ROWS = convert(Cint,1431) -const CPXERR_TOO_MANY_THREADS = convert(Cint,1020) -const CPXERR_TREE_MEMORY_LIMIT = convert(Cint,3413) -const CPXERR_TUNE_MIXED = convert(Cint,1730) -const CPXERR_UNIQUE_WEIGHTS = convert(Cint,3010) -const CPXERR_UNSUPPORTED_CONSTRAINT_TYPE = convert(Cint,1212) -const CPXERR_UNSUPPORTED_OPERATION = convert(Cint,1811) -const CPXERR_UP_BOUND_REPEATS = convert(Cint,1458) -const CPXERR_WORK_FILE_OPEN = convert(Cint,1801) -const CPXERR_WORK_FILE_READ = convert(Cint,1802) -const CPXERR_WORK_FILE_WRITE = convert(Cint,1803) -const CPXERR_XMLPARSE = convert(Cint,1425) -const CPXMESSAGEBUFSIZE = convert(Cint,1024) -const CPXMI_BIGM_COEF = convert(Cint,1040) -const CPXMI_BIGM_TO_IND = convert(Cint,1041) -const CPXMI_BIGM_VARBOUND = convert(Cint,1042) -const CPXMI_CANCEL_TOL = convert(Cint,1045) -const CPXMI_EPGAP_LARGE = convert(Cint,1038) -const CPXMI_EPGAP_OBJOFFSET = convert(Cint,1037) -const CPXMI_FEAS_TOL = convert(Cint,1043) -const CPXMI_FRACTION_SCALING = convert(Cint,1047) -const CPXMI_IND_NZ_LARGE_NUM = convert(Cint,1019) -const CPXMI_IND_NZ_SMALL_NUM = convert(Cint,1020) -const CPXMI_IND_RHS_LARGE_NUM = convert(Cint,1021) -const CPXMI_IND_RHS_SMALL_NUM = convert(Cint,1022) -const CPXMI_KAPPA_ILLPOSED = convert(Cint,1035) -const CPXMI_KAPPA_SUSPICIOUS = convert(Cint,1033) -const CPXMI_KAPPA_UNSTABLE = convert(Cint,1034) -const CPXMI_LB_LARGE_NUM = convert(Cint,1003) -const CPXMI_LB_SMALL_NUM = convert(Cint,1004) -const CPXMI_LC_NZ_LARGE_NUM = convert(Cint,1023) -const CPXMI_LC_NZ_SMALL_NUM = convert(Cint,1024) -const CPXMI_LC_RHS_LARGE_NUM = convert(Cint,1025) -const CPXMI_LC_RHS_SMALL_NUM = convert(Cint,1026) -const CPXMI_MULTIOBJ_COEFFS = convert(Cint,1062) -const CPXMI_MULTIOBJ_LARGE_NUM = convert(Cint,1058) -const CPXMI_MULTIOBJ_MIX = convert(Cint,1063) -const CPXMI_MULTIOBJ_OPT_TOL = convert(Cint,1060) -const CPXMI_MULTIOBJ_SMALL_NUM = convert(Cint,1059) -const CPXMI_NZ_LARGE_NUM = convert(Cint,1009) -const CPXMI_NZ_SMALL_NUM = convert(Cint,1010) -const CPXMI_OBJ_LARGE_NUM = convert(Cint,1001) -const CPXMI_OBJ_SMALL_NUM = convert(Cint,1002) -const CPXMI_OPT_TOL = convert(Cint,1044) -const CPXMI_QC_LINNZ_LARGE_NUM = convert(Cint,1015) -const CPXMI_QC_LINNZ_SMALL_NUM = convert(Cint,1016) -const CPXMI_QC_QNZ_LARGE_NUM = convert(Cint,1017) -const CPXMI_QC_QNZ_SMALL_NUM = convert(Cint,1018) -const CPXMI_QC_RHS_LARGE_NUM = convert(Cint,1013) -const CPXMI_QC_RHS_SMALL_NUM = convert(Cint,1014) -const CPXMI_QOBJ_LARGE_NUM = convert(Cint,1011) -const CPXMI_QOBJ_SMALL_NUM = convert(Cint,1012) -const CPXMI_QOPT_TOL = convert(Cint,1046) -const CPXMI_RHS_LARGE_NUM = convert(Cint,1007) -const CPXMI_RHS_SMALL_NUM = convert(Cint,1008) -const CPXMI_SAMECOEFF_COL = convert(Cint,1050) -const CPXMI_SAMECOEFF_IND = convert(Cint,1051) -const CPXMI_SAMECOEFF_LAZY = convert(Cint,1054) -const CPXMI_SAMECOEFF_MULTIOBJ = convert(Cint,1061) -const CPXMI_SAMECOEFF_OBJ = convert(Cint,1057) -const CPXMI_SAMECOEFF_QLIN = convert(Cint,1052) -const CPXMI_SAMECOEFF_QUAD = convert(Cint,1053) -const CPXMI_SAMECOEFF_RHS = convert(Cint,1056) -const CPXMI_SAMECOEFF_ROW = convert(Cint,1049) -const CPXMI_SAMECOEFF_UCUT = convert(Cint,1055) -const CPXMI_SINGLE_PRECISION = convert(Cint,1036) -const CPXMI_SYMMETRY_BREAKING_INEQ = convert(Cint,1039) -const CPXMI_UB_LARGE_NUM = convert(Cint,1005) -const CPXMI_UB_SMALL_NUM = convert(Cint,1006) -const CPXMI_UC_NZ_LARGE_NUM = convert(Cint,1027) -const CPXMI_UC_NZ_SMALL_NUM = convert(Cint,1028) -const CPXMI_UC_RHS_LARGE_NUM = convert(Cint,1029) -const CPXMI_UC_RHS_SMALL_NUM = convert(Cint,1030) -const CPXMI_WIDE_COEFF_RANGE = convert(Cint,1048) -const CPXMIP_ABORT_FEAS = convert(Cint,113) -const CPXMIP_ABORT_INFEAS = convert(Cint,114) -const CPXMIP_ABORT_RELAXATION_UNBOUNDED = convert(Cint,133) -const CPXMIP_ABORT_RELAXED = convert(Cint,126) -const CPXMIP_BENDERS_MASTER_UNBOUNDED = convert(Cint,134) -const CPXMIP_DETTIME_LIM_FEAS = convert(Cint,131) -const CPXMIP_DETTIME_LIM_INFEAS = convert(Cint,132) -const CPXMIP_FAIL_FEAS = convert(Cint,109) -const CPXMIP_FAIL_FEAS_NO_TREE = convert(Cint,116) -const CPXMIP_FAIL_INFEAS = convert(Cint,110) -const CPXMIP_FAIL_INFEAS_NO_TREE = convert(Cint,117) -const CPXMIP_FEASIBLE = convert(Cint,127) -const CPXMIP_FEASIBLE_RELAXED_INF = convert(Cint,122) -const CPXMIP_FEASIBLE_RELAXED_QUAD = convert(Cint,124) -const CPXMIP_FEASIBLE_RELAXED_SUM = convert(Cint,120) -const CPXMIP_INFEASIBLE = convert(Cint,103) -const CPXMIP_INForUNBD = convert(Cint,119) -const CPXMIP_MEM_LIM_FEAS = convert(Cint,111) -const CPXMIP_MEM_LIM_INFEAS = convert(Cint,112) -const CPXMIP_NODE_LIM_FEAS = convert(Cint,105) -const CPXMIP_NODE_LIM_INFEAS = convert(Cint,106) -const CPXMIP_OPTIMAL = convert(Cint,101) -const CPXMIP_OPTIMAL_INFEAS = convert(Cint,115) -const CPXMIP_OPTIMAL_POPULATED = convert(Cint,129) -const CPXMIP_OPTIMAL_POPULATED_TOL = convert(Cint,130) -const CPXMIP_OPTIMAL_RELAXED_INF = convert(Cint,123) -const CPXMIP_OPTIMAL_RELAXED_QUAD = convert(Cint,125) -const CPXMIP_OPTIMAL_RELAXED_SUM = convert(Cint,121) -const CPXMIP_OPTIMAL_TOL = convert(Cint,102) -const CPXMIP_POPULATESOL_LIM = convert(Cint,128) -const CPXMIP_SOL_LIM = convert(Cint,104) -const CPXMIP_TIME_LIM_FEAS = convert(Cint,107) -const CPXMIP_TIME_LIM_INFEAS = convert(Cint,108) -const CPXMIP_UNBOUNDED = convert(Cint,118) -const CPXPARAM_H = convert(Cint,1) -const CPXPARAM_Advance = convert(Cint,1001) -const CPXPARAM_Barrier_Algorithm = convert(Cint,3007) -const CPXPARAM_Barrier_ColNonzeros = convert(Cint,3009) -const CPXPARAM_Barrier_ConvergeTol = convert(Cint,3002) -const CPXPARAM_Barrier_Crossover = convert(Cint,3018) -const CPXPARAM_Barrier_Display = convert(Cint,3010) -const CPXPARAM_Barrier_Limits_Corrections = convert(Cint,3013) -const CPXPARAM_Barrier_Limits_Growth = convert(Cint,3003) -const CPXPARAM_Barrier_Limits_Iteration = convert(Cint,3012) -const CPXPARAM_Barrier_Limits_ObjRange = convert(Cint,3004) -const CPXPARAM_Barrier_Ordering = convert(Cint,3014) -const CPXPARAM_Barrier_QCPConvergeTol = convert(Cint,3020) -const CPXPARAM_Barrier_StartAlg = convert(Cint,3017) -const CPXPARAM_Benders_Strategy = convert(Cint,1501) -const CPXPARAM_Benders_Tolerances_feasibilitycut = convert(Cint,1509) -const CPXPARAM_Benders_Tolerances_optimalitycut = convert(Cint,1510) -const CPXPARAM_Benders_WorkerAlgorithm = convert(Cint,1500) -const CPXPARAM_ClockType = convert(Cint,1006) -const CPXPARAM_Conflict_Algorithm = convert(Cint,1073) -const CPXPARAM_Conflict_Display = convert(Cint,1074) -const CPXPARAM_CPUmask = convert(Cint,1144) -const CPXPARAM_DetTimeLimit = convert(Cint,1127) -const CPXPARAM_DistMIP_Rampup_DetTimeLimit = convert(Cint,2164) -const CPXPARAM_DistMIP_Rampup_Duration = convert(Cint,2163) -const CPXPARAM_DistMIP_Rampup_TimeLimit = convert(Cint,2165) -const CPXPARAM_Emphasis_Memory = convert(Cint,1082) -const CPXPARAM_Emphasis_MIP = convert(Cint,2058) -const CPXPARAM_Emphasis_Numerical = convert(Cint,1083) -const CPXPARAM_Feasopt_Mode = convert(Cint,1084) -const CPXPARAM_Feasopt_Tolerance = convert(Cint,2073) -const CPXPARAM_LPMethod = convert(Cint,1062) -const CPXPARAM_MIP_Cuts_BQP = convert(Cint,2195) -const CPXPARAM_MIP_Cuts_Cliques = convert(Cint,2003) -const CPXPARAM_MIP_Cuts_Covers = convert(Cint,2005) -const CPXPARAM_MIP_Cuts_Disjunctive = convert(Cint,2053) -const CPXPARAM_MIP_Cuts_FlowCovers = convert(Cint,2040) -const CPXPARAM_MIP_Cuts_Gomory = convert(Cint,2049) -const CPXPARAM_MIP_Cuts_GUBCovers = convert(Cint,2044) -const CPXPARAM_MIP_Cuts_Implied = convert(Cint,2041) -const CPXPARAM_MIP_Cuts_LiftProj = convert(Cint,2152) -const CPXPARAM_MIP_Cuts_LocalImplied = convert(Cint,2181) -const CPXPARAM_MIP_Cuts_MCFCut = convert(Cint,2134) -const CPXPARAM_MIP_Cuts_MIRCut = convert(Cint,2052) -const CPXPARAM_MIP_Cuts_PathCut = convert(Cint,2051) -const CPXPARAM_MIP_Cuts_RLT = convert(Cint,2196) -const CPXPARAM_MIP_Cuts_ZeroHalfCut = convert(Cint,2111) -const CPXPARAM_MIP_Display = convert(Cint,2012) -const CPXPARAM_MIP_Interval = convert(Cint,2013) -const CPXPARAM_MIP_Limits_AggForCut = convert(Cint,2054) -const CPXPARAM_MIP_Limits_AuxRootThreads = convert(Cint,2139) -const CPXPARAM_MIP_Limits_CutPasses = convert(Cint,2056) -const CPXPARAM_MIP_Limits_CutsFactor = convert(Cint,2033) -const CPXPARAM_MIP_Limits_EachCutLimit = convert(Cint,2102) -const CPXPARAM_MIP_Limits_GomoryCand = convert(Cint,2048) -const CPXPARAM_MIP_Limits_GomoryPass = convert(Cint,2050) -const CPXPARAM_MIP_Limits_Nodes = convert(Cint,2017) -const CPXPARAM_MIP_Limits_PolishTime = convert(Cint,2066) -const CPXPARAM_MIP_Limits_Populate = convert(Cint,2108) -const CPXPARAM_MIP_Limits_ProbeDetTime = convert(Cint,2150) -const CPXPARAM_MIP_Limits_ProbeTime = convert(Cint,2065) -const CPXPARAM_MIP_Limits_RepairTries = convert(Cint,2067) -const CPXPARAM_MIP_Limits_Solutions = convert(Cint,2015) -const CPXPARAM_MIP_Limits_StrongCand = convert(Cint,2045) -const CPXPARAM_MIP_Limits_StrongIt = convert(Cint,2046) -const CPXPARAM_MIP_Limits_TreeMemory = convert(Cint,2027) -const CPXPARAM_MIP_OrderType = convert(Cint,2032) -const CPXPARAM_MIP_PolishAfter_AbsMIPGap = convert(Cint,2126) -const CPXPARAM_MIP_PolishAfter_DetTime = convert(Cint,2151) -const CPXPARAM_MIP_PolishAfter_MIPGap = convert(Cint,2127) -const CPXPARAM_MIP_PolishAfter_Nodes = convert(Cint,2128) -const CPXPARAM_MIP_PolishAfter_Solutions = convert(Cint,2129) -const CPXPARAM_MIP_PolishAfter_Time = convert(Cint,2130) -const CPXPARAM_MIP_Pool_AbsGap = convert(Cint,2106) -const CPXPARAM_MIP_Pool_Capacity = convert(Cint,2103) -const CPXPARAM_MIP_Pool_Intensity = convert(Cint,2107) -const CPXPARAM_MIP_Pool_RelGap = convert(Cint,2105) -const CPXPARAM_MIP_Pool_Replace = convert(Cint,2104) -const CPXPARAM_MIP_Strategy_Backtrack = convert(Cint,2002) -const CPXPARAM_MIP_Strategy_BBInterval = convert(Cint,2039) -const CPXPARAM_MIP_Strategy_Branch = convert(Cint,2001) -const CPXPARAM_MIP_Strategy_CallbackReducedLP = convert(Cint,2055) -const CPXPARAM_MIP_Strategy_Dive = convert(Cint,2060) -const CPXPARAM_MIP_Strategy_File = convert(Cint,2016) -const CPXPARAM_MIP_Strategy_FPHeur = convert(Cint,2098) -const CPXPARAM_MIP_Strategy_HeuristicFreq = convert(Cint,2031) -const CPXPARAM_MIP_Strategy_KappaStats = convert(Cint,2137) -const CPXPARAM_MIP_Strategy_LBHeur = convert(Cint,2063) -const CPXPARAM_MIP_Strategy_MIQCPStrat = convert(Cint,2110) -const CPXPARAM_MIP_Strategy_NodeSelect = convert(Cint,2018) -const CPXPARAM_MIP_Strategy_Order = convert(Cint,2020) -const CPXPARAM_MIP_Strategy_PresolveNode = convert(Cint,2037) -const CPXPARAM_MIP_Strategy_Probe = convert(Cint,2042) -const CPXPARAM_MIP_Strategy_RINSHeur = convert(Cint,2061) -const CPXPARAM_MIP_Strategy_Search = convert(Cint,2109) -const CPXPARAM_MIP_Strategy_StartAlgorithm = convert(Cint,2025) -const CPXPARAM_MIP_Strategy_SubAlgorithm = convert(Cint,2026) -const CPXPARAM_MIP_Strategy_VariableSelect = convert(Cint,2028) -const CPXPARAM_MIP_SubMIP_StartAlg = convert(Cint,2205) -const CPXPARAM_MIP_SubMIP_SubAlg = convert(Cint,2206) -const CPXPARAM_MIP_SubMIP_NodeLimit = convert(Cint,2212) -const CPXPARAM_MIP_SubMIP_Scale = convert(Cint,2207) -const CPXPARAM_MIP_Tolerances_AbsMIPGap = convert(Cint,2008) -const CPXPARAM_MIP_Tolerances_Linearization = convert(Cint,2068) -const CPXPARAM_MIP_Tolerances_Integrality = convert(Cint,2010) -const CPXPARAM_MIP_Tolerances_LowerCutoff = convert(Cint,2006) -const CPXPARAM_MIP_Tolerances_MIPGap = convert(Cint,2009) -const CPXPARAM_MIP_Tolerances_ObjDifference = convert(Cint,2019) -const CPXPARAM_MIP_Tolerances_RelObjDifference = convert(Cint,2022) -const CPXPARAM_MIP_Tolerances_UpperCutoff = convert(Cint,2007) -const CPXPARAM_MultiObjective_Display = convert(Cint,1600) -const CPXPARAM_Network_Display = convert(Cint,5005) -const CPXPARAM_Network_Iterations = convert(Cint,5001) -const CPXPARAM_Network_NetFind = convert(Cint,1022) -const CPXPARAM_Network_Pricing = convert(Cint,5004) -const CPXPARAM_Network_Tolerances_Feasibility = convert(Cint,5003) -const CPXPARAM_Network_Tolerances_Optimality = convert(Cint,5002) -const CPXPARAM_OptimalityTarget = convert(Cint,1131) -const CPXPARAM_Output_CloneLog = convert(Cint,1132) -const CPXPARAM_Output_IntSolFilePrefix = convert(Cint,2143) -const CPXPARAM_Output_MPSLong = convert(Cint,1081) -const CPXPARAM_Output_WriteLevel = convert(Cint,1114) -const CPXPARAM_Parallel = convert(Cint,1109) -const CPXPARAM_ParamDisplay = convert(Cint,1163) -const CPXPARAM_Preprocessing_Aggregator = convert(Cint,1003) -const CPXPARAM_Preprocessing_BoundStrength = convert(Cint,2029) -const CPXPARAM_Preprocessing_CoeffReduce = convert(Cint,2004) -const CPXPARAM_Preprocessing_Dependency = convert(Cint,1008) -const CPXPARAM_Preprocessing_Dual = convert(Cint,1044) -const CPXPARAM_Preprocessing_Fill = convert(Cint,1002) -const CPXPARAM_Preprocessing_Folding = convert(Cint,1164) -const CPXPARAM_Preprocessing_Linear = convert(Cint,1058) -const CPXPARAM_Preprocessing_NumPass = convert(Cint,1052) -const CPXPARAM_Preprocessing_Presolve = convert(Cint,1030) -const CPXPARAM_Preprocessing_QCPDuals = convert(Cint,4003) -const CPXPARAM_Preprocessing_QPMakePSD = convert(Cint,4010) -const CPXPARAM_Preprocessing_QToLin = convert(Cint,4012) -const CPXPARAM_Preprocessing_Reduce = convert(Cint,1057) -const CPXPARAM_Preprocessing_Relax = convert(Cint,2034) -const CPXPARAM_Preprocessing_RepeatPresolve = convert(Cint,2064) -const CPXPARAM_Preprocessing_Symmetry = convert(Cint,2059) -const CPXPARAM_QPMethod = convert(Cint,1063) -const CPXPARAM_RandomSeed = convert(Cint,1124) -const CPXPARAM_Read_APIEncoding = convert(Cint,1130) -const CPXPARAM_Read_Constraints = convert(Cint,1021) -const CPXPARAM_Read_DataCheck = convert(Cint,1056) -const CPXPARAM_Read_FileEncoding = convert(Cint,1129) -const CPXPARAM_Read_Nonzeros = convert(Cint,1024) -const CPXPARAM_Read_QPNonzeros = convert(Cint,4001) -const CPXPARAM_Read_Scale = convert(Cint,1034) -const CPXPARAM_Read_Variables = convert(Cint,1023) -const CPXPARAM_Read_WarningLimit = convert(Cint,1157) -const CPXPARAM_Record = convert(Cint,1162) -const CPXPARAM_ScreenOutput = convert(Cint,1035) -const CPXPARAM_Sifting_Algorithm = convert(Cint,1077) -const CPXPARAM_Sifting_Simplex = convert(Cint,1158) -const CPXPARAM_Sifting_Display = convert(Cint,1076) -const CPXPARAM_Sifting_Iterations = convert(Cint,1078) -const CPXPARAM_Simplex_Crash = convert(Cint,1007) -const CPXPARAM_Simplex_DGradient = convert(Cint,1009) -const CPXPARAM_Simplex_Display = convert(Cint,1019) -const CPXPARAM_Simplex_DynamicRows = convert(Cint,1161) -const CPXPARAM_Simplex_Limits_Iterations = convert(Cint,1020) -const CPXPARAM_Simplex_Limits_LowerObj = convert(Cint,1025) -const CPXPARAM_Simplex_Limits_Perturbation = convert(Cint,1028) -const CPXPARAM_Simplex_Limits_Singularity = convert(Cint,1037) -const CPXPARAM_Simplex_Limits_UpperObj = convert(Cint,1026) -const CPXPARAM_Simplex_Perturbation_Constant = convert(Cint,1015) -const CPXPARAM_Simplex_Perturbation_Indicator = convert(Cint,1027) -const CPXPARAM_Simplex_PGradient = convert(Cint,1029) -const CPXPARAM_Simplex_Pricing = convert(Cint,1010) -const CPXPARAM_Simplex_Refactor = convert(Cint,1031) -const CPXPARAM_Simplex_Tolerances_Feasibility = convert(Cint,1016) -const CPXPARAM_Simplex_Tolerances_Markowitz = convert(Cint,1013) -const CPXPARAM_Simplex_Tolerances_Optimality = convert(Cint,1014) -const CPXPARAM_SolutionType = convert(Cint,1147) -const CPXPARAM_Threads = convert(Cint,1067) -const CPXPARAM_TimeLimit = convert(Cint,1039) -const CPXPARAM_Tune_DetTimeLimit = convert(Cint,1139) -const CPXPARAM_Tune_Display = convert(Cint,1113) -const CPXPARAM_Tune_Measure = convert(Cint,1110) -const CPXPARAM_Tune_Repeat = convert(Cint,1111) -const CPXPARAM_Tune_TimeLimit = convert(Cint,1112) -const CPXPARAM_WorkDir = convert(Cint,1064) -const CPXPARAM_WorkMem = convert(Cint,1065) -const CPXPUBLICPARAMS_H = convert(Cint,1) -const CPX_PARAM_ADVIND = convert(Cint,1001) -const CPX_PARAM_AGGFILL = convert(Cint,1002) -const CPX_PARAM_AGGIND = convert(Cint,1003) -const CPX_PARAM_CLOCKTYPE = convert(Cint,1006) -const CPX_PARAM_CRAIND = convert(Cint,1007) -const CPX_PARAM_DEPIND = convert(Cint,1008) -const CPX_PARAM_DPRIIND = convert(Cint,1009) -const CPX_PARAM_PRICELIM = convert(Cint,1010) -const CPX_PARAM_EPMRK = convert(Cint,1013) -const CPX_PARAM_EPOPT = convert(Cint,1014) -const CPX_PARAM_EPPER = convert(Cint,1015) -const CPX_PARAM_EPRHS = convert(Cint,1016) -const CPX_PARAM_SIMDISPLAY = convert(Cint,1019) -const CPX_PARAM_ITLIM = convert(Cint,1020) -const CPX_PARAM_ROWREADLIM = convert(Cint,1021) -const CPX_PARAM_NETFIND = convert(Cint,1022) -const CPX_PARAM_COLREADLIM = convert(Cint,1023) -const CPX_PARAM_NZREADLIM = convert(Cint,1024) -const CPX_PARAM_OBJLLIM = convert(Cint,1025) -const CPX_PARAM_OBJULIM = convert(Cint,1026) -const CPX_PARAM_PERIND = convert(Cint,1027) -const CPX_PARAM_PERLIM = convert(Cint,1028) -const CPX_PARAM_PPRIIND = convert(Cint,1029) -const CPX_PARAM_PREIND = convert(Cint,1030) -const CPX_PARAM_REINV = convert(Cint,1031) -const CPX_PARAM_SCAIND = convert(Cint,1034) -const CPX_PARAM_SCRIND = convert(Cint,1035) -const CPX_PARAM_SINGLIM = convert(Cint,1037) -const CPX_PARAM_TILIM = convert(Cint,1039) -const CPX_PARAM_PREDUAL = convert(Cint,1044) -const CPX_PARAM_PREPASS = convert(Cint,1052) -const CPX_PARAM_DATACHECK = convert(Cint,1056) -const CPX_PARAM_REDUCE = convert(Cint,1057) -const CPX_PARAM_PRELINEAR = convert(Cint,1058) -const CPX_PARAM_LPMETHOD = convert(Cint,1062) -const CPX_PARAM_QPMETHOD = convert(Cint,1063) -const CPX_PARAM_WORKDIR = convert(Cint,1064) -const CPX_PARAM_WORKMEM = convert(Cint,1065) -const CPX_PARAM_THREADS = convert(Cint,1067) -const CPX_PARAM_CONFLICTALG = convert(Cint,1073) -const CPX_PARAM_CONFLICTDISPLAY = convert(Cint,1074) -const CPX_PARAM_SIFTDISPLAY = convert(Cint,1076) -const CPX_PARAM_SIFTALG = convert(Cint,1077) -const CPX_PARAM_SIFTITLIM = convert(Cint,1078) -const CPX_PARAM_MPSLONGNUM = convert(Cint,1081) -const CPX_PARAM_MEMORYEMPHASIS = convert(Cint,1082) -const CPX_PARAM_NUMERICALEMPHASIS = convert(Cint,1083) -const CPX_PARAM_FEASOPTMODE = convert(Cint,1084) -const CPX_PARAM_PARALLELMODE = convert(Cint,1109) -const CPX_PARAM_TUNINGMEASURE = convert(Cint,1110) -const CPX_PARAM_TUNINGREPEAT = convert(Cint,1111) -const CPX_PARAM_TUNINGTILIM = convert(Cint,1112) -const CPX_PARAM_TUNINGDISPLAY = convert(Cint,1113) -const CPX_PARAM_WRITELEVEL = convert(Cint,1114) -const CPX_PARAM_RANDOMSEED = convert(Cint,1124) -const CPX_PARAM_DETTILIM = convert(Cint,1127) -const CPX_PARAM_FILEENCODING = convert(Cint,1129) -const CPX_PARAM_APIENCODING = convert(Cint,1130) -const CPX_PARAM_OPTIMALITYTARGET = convert(Cint,1131) -const CPX_PARAM_CLONELOG = convert(Cint,1132) -const CPX_PARAM_TUNINGDETTILIM = convert(Cint,1139) -const CPX_PARAM_CPUMASK = convert(Cint,1144) -const CPX_PARAM_SOLUTIONTYPE = convert(Cint,1147) -const CPX_PARAM_WARNLIM = convert(Cint,1157) -const CPX_PARAM_SIFTSIM = convert(Cint,1158) -const CPX_PARAM_DYNAMICROWS = convert(Cint,1161) -const CPX_PARAM_RECORD = convert(Cint,1162) -const CPX_PARAM_PARAMDISPLAY = convert(Cint,1163) -const CPX_PARAM_FOLDING = convert(Cint,1164) -const CPX_PARAM_WORKERALG = convert(Cint,1500) -const CPX_PARAM_BENDERSSTRATEGY = convert(Cint,1501) -const CPX_PARAM_BENDERSFEASCUTTOL = convert(Cint,1509) -const CPX_PARAM_BENDERSOPTCUTTOL = convert(Cint,1510) -const CPX_PARAM_MULTIOBJDISPLAY = convert(Cint,1600) -const CPX_PARAM_BRDIR = convert(Cint,2001) -const CPX_PARAM_BTTOL = convert(Cint,2002) -const CPX_PARAM_CLIQUES = convert(Cint,2003) -const CPX_PARAM_COEREDIND = convert(Cint,2004) -const CPX_PARAM_COVERS = convert(Cint,2005) -const CPX_PARAM_CUTLO = convert(Cint,2006) -const CPX_PARAM_CUTUP = convert(Cint,2007) -const CPX_PARAM_EPAGAP = convert(Cint,2008) -const CPX_PARAM_EPGAP = convert(Cint,2009) -const CPX_PARAM_EPINT = convert(Cint,2010) -const CPX_PARAM_MIPDISPLAY = convert(Cint,2012) -const CPX_PARAM_MIPINTERVAL = convert(Cint,2013) -const CPX_PARAM_INTSOLLIM = convert(Cint,2015) -const CPX_PARAM_NODEFILEIND = convert(Cint,2016) -const CPX_PARAM_NODELIM = convert(Cint,2017) -const CPX_PARAM_NODESEL = convert(Cint,2018) -const CPX_PARAM_OBJDIF = convert(Cint,2019) -const CPX_PARAM_MIPORDIND = convert(Cint,2020) -const CPX_PARAM_RELOBJDIF = convert(Cint,2022) -const CPX_PARAM_STARTALG = convert(Cint,2025) -const CPX_PARAM_SUBALG = convert(Cint,2026) -const CPX_PARAM_TRELIM = convert(Cint,2027) -const CPX_PARAM_VARSEL = convert(Cint,2028) -const CPX_PARAM_BNDSTRENIND = convert(Cint,2029) -const CPX_PARAM_HEURFREQ = convert(Cint,2031) -const CPX_PARAM_MIPORDTYPE = convert(Cint,2032) -const CPX_PARAM_CUTSFACTOR = convert(Cint,2033) -const CPX_PARAM_RELAXPREIND = convert(Cint,2034) -const CPX_PARAM_PRESLVND = convert(Cint,2037) -const CPX_PARAM_BBINTERVAL = convert(Cint,2039) -const CPX_PARAM_FLOWCOVERS = convert(Cint,2040) -const CPX_PARAM_IMPLBD = convert(Cint,2041) -const CPX_PARAM_PROBE = convert(Cint,2042) -const CPX_PARAM_GUBCOVERS = convert(Cint,2044) -const CPX_PARAM_STRONGCANDLIM = convert(Cint,2045) -const CPX_PARAM_STRONGITLIM = convert(Cint,2046) -const CPX_PARAM_FRACCAND = convert(Cint,2048) -const CPX_PARAM_FRACCUTS = convert(Cint,2049) -const CPX_PARAM_FRACPASS = convert(Cint,2050) -const CPX_PARAM_FLOWPATHS = convert(Cint,2051) -const CPX_PARAM_MIRCUTS = convert(Cint,2052) -const CPX_PARAM_DISJCUTS = convert(Cint,2053) -const CPX_PARAM_AGGCUTLIM = convert(Cint,2054) -const CPX_PARAM_MIPCBREDLP = convert(Cint,2055) -const CPX_PARAM_CUTPASS = convert(Cint,2056) -const CPX_PARAM_MIPEMPHASIS = convert(Cint,2058) -const CPX_PARAM_SYMMETRY = convert(Cint,2059) -const CPX_PARAM_DIVETYPE = convert(Cint,2060) -const CPX_PARAM_RINSHEUR = convert(Cint,2061) -const CPX_PARAM_LBHEUR = convert(Cint,2063) -const CPX_PARAM_REPEATPRESOLVE = convert(Cint,2064) -const CPX_PARAM_PROBETIME = convert(Cint,2065) -const CPX_PARAM_POLISHTIME = convert(Cint,2066) -const CPX_PARAM_REPAIRTRIES = convert(Cint,2067) -const CPX_PARAM_EPLIN = convert(Cint,2068) -const CPX_PARAM_EPRELAX = convert(Cint,2073) -const CPX_PARAM_FPHEUR = convert(Cint,2098) -const CPX_PARAM_EACHCUTLIM = convert(Cint,2102) -const CPX_PARAM_SOLNPOOLCAPACITY = convert(Cint,2103) -const CPX_PARAM_SOLNPOOLREPLACE = convert(Cint,2104) -const CPX_PARAM_SOLNPOOLGAP = convert(Cint,2105) -const CPX_PARAM_SOLNPOOLAGAP = convert(Cint,2106) -const CPX_PARAM_SOLNPOOLINTENSITY = convert(Cint,2107) -const CPX_PARAM_POPULATELIM = convert(Cint,2108) -const CPX_PARAM_MIPSEARCH = convert(Cint,2109) -const CPX_PARAM_MIQCPSTRAT = convert(Cint,2110) -const CPX_PARAM_ZEROHALFCUTS = convert(Cint,2111) -const CPX_PARAM_POLISHAFTEREPAGAP = convert(Cint,2126) -const CPX_PARAM_POLISHAFTEREPGAP = convert(Cint,2127) -const CPX_PARAM_POLISHAFTERNODE = convert(Cint,2128) -const CPX_PARAM_POLISHAFTERINTSOL = convert(Cint,2129) -const CPX_PARAM_POLISHAFTERTIME = convert(Cint,2130) -const CPX_PARAM_MCFCUTS = convert(Cint,2134) -const CPX_PARAM_MIPKAPPASTATS = convert(Cint,2137) -const CPX_PARAM_AUXROOTTHREADS = convert(Cint,2139) -const CPX_PARAM_INTSOLFILEPREFIX = convert(Cint,2143) -const CPX_PARAM_PROBEDETTIME = convert(Cint,2150) -const CPX_PARAM_POLISHAFTERDETTIME = convert(Cint,2151) -const CPX_PARAM_LANDPCUTS = convert(Cint,2152) -const CPX_PARAM_RAMPUPDURATION = convert(Cint,2163) -const CPX_PARAM_RAMPUPDETTILIM = convert(Cint,2164) -const CPX_PARAM_RAMPUPTILIM = convert(Cint,2165) -const CPX_PARAM_LOCALIMPLBD = convert(Cint,2181) -const CPX_PARAM_BQPCUTS = convert(Cint,2195) -const CPX_PARAM_RLTCUTS = convert(Cint,2196) -const CPX_PARAM_SUBMIPSTARTALG = convert(Cint,2205) -const CPX_PARAM_SUBMIPSUBALG = convert(Cint,2206) -const CPX_PARAM_SUBMIPSCAIND = convert(Cint,2207) -const CPX_PARAM_SUBMIPNODELIMIT = convert(Cint,2212) -const CPX_PARAM_BAREPCOMP = convert(Cint,3002) -const CPX_PARAM_BARGROWTH = convert(Cint,3003) -const CPX_PARAM_BAROBJRNG = convert(Cint,3004) -const CPX_PARAM_BARALG = convert(Cint,3007) -const CPX_PARAM_BARCOLNZ = convert(Cint,3009) -const CPX_PARAM_BARDISPLAY = convert(Cint,3010) -const CPX_PARAM_BARITLIM = convert(Cint,3012) -const CPX_PARAM_BARMAXCOR = convert(Cint,3013) -const CPX_PARAM_BARORDER = convert(Cint,3014) -const CPX_PARAM_BARSTARTALG = convert(Cint,3017) -const CPX_PARAM_BARCROSSALG = convert(Cint,3018) -const CPX_PARAM_BARQCPEPCOMP = convert(Cint,3020) -const CPX_PARAM_QPNZREADLIM = convert(Cint,4001) -const CPX_PARAM_CALCQCPDUALS = convert(Cint,4003) -const CPX_PARAM_QPMAKEPSDIND = convert(Cint,4010) -const CPX_PARAM_QTOLININD = convert(Cint,4012) -const CPX_PARAM_NETITLIM = convert(Cint,5001) -const CPX_PARAM_NETEPOPT = convert(Cint,5002) -const CPX_PARAM_NETEPRHS = convert(Cint,5003) -const CPX_PARAM_NETPPRIIND = convert(Cint,5004) -const CPX_PARAM_NETDISPLAY = convert(Cint,5005) \ No newline at end of file diff --git a/src/full_defines_1280.jl b/src/full_defines_1280.jl deleted file mode 100644 index 815e2d9d..00000000 --- a/src/full_defines_1280.jl +++ /dev/null @@ -1,1188 +0,0 @@ -#const CPX_BENDERS_ANNOTATION = "cpxBendersPartition" -const CPX_INFBOUND = 1.0E+20 -const CPX_MINBOUND = 1.0E-13 -const CPX_CALLBACKCONTEXT_CANDIDATE=convert(Clong,0x0020) -const CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS=convert(Clong,0x0010) -const CPX_CALLBACKCONTEXT_LOCAL_PROGRESS=convert(Clong,0x0008) -const CPX_CALLBACKCONTEXT_RELAXATION=convert(Clong,0x0040) -const CPX_CALLBACKCONTEXT_THREAD_DOWN=convert(Clong,0x0004) -const CPX_CALLBACKCONTEXT_THREAD_UP=convert(Clong,0x0002) -const CPX_FEATURES_H = convert(Cint,1) -const CPX_STR_PARAM_MAX = convert(Cint,512) -const CPX_VERSION = convert(Cint,12080000) -const CPX_VERSION_VERSION = convert(Cint,12) -const CPX_VERSION_RELEASE = convert(Cint,8) -const CPX_VERSION_MODIFICATION = convert(Cint,0) -const CPX_VERSION_FIX = convert(Cint,0) -const CPX_PARAMTYPE_NONE = convert(Cint,0) -const CPX_PARAMTYPE_INT = convert(Cint,1) -const CPX_PARAMTYPE_STRING = convert(Cint,3) -const CPX_PARAMTYPE_LONG = convert(Cint,4) -const CPX_AUTO = convert(Cint,-1) -const CPX_ON = convert(Cint,1) -const CPX_OFF = convert(Cint,0) -const CPX_MAX = convert(Cint,-1) -const CPX_MIN = convert(Cint,1) -const CPX_PPRIIND_PARTIAL = convert(Cint,-1) -const CPX_PPRIIND_AUTO = convert(Cint,0) -const CPX_PPRIIND_DEVEX = convert(Cint,1) -const CPX_PPRIIND_STEEP = convert(Cint,2) -const CPX_PPRIIND_STEEPQSTART = convert(Cint,3) -const CPX_PPRIIND_FULL = convert(Cint,4) -const CPX_DPRIIND_AUTO = convert(Cint,0) -const CPX_DPRIIND_FULL = convert(Cint,1) -const CPX_DPRIIND_STEEP = convert(Cint,2) -const CPX_DPRIIND_FULLSTEEP = convert(Cint,3) -const CPX_DPRIIND_STEEPQSTART = convert(Cint,4) -const CPX_DPRIIND_DEVEX = convert(Cint,5) -const CPX_PARALLEL_DETERMINISTIC = convert(Cint,1) -const CPX_PARALLEL_AUTO = convert(Cint,0) -const CPX_PARALLEL_OPPORTUNISTIC = convert(Cint,-1) -const CPX_WRITELEVEL_AUTO = convert(Cint,0) -const CPX_WRITELEVEL_ALLVARS = convert(Cint,1) -const CPX_WRITELEVEL_DISCRETEVARS = convert(Cint,2) -const CPX_WRITELEVEL_NONZEROVARS = convert(Cint,3) -const CPX_WRITELEVEL_NONZERODISCRETEVARS = convert(Cint,4) -const CPX_OPTIMALITYTARGET_AUTO = convert(Cint,0) -const CPX_OPTIMALITYTARGET_OPTIMALCONVEX = convert(Cint,1) -const CPX_OPTIMALITYTARGET_FIRSTORDER = convert(Cint,2) -const CPX_OPTIMALITYTARGET_OPTIMALGLOBAL = convert(Cint,3) -const CPX_ALG_NONE = convert(Cint,-1) -const CPX_ALG_AUTOMATIC = convert(Cint,0) -const CPX_ALG_PRIMAL = convert(Cint,1) -const CPX_ALG_DUAL = convert(Cint,2) -const CPX_ALG_NET = convert(Cint,3) -const CPX_ALG_BARRIER = convert(Cint,4) -const CPX_ALG_SIFTING = convert(Cint,5) -const CPX_ALG_CONCURRENT = convert(Cint,6) -const CPX_ALG_BAROPT = convert(Cint,7) -const CPX_ALG_PIVOTIN = convert(Cint,8) -const CPX_ALG_PIVOTOUT = convert(Cint,9) -const CPX_ALG_PIVOT = convert(Cint,10) -const CPX_ALG_FEASOPT = convert(Cint,11) -const CPX_ALG_MIP = convert(Cint,12) -const CPX_ALG_BENDERS = convert(Cint,13) -const CPX_ALG_ROBUST = convert(Cint,14) -const CPX_AT_LOWER = convert(Cint,0) -const CPX_BASIC = convert(Cint,1) -const CPX_AT_UPPER = convert(Cint,2) -const CPX_FREE_SUPER = convert(Cint,3) -const CPX_NO_VARIABLE = convert(Cint,2100000000) -const CPX_PREREDUCE_PRIMALANDDUAL = convert(Cint,3) -const CPX_PREREDUCE_DUALONLY = convert(Cint,2) -const CPX_PREREDUCE_PRIMALONLY = convert(Cint,1) -const CPX_PREREDUCE_NOPRIMALORDUAL = convert(Cint,0) -const CPX_CONFLICT_EXCLUDED = convert(Cint,-1) -const CPX_CONFLICT_POSSIBLE_MEMBER = convert(Cint,0) -const CPX_CONFLICT_POSSIBLE_LB = convert(Cint,1) -const CPX_CONFLICT_POSSIBLE_UB = convert(Cint,2) -const CPX_CONFLICT_MEMBER = convert(Cint,3) -const CPX_CONFLICT_LB = convert(Cint,4) -const CPX_CONFLICT_UB = convert(Cint,5) -const CPX_CONFLICTALG_AUTO = convert(Cint,0) -const CPX_CONFLICTALG_FAST = convert(Cint,1) -const CPX_CONFLICTALG_PROPAGATE = convert(Cint,2) -const CPX_CONFLICTALG_PRESOLVE = convert(Cint,3) -const CPX_CONFLICTALG_IIS = convert(Cint,4) -const CPX_CONFLICTALG_LIMITSOLVE = convert(Cint,5) -const CPX_CONFLICTALG_SOLVE = convert(Cint,6) -const CPXPROB_LP = convert(Cint,0) -const CPXPROB_MILP = convert(Cint,1) -const CPXPROB_FIXEDMILP = convert(Cint,3) -const CPXPROB_NODELP = convert(Cint,4) -const CPXPROB_QP = convert(Cint,5) -const CPXPROB_MIQP = convert(Cint,7) -const CPXPROB_FIXEDMIQP = convert(Cint,8) -const CPXPROB_NODEQP = convert(Cint,9) -const CPXPROB_QCP = convert(Cint,10) -const CPXPROB_MIQCP = convert(Cint,11) -const CPXPROB_NODEQCP = convert(Cint,12) -const CPX_LPREADER_LEGACY = convert(Cint,0) -const CPX_LPREADER_NEW = convert(Cint,1) -const CPX_PARAM_ALL_MIN = convert(Cint,1000) -const CPX_PARAM_ALL_MAX = convert(Cint,6000) -const CPX_CALLBACK_PRIMAL = convert(Cint,1) -const CPX_CALLBACK_DUAL = convert(Cint,2) -const CPX_CALLBACK_NETWORK = convert(Cint,3) -const CPX_CALLBACK_PRIMAL_CROSSOVER = convert(Cint,4) -const CPX_CALLBACK_DUAL_CROSSOVER = convert(Cint,5) -const CPX_CALLBACK_BARRIER = convert(Cint,6) -const CPX_CALLBACK_PRESOLVE = convert(Cint,7) -const CPX_CALLBACK_QPBARRIER = convert(Cint,8) -const CPX_CALLBACK_QPSIMPLEX = convert(Cint,9) -const CPX_CALLBACK_TUNING = convert(Cint,10) -const CPX_CALLBACK_INFO_PRIMAL_OBJ = convert(Cint,1) -const CPX_CALLBACK_INFO_DUAL_OBJ = convert(Cint,2) -const CPX_CALLBACK_INFO_PRIMAL_INFMEAS = convert(Cint,3) -const CPX_CALLBACK_INFO_DUAL_INFMEAS = convert(Cint,4) -const CPX_CALLBACK_INFO_PRIMAL_FEAS = convert(Cint,5) -const CPX_CALLBACK_INFO_DUAL_FEAS = convert(Cint,6) -const CPX_CALLBACK_INFO_ITCOUNT = convert(Cint,7) -const CPX_CALLBACK_INFO_CROSSOVER_PPUSH = convert(Cint,8) -const CPX_CALLBACK_INFO_CROSSOVER_PEXCH = convert(Cint,9) -const CPX_CALLBACK_INFO_CROSSOVER_DPUSH = convert(Cint,10) -const CPX_CALLBACK_INFO_CROSSOVER_DEXCH = convert(Cint,11) -const CPX_CALLBACK_INFO_CROSSOVER_SBCNT = convert(Cint,12) -const CPX_CALLBACK_INFO_PRESOLVE_ROWSGONE = convert(Cint,13) -const CPX_CALLBACK_INFO_PRESOLVE_COLSGONE = convert(Cint,14) -const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST = convert(Cint,15) -const CPX_CALLBACK_INFO_PRESOLVE_COEFFS = convert(Cint,16) -const CPX_CALLBACK_INFO_USER_PROBLEM = convert(Cint,17) -const CPX_CALLBACK_INFO_TUNING_PROGRESS = convert(Cint,18) -const CPX_CALLBACK_INFO_ENDTIME = convert(Cint,19) -const CPX_CALLBACK_INFO_ITCOUNT_LONG = convert(Cint,20) -const CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG = convert(Cint,21) -const CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG = convert(Cint,22) -const CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG = convert(Cint,23) -const CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG = convert(Cint,24) -const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST_LONG = convert(Cint,25) -const CPX_CALLBACK_INFO_PRESOLVE_COEFFS_LONG = convert(Cint,26) -const CPX_CALLBACK_INFO_ENDDETTIME = convert(Cint,27) -const CPX_CALLBACK_INFO_STARTTIME = convert(Cint,28) -const CPX_CALLBACK_INFO_STARTDETTIME = convert(Cint,29) -const CPX_TUNE_AVERAGE = convert(Cint,1) -const CPX_TUNE_MINMAX = convert(Cint,2) -const CPX_TUNE_ABORT = convert(Cint,1) -const CPX_TUNE_TILIM = convert(Cint,2) -const CPX_TUNE_DETTILIM = convert(Cint,3) -const CPX_FEASOPT_MIN_SUM = convert(Cint,0) -const CPX_FEASOPT_OPT_SUM = convert(Cint,1) -const CPX_FEASOPT_MIN_INF = convert(Cint,2) -const CPX_FEASOPT_OPT_INF = convert(Cint,3) -const CPX_FEASOPT_MIN_QUAD = convert(Cint,4) -const CPX_FEASOPT_OPT_QUAD = convert(Cint,5) -const CPX_BENDERSSTRATEGY_OFF = convert(Cint,-1) -const CPX_BENDERSSTRATEGY_AUTO = convert(Cint,0) -const CPX_BENDERSSTRATEGY_USER = convert(Cint,1) -const CPX_BENDERSSTRATEGY_WORKERS = convert(Cint,2) -const CPX_BENDERSSTRATEGY_FULL = convert(Cint,3) -const CPX_ANNOTATIONDATA_LONG = convert(Cint,1) -const CPX_ANNOTATIONDATA_DOUBLE = convert(Cint,2) -const CPX_ANNOTATIONOBJ_OBJ = convert(Cint,0) -const CPX_ANNOTATIONOBJ_COL = convert(Cint,1) -const CPX_ANNOTATIONOBJ_ROW = convert(Cint,2) -const CPX_ANNOTATIONOBJ_SOS = convert(Cint,3) -const CPX_ANNOTATIONOBJ_IND = convert(Cint,4) -const CPX_ANNOTATIONOBJ_QC = convert(Cint,5) -const CPX_ANNOTATIONOBJ_LAST = convert(Cint,6) -const CPXIIS_COMPLETE = convert(Cint,1) -const CPXIIS_PARTIAL = convert(Cint,2) -const CPXIIS_AT_LOWER = convert(Cint,0) -const CPXIIS_FIXED = convert(Cint,1) -const CPXIIS_AT_UPPER = convert(Cint,2) -const CPX_BARORDER_AUTO = convert(Cint,0) -const CPX_BARORDER_AMD = convert(Cint,1) -const CPX_BARORDER_AMF = convert(Cint,2) -const CPX_BARORDER_ND = convert(Cint,3) -const CPX_MIPEMPHASIS_BALANCED = convert(Cint,0) -const CPX_MIPEMPHASIS_FEASIBILITY = convert(Cint,1) -const CPX_MIPEMPHASIS_OPTIMALITY = convert(Cint,2) -const CPX_MIPEMPHASIS_BESTBOUND = convert(Cint,3) -const CPX_MIPEMPHASIS_HIDDENFEAS = convert(Cint,4) -const CPX_VARSEL_MININFEAS = convert(Cint,-1) -const CPX_VARSEL_DEFAULT = convert(Cint,0) -const CPX_VARSEL_MAXINFEAS = convert(Cint,1) -const CPX_VARSEL_PSEUDO = convert(Cint,2) -const CPX_VARSEL_STRONG = convert(Cint,3) -const CPX_VARSEL_PSEUDOREDUCED = convert(Cint,4) -const CPX_NODESEL_DFS = convert(Cint,0) -const CPX_NODESEL_BESTBOUND = convert(Cint,1) -const CPX_NODESEL_BESTEST = convert(Cint,2) -const CPX_NODESEL_BESTEST_ALT = convert(Cint,3) -const CPX_MIPORDER_SCALEDCOST = convert(Cint,3) -const CPX_BRANCH_GLOBAL = convert(Cint,0) -const CPX_BRANCH_DOWN = convert(Cint,-1) -const CPX_BRANCH_UP = convert(Cint,1) -const CPX_BRDIR_DOWN = convert(Cint,-1) -const CPX_BRDIR_AUTO = convert(Cint,0) -const CPX_BRDIR_UP = convert(Cint,1) -const CPX_CUT_COVER = convert(Cint,0) -const CPX_CUT_GUBCOVER = convert(Cint,1) -const CPX_CUT_FLOWCOVER = convert(Cint,2) -const CPX_CUT_CLIQUE = convert(Cint,3) -const CPX_CUT_FRAC = convert(Cint,4) -const CPX_CUT_MIR = convert(Cint,5) -const CPX_CUT_FLOWPATH = convert(Cint,6) -const CPX_CUT_DISJ = convert(Cint,7) -const CPX_CUT_IMPLBD = convert(Cint,8) -const CPX_CUT_ZEROHALF = convert(Cint,9) -const CPX_CUT_MCF = convert(Cint,10) -const CPX_CUT_LOCALCOVER = convert(Cint,11) -const CPX_CUT_TIGHTEN = convert(Cint,12) -const CPX_CUT_OBJDISJ = convert(Cint,13) -const CPX_CUT_LANDP = convert(Cint,14) -const CPX_CUT_USER = convert(Cint,15) -const CPX_CUT_TABLE = convert(Cint,16) -const CPX_CUT_SOLNPOOL = convert(Cint,17) -const CPX_CUT_LOCALIMPLBD = convert(Cint,18) -const CPX_CUT_BQP = convert(Cint,19) -const CPX_CUT_RLT = convert(Cint,20) -const CPX_CUT_BENDERS = convert(Cint,21) -const CPX_CUT_NUM_TYPES = convert(Cint,22) -const CPX_MIPSEARCH_AUTO = convert(Cint,0) -const CPX_MIPSEARCH_TRADITIONAL = convert(Cint,1) -const CPX_MIPSEARCH_DYNAMIC = convert(Cint,2) -const CPX_MIPKAPPA_OFF = convert(Cint,-1) -const CPX_MIPKAPPA_AUTO = convert(Cint,0) -const CPX_MIPKAPPA_SAMPLE = convert(Cint,1) -const CPX_MIPKAPPA_FULL = convert(Cint,2) -const CPX_MIPSTART_AUTO = convert(Cint,0) -const CPX_MIPSTART_CHECKFEAS = convert(Cint,1) -const CPX_MIPSTART_SOLVEFIXED = convert(Cint,2) -const CPX_MIPSTART_SOLVEMIP = convert(Cint,3) -const CPX_MIPSTART_REPAIR = convert(Cint,4) -const CPX_MIPSTART_NOCHECK = convert(Cint,5) -const CPX_CALLBACK_MIP = convert(Cint,101) -const CPX_CALLBACK_MIP_BRANCH = convert(Cint,102) -const CPX_CALLBACK_MIP_NODE = convert(Cint,103) -const CPX_CALLBACK_MIP_HEURISTIC = convert(Cint,104) -const CPX_CALLBACK_MIP_SOLVE = convert(Cint,105) -const CPX_CALLBACK_MIP_CUT_LOOP = convert(Cint,106) -const CPX_CALLBACK_MIP_PROBE = convert(Cint,107) -const CPX_CALLBACK_MIP_FRACCUT = convert(Cint,108) -const CPX_CALLBACK_MIP_DISJCUT = convert(Cint,109) -const CPX_CALLBACK_MIP_FLOWMIR = convert(Cint,110) -const CPX_CALLBACK_MIP_INCUMBENT_NODESOLN = convert(Cint,111) -const CPX_CALLBACK_MIP_DELETENODE = convert(Cint,112) -const CPX_CALLBACK_MIP_BRANCH_NOSOLN = convert(Cint,113) -const CPX_CALLBACK_MIP_CUT_LAST = convert(Cint,114) -const CPX_CALLBACK_MIP_CUT_FEAS = convert(Cint,115) -const CPX_CALLBACK_MIP_CUT_UNBD = convert(Cint,116) -const CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN = convert(Cint,117) -const CPX_CALLBACK_MIP_INCUMBENT_USERSOLN = convert(Cint,118) -const CPX_CALLBACK_MIP_INCUMBENT_MIPSTART = convert(Cint,119) -const CPX_CALLBACK_INFO_BEST_INTEGER = convert(Cint,101) -const CPX_CALLBACK_INFO_BEST_REMAINING = convert(Cint,102) -const CPX_CALLBACK_INFO_NODE_COUNT = convert(Cint,103) -const CPX_CALLBACK_INFO_NODES_LEFT = convert(Cint,104) -const CPX_CALLBACK_INFO_MIP_ITERATIONS = convert(Cint,105) -const CPX_CALLBACK_INFO_CUTOFF = convert(Cint,106) -const CPX_CALLBACK_INFO_CLIQUE_COUNT = convert(Cint,107) -const CPX_CALLBACK_INFO_COVER_COUNT = convert(Cint,108) -const CPX_CALLBACK_INFO_MIP_FEAS = convert(Cint,109) -const CPX_CALLBACK_INFO_FLOWCOVER_COUNT = convert(Cint,110) -const CPX_CALLBACK_INFO_GUBCOVER_COUNT = convert(Cint,111) -const CPX_CALLBACK_INFO_IMPLBD_COUNT = convert(Cint,112) -const CPX_CALLBACK_INFO_PROBE_PHASE = convert(Cint,113) -const CPX_CALLBACK_INFO_PROBE_PROGRESS = convert(Cint,114) -const CPX_CALLBACK_INFO_FRACCUT_COUNT = convert(Cint,115) -const CPX_CALLBACK_INFO_FRACCUT_PROGRESS = convert(Cint,116) -const CPX_CALLBACK_INFO_DISJCUT_COUNT = convert(Cint,117) -const CPX_CALLBACK_INFO_DISJCUT_PROGRESS = convert(Cint,118) -const CPX_CALLBACK_INFO_FLOWPATH_COUNT = convert(Cint,119) -const CPX_CALLBACK_INFO_MIRCUT_COUNT = convert(Cint,120) -const CPX_CALLBACK_INFO_FLOWMIR_PROGRESS = convert(Cint,121) -const CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT = convert(Cint,122) -const CPX_CALLBACK_INFO_MY_THREAD_NUM = convert(Cint,123) -const CPX_CALLBACK_INFO_USER_THREADS = convert(Cint,124) -const CPX_CALLBACK_INFO_MIP_REL_GAP = convert(Cint,125) -const CPX_CALLBACK_INFO_MCFCUT_COUNT = convert(Cint,126) -const CPX_CALLBACK_INFO_KAPPA_STABLE = convert(Cint,127) -const CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS = convert(Cint,128) -const CPX_CALLBACK_INFO_KAPPA_UNSTABLE = convert(Cint,129) -const CPX_CALLBACK_INFO_KAPPA_ILLPOSED = convert(Cint,130) -const CPX_CALLBACK_INFO_KAPPA_MAX = convert(Cint,131) -const CPX_CALLBACK_INFO_KAPPA_ATTENTION = convert(Cint,132) -const CPX_CALLBACK_INFO_LANDPCUT_COUNT = convert(Cint,133) -const CPX_CALLBACK_INFO_USERCUT_COUNT = convert(Cint,134) -const CPX_CALLBACK_INFO_TABLECUT_COUNT = convert(Cint,135) -const CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT = convert(Cint,136) -const CPX_CALLBACK_INFO_NODE_COUNT_LONG = convert(Cint,140) -const CPX_CALLBACK_INFO_NODES_LEFT_LONG = convert(Cint,141) -const CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG = convert(Cint,142) -const CPX_CALLBACK_INFO_LAZY_SOURCE = convert(Cint,143) -const CPX_CALLBACK_INFO_NODE_SIINF = convert(Cint,201) -const CPX_CALLBACK_INFO_NODE_NIINF = convert(Cint,202) -const CPX_CALLBACK_INFO_NODE_ESTIMATE = convert(Cint,203) -const CPX_CALLBACK_INFO_NODE_DEPTH = convert(Cint,204) -const CPX_CALLBACK_INFO_NODE_OBJVAL = convert(Cint,205) -const CPX_CALLBACK_INFO_NODE_TYPE = convert(Cint,206) -const CPX_CALLBACK_INFO_NODE_VAR = convert(Cint,207) -const CPX_CALLBACK_INFO_NODE_SOS = convert(Cint,208) -const CPX_CALLBACK_INFO_NODE_SEQNUM = convert(Cint,209) -const CPX_CALLBACK_INFO_NODE_USERHANDLE = convert(Cint,210) -const CPX_CALLBACK_INFO_NODE_NODENUM = convert(Cint,211) -const CPX_CALLBACK_INFO_NODE_SEQNUM_LONG = convert(Cint,220) -const CPX_CALLBACK_INFO_NODE_NODENUM_LONG = convert(Cint,221) -const CPX_CALLBACK_INFO_NODE_DEPTH_LONG = convert(Cint,222) -const CPX_CALLBACK_INFO_SOS_TYPE = convert(Cint,240) -const CPX_CALLBACK_INFO_SOS_SIZE = convert(Cint,241) -const CPX_CALLBACK_INFO_SOS_IS_FEASIBLE = convert(Cint,242) -const CPX_CALLBACK_INFO_SOS_MEMBER_INDEX = convert(Cint,244) -const CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL = convert(Cint,246) -const CPX_CALLBACK_INFO_SOS_NUM = convert(Cint,247) -const CPX_CALLBACK_INFO_IC_NUM = convert(Cint,260) -const CPX_CALLBACK_INFO_IC_IMPLYING_VAR = convert(Cint,261) -const CPX_CALLBACK_INFO_IC_IMPLIED_VAR = convert(Cint,262) -const CPX_CALLBACK_INFO_IC_SENSE = convert(Cint,263) -const CPX_CALLBACK_INFO_IC_COMPL = convert(Cint,264) -const CPX_CALLBACK_INFO_IC_RHS = convert(Cint,265) -const CPX_CALLBACK_INFO_IC_IS_FEASIBLE = convert(Cint,266) -const CPX_INCUMBENT_ID = convert(Cint,-1) -const CPX_RAMPUP_DISABLED = convert(Cint,-1) -const CPX_RAMPUP_AUTO = convert(Cint,0) -const CPX_RAMPUP_DYNAMIC = convert(Cint,1) -const CPX_RAMPUP_INFINITE = convert(Cint,2) -const CPX_CALLBACK_DEFAULT = convert(Cint,0) -const CPX_CALLBACK_FAIL = convert(Cint,1) -const CPX_CALLBACK_SET = convert(Cint,2) -const CPX_CALLBACK_ABORT_CUT_LOOP = convert(Cint,3) -const CPX_USECUT_FORCE = convert(Cint,0) -const CPX_USECUT_PURGE = convert(Cint,1) -const CPX_USECUT_FILTER = convert(Cint,2) -const CPX_INTEGER_FEASIBLE = convert(Cint,0) -const CPX_INTEGER_INFEASIBLE = convert(Cint,1) -const CPX_IMPLIED_INTEGER_FEASIBLE = convert(Cint,2) -const CPX_CON_LOWER_BOUND = convert(Cint,1) -const CPX_CON_UPPER_BOUND = convert(Cint,2) -const CPX_CON_LINEAR = convert(Cint,3) -const CPX_CON_QUADRATIC = convert(Cint,4) -const CPX_CON_SOS = convert(Cint,5) -const CPX_CON_INDICATOR = convert(Cint,6) -const CPX_CON_MINEXPR = convert(Cint,7) -const CPX_CON_MAXEXPR = convert(Cint,8) -const CPX_CON_PWL = convert(Cint,9) -const CPX_CON_DISJCST = convert(Cint,10) -const CPX_CON_INDDISJCST = convert(Cint,11) -const CPX_CON_SETVAR = convert(Cint,12) -const CPX_CON_SETVARMEMBER = convert(Cint,13) -const CPX_CON_SETVARCARD = convert(Cint,14) -const CPX_CON_SETVARSUM = convert(Cint,15) -const CPX_CON_SETVARMIN = convert(Cint,16) -const CPX_CON_SETVARMAX = convert(Cint,17) -const CPX_CON_SETVARSUBSET = convert(Cint,18) -const CPX_CON_SETVARDOMAIN = convert(Cint,19) -const CPX_CON_SETVARUNION = convert(Cint,20) -const CPX_CON_SETVARINTERSECTION = convert(Cint,21) -const CPX_CON_SETVARNULLINTERSECT = convert(Cint,22) -const CPX_CON_SETVARINTERSECT = convert(Cint,23) -const CPX_CON_SETVAREQ = convert(Cint,24) -const CPX_CON_SETVARNEQ = convert(Cint,25) -const CPX_CON_SETVARNEQCST = convert(Cint,26) -const CPX_CON_LAST_CONTYPE = convert(Cint,27) -const CPX_INDICATOR_IF = convert(Cint,1) -const CPX_INDICATOR_ONLYIF = convert(Cint,2) -const CPX_INDICATOR_IFANDONLYIF = convert(Cint,3) -const CPXNET_NO_DISPLAY_OBJECTIVE = convert(Cint,0) -const CPXNET_TRUE_OBJECTIVE = convert(Cint,1) -const CPXNET_PENALIZED_OBJECTIVE = convert(Cint,2) -const CPXNET_PRICE_AUTO = convert(Cint,0) -const CPXNET_PRICE_PARTIAL = convert(Cint,1) -const CPXNET_PRICE_MULT_PART = convert(Cint,2) -const CPXNET_PRICE_SORT_MULT_PART = convert(Cint,3) -const CPX_NETFIND_PURE = convert(Cint,1) -const CPX_NETFIND_REFLECT = convert(Cint,2) -const CPX_NETFIND_SCALE = convert(Cint,3) -const CPX_QCPDUALS_NO = convert(Cint,0) -const CPX_QCPDUALS_IFPOSSIBLE = convert(Cint,1) -const CPX_QCPDUALS_FORCE = convert(Cint,2) -const CPX_BENDERS_MASTERVALUE = convert(Cint,0) -const CPX_BIGINT = convert(Cint,2100000000) -const CPX_DUAL_OBJ = convert(Cint,41) -const CPX_EXACT_KAPPA = convert(Cint,51) -const CPX_KAPPA = convert(Cint,39) -const CPX_KAPPA_ATTENTION = convert(Cint,57) -const CPX_KAPPA_ILLPOSED = convert(Cint,55) -const CPX_KAPPA_MAX = convert(Cint,56) -const CPX_KAPPA_STABLE = convert(Cint,52) -const CPX_KAPPA_SUSPICIOUS = convert(Cint,53) -const CPX_KAPPA_UNSTABLE = convert(Cint,54) -const CPX_MAX_COMP_SLACK = convert(Cint,19) -const CPX_MAX_DUAL_INFEAS = convert(Cint,5) -const CPX_MAX_DUAL_RESIDUAL = convert(Cint,15) -const CPX_MAX_INDSLACK_INFEAS = convert(Cint,49) -const CPX_MAX_INT_INFEAS = convert(Cint,9) -const CPX_MAX_PI = convert(Cint,25) -const CPX_MAX_PRIMAL_INFEAS = convert(Cint,1) -const CPX_MAX_PRIMAL_RESIDUAL = convert(Cint,11) -const CPX_MAX_QCPRIMAL_RESIDUAL = convert(Cint,43) -const CPX_MAX_QCSLACK = convert(Cint,47) -const CPX_MAX_QCSLACK_INFEAS = convert(Cint,45) -const CPX_MAX_RED_COST = convert(Cint,29) -const CPX_MAX_SCALED_DUAL_INFEAS = convert(Cint,6) -const CPX_MAX_SCALED_DUAL_RESIDUAL = convert(Cint,16) -const CPX_MAX_SCALED_PI = convert(Cint,26) -const CPX_MAX_SCALED_PRIMAL_INFEAS = convert(Cint,2) -const CPX_MAX_SCALED_PRIMAL_RESIDUAL = convert(Cint,12) -const CPX_MAX_SCALED_RED_COST = convert(Cint,30) -const CPX_MAX_SCALED_SLACK = convert(Cint,28) -const CPX_MAX_SCALED_X = convert(Cint,24) -const CPX_MAX_SLACK = convert(Cint,27) -const CPX_MAX_X = convert(Cint,23) -const CPX_OBJ_GAP = convert(Cint,40) -const CPX_PRIMAL_OBJ = convert(Cint,42) -const CPX_SOLNPOOL_DIV = convert(Cint,2) -const CPX_SOLNPOOL_FIFO = convert(Cint,0) -const CPX_SOLNPOOL_FILTER_DIVERSITY = convert(Cint,1) -const CPX_SOLNPOOL_FILTER_RANGE = convert(Cint,2) -const CPX_SOLNPOOL_OBJ = convert(Cint,1) -const CPX_STAT_ABORT_DETTIME_LIM = convert(Cint,25) -const CPX_STAT_ABORT_DUAL_OBJ_LIM = convert(Cint,22) -const CPX_STAT_ABORT_IT_LIM = convert(Cint,10) -const CPX_STAT_ABORT_OBJ_LIM = convert(Cint,12) -const CPX_STAT_ABORT_PRIM_OBJ_LIM = convert(Cint,21) -const CPX_STAT_ABORT_TIME_LIM = convert(Cint,11) -const CPX_STAT_ABORT_USER = convert(Cint,13) -const CPX_STAT_BENDERS_MASTER_UNBOUNDED = convert(Cint,40) -const CPX_STAT_BENDERS_NUM_BEST = convert(Cint,41) -const CPX_STAT_CONFLICT_ABORT_CONTRADICTION = convert(Cint,32) -const CPX_STAT_CONFLICT_ABORT_DETTIME_LIM = convert(Cint,39) -const CPX_STAT_CONFLICT_ABORT_IT_LIM = convert(Cint,34) -const CPX_STAT_CONFLICT_ABORT_MEM_LIM = convert(Cint,37) -const CPX_STAT_CONFLICT_ABORT_NODE_LIM = convert(Cint,35) -const CPX_STAT_CONFLICT_ABORT_OBJ_LIM = convert(Cint,36) -const CPX_STAT_CONFLICT_ABORT_TIME_LIM = convert(Cint,33) -const CPX_STAT_CONFLICT_ABORT_USER = convert(Cint,38) -const CPX_STAT_CONFLICT_FEASIBLE = convert(Cint,30) -const CPX_STAT_CONFLICT_MINIMAL = convert(Cint,31) -const CPX_STAT_FEASIBLE = convert(Cint,23) -const CPX_STAT_FEASIBLE_RELAXED_INF = convert(Cint,16) -const CPX_STAT_FEASIBLE_RELAXED_QUAD = convert(Cint,18) -const CPX_STAT_FEASIBLE_RELAXED_SUM = convert(Cint,14) -const CPX_STAT_FIRSTORDER = convert(Cint,24) -const CPX_STAT_INFEASIBLE = convert(Cint,3) -const CPX_STAT_INForUNBD = convert(Cint,4) -const CPX_STAT_NUM_BEST = convert(Cint,6) -const CPX_STAT_OPTIMAL = convert(Cint,1) -const CPX_STAT_OPTIMAL_FACE_UNBOUNDED = convert(Cint,20) -const CPX_STAT_OPTIMAL_INFEAS = convert(Cint,5) -const CPX_STAT_OPTIMAL_RELAXED_INF = convert(Cint,17) -const CPX_STAT_OPTIMAL_RELAXED_QUAD = convert(Cint,19) -const CPX_STAT_OPTIMAL_RELAXED_SUM = convert(Cint,15) -const CPX_STAT_UNBOUNDED = convert(Cint,2) -const CPX_SUM_COMP_SLACK = convert(Cint,21) -const CPX_SUM_DUAL_INFEAS = convert(Cint,7) -const CPX_SUM_DUAL_RESIDUAL = convert(Cint,17) -const CPX_SUM_INDSLACK_INFEAS = convert(Cint,50) -const CPX_SUM_INT_INFEAS = convert(Cint,10) -const CPX_SUM_PI = convert(Cint,33) -const CPX_SUM_PRIMAL_INFEAS = convert(Cint,3) -const CPX_SUM_PRIMAL_RESIDUAL = convert(Cint,13) -const CPX_SUM_QCPRIMAL_RESIDUAL = convert(Cint,44) -const CPX_SUM_QCSLACK = convert(Cint,48) -const CPX_SUM_QCSLACK_INFEAS = convert(Cint,46) -const CPX_SUM_RED_COST = convert(Cint,37) -const CPX_SUM_SCALED_DUAL_INFEAS = convert(Cint,8) -const CPX_SUM_SCALED_DUAL_RESIDUAL = convert(Cint,18) -const CPX_SUM_SCALED_PI = convert(Cint,34) -const CPX_SUM_SCALED_PRIMAL_INFEAS = convert(Cint,4) -const CPX_SUM_SCALED_PRIMAL_RESIDUAL = convert(Cint,14) -const CPX_SUM_SCALED_RED_COST = convert(Cint,38) -const CPX_SUM_SCALED_SLACK = convert(Cint,36) -const CPX_SUM_SCALED_X = convert(Cint,32) -const CPX_SUM_SLACK = convert(Cint,35) -const CPX_SUM_X = convert(Cint,31) -const CPXERR_ABORT_STRONGBRANCH = convert(Cint,1263) -const CPXERR_ADJ_SIGN_QUAD = convert(Cint,1606) -const CPXERR_ADJ_SIGN_SENSE = convert(Cint,1604) -const CPXERR_ADJ_SIGNS = convert(Cint,1602) -const CPXERR_ALGNOTLICENSED = convert(Cint,32024) -const CPXERR_ARC_INDEX_RANGE = convert(Cint,1231) -const CPXERR_ARRAY_BAD_SOS_TYPE = convert(Cint,3009) -const CPXERR_ARRAY_NOT_ASCENDING = convert(Cint,1226) -const CPXERR_ARRAY_TOO_LONG = convert(Cint,1208) -const CPXERR_BAD_ARGUMENT = convert(Cint,1003) -const CPXERR_BAD_BOUND_SENSE = convert(Cint,1622) -const CPXERR_BAD_BOUND_TYPE = convert(Cint,1457) -const CPXERR_BAD_CHAR = convert(Cint,1537) -const CPXERR_BAD_CTYPE = convert(Cint,3021) -const CPXERR_BAD_DECOMPOSITION = convert(Cint,2002) -const CPXERR_BAD_DIRECTION = convert(Cint,3012) -const CPXERR_BAD_EXPO_RANGE = convert(Cint,1435) -const CPXERR_BAD_EXPONENT = convert(Cint,1618) -const CPXERR_BAD_FILETYPE = convert(Cint,1424) -const CPXERR_BAD_ID = convert(Cint,1617) -const CPXERR_BAD_INDCONSTR = convert(Cint,1439) -const CPXERR_BAD_INDICATOR = convert(Cint,1551) -const CPXERR_BAD_INDTYPE = convert(Cint,1216) -const CPXERR_BAD_LAZY_UCUT = convert(Cint,1438) -const CPXERR_BAD_LUB = convert(Cint,1229) -const CPXERR_BAD_METHOD = convert(Cint,1292) -const CPXERR_BAD_NUMBER = convert(Cint,1434) -const CPXERR_BAD_OBJ_SENSE = convert(Cint,1487) -const CPXERR_BAD_PARAM_NAME = convert(Cint,1028) -const CPXERR_BAD_PARAM_NUM = convert(Cint,1013) -const CPXERR_BAD_PIVOT = convert(Cint,1267) -const CPXERR_BAD_PRIORITY = convert(Cint,3006) -const CPXERR_BAD_PROB_TYPE = convert(Cint,1022) -const CPXERR_BAD_ROW_ID = convert(Cint,1532) -const CPXERR_BAD_SECTION_BOUNDS = convert(Cint,1473) -const CPXERR_BAD_SECTION_ENDATA = convert(Cint,1462) -const CPXERR_BAD_SECTION_QMATRIX = convert(Cint,1475) -const CPXERR_BAD_SENSE = convert(Cint,1215) -const CPXERR_BAD_SOS_TYPE = convert(Cint,1442) -const CPXERR_BAD_STATUS = convert(Cint,1253) -const CPXERR_BADPRODUCT = convert(Cint,32023) -const CPXERR_BAS_FILE_SHORT = convert(Cint,1550) -const CPXERR_BAS_FILE_SIZE = convert(Cint,1555) -const CPXERR_BENDERS_MASTER_SOLVE = convert(Cint,2001) -const CPXERR_CALLBACK = convert(Cint,1006) -const CPXERR_CALLBACK_INCONSISTENT = convert(Cint,1060) -const CPXERR_CAND_NOT_POINT = convert(Cint,3025) -const CPXERR_CAND_NOT_RAY = convert(Cint,3026) -const CPXERR_CANT_CLOSE_CHILD = convert(Cint,1021) -const CPXERR_CHILD_OF_CHILD = convert(Cint,1019) -const CPXERR_CNTRL_IN_NAME = convert(Cint,1236) -const CPXERR_COL_INDEX_RANGE = convert(Cint,1201) -const CPXERR_COL_REPEAT_PRINT = convert(Cint,1478) -const CPXERR_COL_REPEATS = convert(Cint,1446) -const CPXERR_COL_ROW_REPEATS = convert(Cint,1443) -const CPXERR_COL_UNKNOWN = convert(Cint,1449) -const CPXERR_CONFLICT_UNSTABLE = convert(Cint,1720) -const CPXERR_COUNT_OVERLAP = convert(Cint,1228) -const CPXERR_COUNT_RANGE = convert(Cint,1227) -const CPXERR_CPUBINDING_FAILURE = convert(Cint,3700) -const CPXERR_DBL_MAX = convert(Cint,1233) -const CPXERR_DECOMPRESSION = convert(Cint,1027) -const CPXERR_DETTILIM_STRONGBRANCH = convert(Cint,1270) -const CPXERR_DUP_ENTRY = convert(Cint,1222) -const CPXERR_DYNFUNC = convert(Cint,1815) -const CPXERR_DYNLOAD = convert(Cint,1814) -const CPXERR_ENCODING_CONVERSION = convert(Cint,1235) -const CPXERR_EXTRA_BV_BOUND = convert(Cint,1456) -const CPXERR_EXTRA_FR_BOUND = convert(Cint,1455) -const CPXERR_EXTRA_FX_BOUND = convert(Cint,1454) -const CPXERR_EXTRA_INTEND = convert(Cint,1481) -const CPXERR_EXTRA_INTORG = convert(Cint,1480) -const CPXERR_EXTRA_SOSEND = convert(Cint,1483) -const CPXERR_EXTRA_SOSORG = convert(Cint,1482) -const CPXERR_FAIL_OPEN_READ = convert(Cint,1423) -const CPXERR_FAIL_OPEN_WRITE = convert(Cint,1422) -const CPXERR_FILE_ENTRIES = convert(Cint,1553) -const CPXERR_FILE_FORMAT = convert(Cint,1563) -const CPXERR_FILE_IO = convert(Cint,1426) -const CPXERR_FILTER_VARIABLE_TYPE = convert(Cint,3414) -const CPXERR_ILL_DEFINED_PWL = convert(Cint,1213) -const CPXERR_ILOG_LICENSE = convert(Cint,32201) -const CPXERR_IN_INFOCALLBACK = convert(Cint,1804) -const CPXERR_INDEX_NOT_BASIC = convert(Cint,1251) -const CPXERR_INDEX_RANGE = convert(Cint,1200) -const CPXERR_INDEX_RANGE_HIGH = convert(Cint,1206) -const CPXERR_INDEX_RANGE_LOW = convert(Cint,1205) -const CPXERR_INT_TOO_BIG = convert(Cint,3018) -const CPXERR_INT_TOO_BIG_INPUT = convert(Cint,1463) -const CPXERR_INVALID_NUMBER = convert(Cint,1650) -const CPXERR_LIMITS_TOO_BIG = convert(Cint,1012) -const CPXERR_LINE_TOO_LONG = convert(Cint,1465) -const CPXERR_LO_BOUND_REPEATS = convert(Cint,1459) -const CPXERR_LOCK_CREATE = convert(Cint,1808) -const CPXERR_LP_NOT_IN_ENVIRONMENT = convert(Cint,1806) -const CPXERR_LP_PARSE = convert(Cint,1427) -const CPXERR_MASTER_SOLVE = convert(Cint,2005) -const CPXERR_MIPSEARCH_WITH_CALLBACKS = convert(Cint,1805) -const CPXERR_MISS_SOS_TYPE = convert(Cint,3301) -const CPXERR_MSG_NO_CHANNEL = convert(Cint,1051) -const CPXERR_MSG_NO_FILEPTR = convert(Cint,1052) -const CPXERR_MSG_NO_FUNCTION = convert(Cint,1053) -const CPXERR_MULTIPLE_PROBS_IN_REMOTE_ENVIRONMENT = convert(Cint,1816) -const CPXERR_NAME_CREATION = convert(Cint,1209) -const CPXERR_NAME_NOT_FOUND = convert(Cint,1210) -const CPXERR_NAME_TOO_LONG = convert(Cint,1464) -const CPXERR_NAN = convert(Cint,1225) -const CPXERR_NEED_OPT_SOLN = convert(Cint,1252) -const CPXERR_NEGATIVE_SURPLUS = convert(Cint,1207) -const CPXERR_NET_DATA = convert(Cint,1530) -const CPXERR_NET_FILE_SHORT = convert(Cint,1538) -const CPXERR_NO_BARRIER_SOLN = convert(Cint,1223) -const CPXERR_NO_BASIC_SOLN = convert(Cint,1261) -const CPXERR_NO_BASIS = convert(Cint,1262) -const CPXERR_NO_BOUND_SENSE = convert(Cint,1621) -const CPXERR_NO_BOUND_TYPE = convert(Cint,1460) -const CPXERR_NO_COLUMNS_SECTION = convert(Cint,1472) -const CPXERR_NO_CONFLICT = convert(Cint,1719) -const CPXERR_NO_DECOMPOSITION = convert(Cint,2000) -const CPXERR_NO_DUAL_SOLN = convert(Cint,1232) -const CPXERR_NO_ENDATA = convert(Cint,1552) -const CPXERR_NO_ENVIRONMENT = convert(Cint,1002) -const CPXERR_NO_FILENAME = convert(Cint,1421) -const CPXERR_NO_ID = convert(Cint,1616) -const CPXERR_NO_ID_FIRST = convert(Cint,1609) -const CPXERR_NO_INT_X = convert(Cint,3023) -const CPXERR_NO_KAPPASTATS = convert(Cint,1269) -const CPXERR_NO_LU_FACTOR = convert(Cint,1258) -const CPXERR_NO_MEMORY = convert(Cint,1001) -const CPXERR_NO_MIPSTART = convert(Cint,3020) -const CPXERR_NO_NAME_SECTION = convert(Cint,1441) -const CPXERR_NO_NAMES = convert(Cint,1219) -const CPXERR_NO_NORMS = convert(Cint,1264) -const CPXERR_NO_NUMBER = convert(Cint,1615) -const CPXERR_NO_NUMBER_BOUND = convert(Cint,1623) -const CPXERR_NO_NUMBER_FIRST = convert(Cint,1611) -const CPXERR_NO_OBJ_SENSE = convert(Cint,1436) -const CPXERR_NO_OBJECTIVE = convert(Cint,1476) -const CPXERR_NO_OP_OR_SENSE = convert(Cint,1608) -const CPXERR_NO_OPERATOR = convert(Cint,1607) -const CPXERR_NO_ORDER = convert(Cint,3016) -const CPXERR_NO_PROBLEM = convert(Cint,1009) -const CPXERR_NO_QP_OPERATOR = convert(Cint,1614) -const CPXERR_NO_QUAD_EXP = convert(Cint,1612) -const CPXERR_NO_RHS_COEFF = convert(Cint,1610) -const CPXERR_NO_RHS_IN_OBJ = convert(Cint,1211) -const CPXERR_NO_ROW_NAME = convert(Cint,1486) -const CPXERR_NO_ROW_SENSE = convert(Cint,1453) -const CPXERR_NO_ROWS_SECTION = convert(Cint,1471) -const CPXERR_NO_SENSIT = convert(Cint,1260) -const CPXERR_NO_SOLN = convert(Cint,1217) -const CPXERR_NO_SOLNPOOL = convert(Cint,3024) -const CPXERR_NO_SOS = convert(Cint,3015) -const CPXERR_NO_TREE = convert(Cint,3412) -const CPXERR_NO_VECTOR_SOLN = convert(Cint,1556) -const CPXERR_NODE_INDEX_RANGE = convert(Cint,1230) -const CPXERR_NODE_ON_DISK = convert(Cint,3504) -const CPXERR_NOT_DUAL_UNBOUNDED = convert(Cint,1265) -const CPXERR_NOT_FIXED = convert(Cint,1221) -const CPXERR_NOT_FOR_BENDERS = convert(Cint,2004) -const CPXERR_NOT_FOR_MIP = convert(Cint,1017) -const CPXERR_NOT_FOR_QCP = convert(Cint,1031) -const CPXERR_NOT_FOR_QP = convert(Cint,1018) -const CPXERR_NOT_MILPCLASS = convert(Cint,1024) -const CPXERR_NOT_MIN_COST_FLOW = convert(Cint,1531) -const CPXERR_NOT_MIP = convert(Cint,3003) -const CPXERR_NOT_MIQPCLASS = convert(Cint,1029) -const CPXERR_NOT_ONE_PROBLEM = convert(Cint,1023) -const CPXERR_NOT_QP = convert(Cint,5004) -const CPXERR_NOT_SAV_FILE = convert(Cint,1560) -const CPXERR_NOT_UNBOUNDED = convert(Cint,1254) -const CPXERR_NULL_POINTER = convert(Cint,1004) -const CPXERR_ORDER_BAD_DIRECTION = convert(Cint,3007) -const CPXERR_OVERFLOW = convert(Cint,1810) -const CPXERR_PARAM_INCOMPATIBLE = convert(Cint,1807) -const CPXERR_PARAM_TOO_BIG = convert(Cint,1015) -const CPXERR_PARAM_TOO_SMALL = convert(Cint,1014) -const CPXERR_PRESLV_ABORT = convert(Cint,1106) -const CPXERR_PRESLV_BAD_PARAM = convert(Cint,1122) -const CPXERR_PRESLV_BASIS_MEM = convert(Cint,1107) -const CPXERR_PRESLV_COPYORDER = convert(Cint,1109) -const CPXERR_PRESLV_COPYSOS = convert(Cint,1108) -const CPXERR_PRESLV_CRUSHFORM = convert(Cint,1121) -const CPXERR_PRESLV_DETTIME_LIM = convert(Cint,1124) -const CPXERR_PRESLV_DUAL = convert(Cint,1119) -const CPXERR_PRESLV_FAIL_BASIS = convert(Cint,1114) -const CPXERR_PRESLV_INF = convert(Cint,1117) -const CPXERR_PRESLV_INForUNBD = convert(Cint,1101) -const CPXERR_PRESLV_NO_BASIS = convert(Cint,1115) -const CPXERR_PRESLV_NO_PROB = convert(Cint,1103) -const CPXERR_PRESLV_SOLN_MIP = convert(Cint,1110) -const CPXERR_PRESLV_SOLN_QP = convert(Cint,1111) -const CPXERR_PRESLV_START_LP = convert(Cint,1112) -const CPXERR_PRESLV_TIME_LIM = convert(Cint,1123) -const CPXERR_PRESLV_UNBD = convert(Cint,1118) -const CPXERR_PRESLV_UNCRUSHFORM = convert(Cint,1120) -const CPXERR_PRIIND = convert(Cint,1257) -const CPXERR_PRM_DATA = convert(Cint,1660) -const CPXERR_PRM_HEADER = convert(Cint,1661) -const CPXERR_PROTOCOL = convert(Cint,1812) -const CPXERR_Q_DIVISOR = convert(Cint,1619) -const CPXERR_Q_DUP_ENTRY = convert(Cint,5011) -const CPXERR_Q_NOT_INDEF = convert(Cint,5014) -const CPXERR_Q_NOT_POS_DEF = convert(Cint,5002) -const CPXERR_Q_NOT_SYMMETRIC = convert(Cint,5012) -const CPXERR_QCP_SENSE = convert(Cint,6002) -const CPXERR_QCP_SENSE_FILE = convert(Cint,1437) -const CPXERR_QUAD_EXP_NOT_2 = convert(Cint,1613) -const CPXERR_QUAD_IN_ROW = convert(Cint,1605) -const CPXERR_RANGE_SECTION_ORDER = convert(Cint,1474) -const CPXERR_RESTRICTED_VERSION = convert(Cint,1016) -const CPXERR_RHS_IN_OBJ = convert(Cint,1603) -const CPXERR_RIM_REPEATS = convert(Cint,1447) -const CPXERR_RIM_ROW_REPEATS = convert(Cint,1444) -const CPXERR_RIMNZ_REPEATS = convert(Cint,1479) -const CPXERR_ROW_INDEX_RANGE = convert(Cint,1203) -const CPXERR_ROW_REPEAT_PRINT = convert(Cint,1477) -const CPXERR_ROW_REPEATS = convert(Cint,1445) -const CPXERR_ROW_UNKNOWN = convert(Cint,1448) -const CPXERR_SAV_FILE_DATA = convert(Cint,1561) -const CPXERR_SAV_FILE_VALUE = convert(Cint,1564) -const CPXERR_SAV_FILE_WRITE = convert(Cint,1562) -const CPXERR_SBASE_ILLEGAL = convert(Cint,1554) -const CPXERR_SBASE_INCOMPAT = convert(Cint,1255) -const CPXERR_SINGULAR = convert(Cint,1256) -const CPXERR_STR_PARAM_TOO_LONG = convert(Cint,1026) -const CPXERR_SUBPROB_SOLVE = convert(Cint,3019) -const CPXERR_SYNCPRIM_CREATE = convert(Cint,1809) -const CPXERR_SYSCALL = convert(Cint,1813) -const CPXERR_THREAD_FAILED = convert(Cint,1234) -const CPXERR_TILIM_CONDITION_NO = convert(Cint,1268) -const CPXERR_TILIM_STRONGBRANCH = convert(Cint,1266) -const CPXERR_TOO_MANY_COEFFS = convert(Cint,1433) -const CPXERR_TOO_MANY_COLS = convert(Cint,1432) -const CPXERR_TOO_MANY_RIMNZ = convert(Cint,1485) -const CPXERR_TOO_MANY_RIMS = convert(Cint,1484) -const CPXERR_TOO_MANY_ROWS = convert(Cint,1431) -const CPXERR_TOO_MANY_THREADS = convert(Cint,1020) -const CPXERR_TREE_MEMORY_LIMIT = convert(Cint,3413) -const CPXERR_TUNE_MIXED = convert(Cint,1730) -const CPXERR_UNIQUE_WEIGHTS = convert(Cint,3010) -const CPXERR_UNSUPPORTED_CONSTRAINT_TYPE = convert(Cint,1212) -const CPXERR_UNSUPPORTED_OPERATION = convert(Cint,1811) -const CPXERR_UP_BOUND_REPEATS = convert(Cint,1458) -const CPXERR_WORK_FILE_OPEN = convert(Cint,1801) -const CPXERR_WORK_FILE_READ = convert(Cint,1802) -const CPXERR_WORK_FILE_WRITE = convert(Cint,1803) -const CPXERR_XMLPARSE = convert(Cint,1425) -const CPXMESSAGEBUFSIZE = convert(Cint,1024) -const CPXMI_BIGM_COEF = convert(Cint,1040) -const CPXMI_BIGM_TO_IND = convert(Cint,1041) -const CPXMI_BIGM_VARBOUND = convert(Cint,1042) -const CPXMI_CANCEL_TOL = convert(Cint,1045) -const CPXMI_EPGAP_LARGE = convert(Cint,1038) -const CPXMI_EPGAP_OBJOFFSET = convert(Cint,1037) -const CPXMI_FEAS_TOL = convert(Cint,1043) -const CPXMI_FRACTION_SCALING = convert(Cint,1047) -const CPXMI_IND_NZ_LARGE_NUM = convert(Cint,1019) -const CPXMI_IND_NZ_SMALL_NUM = convert(Cint,1020) -const CPXMI_IND_RHS_LARGE_NUM = convert(Cint,1021) -const CPXMI_IND_RHS_SMALL_NUM = convert(Cint,1022) -const CPXMI_KAPPA_ILLPOSED = convert(Cint,1035) -const CPXMI_KAPPA_SUSPICIOUS = convert(Cint,1033) -const CPXMI_KAPPA_UNSTABLE = convert(Cint,1034) -const CPXMI_LB_LARGE_NUM = convert(Cint,1003) -const CPXMI_LB_SMALL_NUM = convert(Cint,1004) -const CPXMI_LC_NZ_LARGE_NUM = convert(Cint,1023) -const CPXMI_LC_NZ_SMALL_NUM = convert(Cint,1024) -const CPXMI_LC_RHS_LARGE_NUM = convert(Cint,1025) -const CPXMI_LC_RHS_SMALL_NUM = convert(Cint,1026) -const CPXMI_NZ_LARGE_NUM = convert(Cint,1009) -const CPXMI_NZ_SMALL_NUM = convert(Cint,1010) -const CPXMI_OBJ_LARGE_NUM = convert(Cint,1001) -const CPXMI_OBJ_SMALL_NUM = convert(Cint,1002) -const CPXMI_OPT_TOL = convert(Cint,1044) -const CPXMI_QC_LINNZ_LARGE_NUM = convert(Cint,1015) -const CPXMI_QC_LINNZ_SMALL_NUM = convert(Cint,1016) -const CPXMI_QC_QNZ_LARGE_NUM = convert(Cint,1017) -const CPXMI_QC_QNZ_SMALL_NUM = convert(Cint,1018) -const CPXMI_QC_RHS_LARGE_NUM = convert(Cint,1013) -const CPXMI_QC_RHS_SMALL_NUM = convert(Cint,1014) -const CPXMI_QOBJ_LARGE_NUM = convert(Cint,1011) -const CPXMI_QOBJ_SMALL_NUM = convert(Cint,1012) -const CPXMI_QOPT_TOL = convert(Cint,1046) -const CPXMI_RHS_LARGE_NUM = convert(Cint,1007) -const CPXMI_RHS_SMALL_NUM = convert(Cint,1008) -const CPXMI_SAMECOEFF_COL = convert(Cint,1050) -const CPXMI_SAMECOEFF_IND = convert(Cint,1051) -const CPXMI_SAMECOEFF_LAZY = convert(Cint,1054) -const CPXMI_SAMECOEFF_OBJ = convert(Cint,1057) -const CPXMI_SAMECOEFF_QLIN = convert(Cint,1052) -const CPXMI_SAMECOEFF_QUAD = convert(Cint,1053) -const CPXMI_SAMECOEFF_RHS = convert(Cint,1056) -const CPXMI_SAMECOEFF_ROW = convert(Cint,1049) -const CPXMI_SAMECOEFF_UCUT = convert(Cint,1055) -const CPXMI_SINGLE_PRECISION = convert(Cint,1036) -const CPXMI_SYMMETRY_BREAKING_INEQ = convert(Cint,1039) -const CPXMI_UB_LARGE_NUM = convert(Cint,1005) -const CPXMI_UB_SMALL_NUM = convert(Cint,1006) -const CPXMI_UC_NZ_LARGE_NUM = convert(Cint,1027) -const CPXMI_UC_NZ_SMALL_NUM = convert(Cint,1028) -const CPXMI_UC_RHS_LARGE_NUM = convert(Cint,1029) -const CPXMI_UC_RHS_SMALL_NUM = convert(Cint,1030) -const CPXMI_WIDE_COEFF_RANGE = convert(Cint,1048) -const CPXMIP_ABORT_FEAS = convert(Cint,113) -const CPXMIP_ABORT_INFEAS = convert(Cint,114) -const CPXMIP_ABORT_RELAXATION_UNBOUNDED = convert(Cint,133) -const CPXMIP_ABORT_RELAXED = convert(Cint,126) -const CPXMIP_BENDERS_MASTER_UNBOUNDED = convert(Cint,134) -const CPXMIP_DETTIME_LIM_FEAS = convert(Cint,131) -const CPXMIP_DETTIME_LIM_INFEAS = convert(Cint,132) -const CPXMIP_FAIL_FEAS = convert(Cint,109) -const CPXMIP_FAIL_FEAS_NO_TREE = convert(Cint,116) -const CPXMIP_FAIL_INFEAS = convert(Cint,110) -const CPXMIP_FAIL_INFEAS_NO_TREE = convert(Cint,117) -const CPXMIP_FEASIBLE = convert(Cint,127) -const CPXMIP_FEASIBLE_RELAXED_INF = convert(Cint,122) -const CPXMIP_FEASIBLE_RELAXED_QUAD = convert(Cint,124) -const CPXMIP_FEASIBLE_RELAXED_SUM = convert(Cint,120) -const CPXMIP_INFEASIBLE = convert(Cint,103) -const CPXMIP_INForUNBD = convert(Cint,119) -const CPXMIP_MEM_LIM_FEAS = convert(Cint,111) -const CPXMIP_MEM_LIM_INFEAS = convert(Cint,112) -const CPXMIP_NODE_LIM_FEAS = convert(Cint,105) -const CPXMIP_NODE_LIM_INFEAS = convert(Cint,106) -const CPXMIP_OPTIMAL = convert(Cint,101) -const CPXMIP_OPTIMAL_INFEAS = convert(Cint,115) -const CPXMIP_OPTIMAL_POPULATED = convert(Cint,129) -const CPXMIP_OPTIMAL_POPULATED_TOL = convert(Cint,130) -const CPXMIP_OPTIMAL_RELAXED_INF = convert(Cint,123) -const CPXMIP_OPTIMAL_RELAXED_QUAD = convert(Cint,125) -const CPXMIP_OPTIMAL_RELAXED_SUM = convert(Cint,121) -const CPXMIP_OPTIMAL_TOL = convert(Cint,102) -const CPXMIP_POPULATESOL_LIM = convert(Cint,128) -const CPXMIP_SOL_LIM = convert(Cint,104) -const CPXMIP_TIME_LIM_FEAS = convert(Cint,107) -const CPXMIP_TIME_LIM_INFEAS = convert(Cint,108) -const CPXMIP_UNBOUNDED = convert(Cint,118) -const CPXPARAM_H = convert(Cint,1) -const CPXPARAM_Advance = convert(Cint,1001) -const CPXPARAM_Barrier_Algorithm = convert(Cint,3007) -const CPXPARAM_Barrier_ColNonzeros = convert(Cint,3009) -const CPXPARAM_Barrier_ConvergeTol = convert(Cint,3002) -const CPXPARAM_Barrier_Crossover = convert(Cint,3018) -const CPXPARAM_Barrier_Display = convert(Cint,3010) -const CPXPARAM_Barrier_Limits_Corrections = convert(Cint,3013) -const CPXPARAM_Barrier_Limits_Growth = convert(Cint,3003) -const CPXPARAM_Barrier_Limits_Iteration = convert(Cint,3012) -const CPXPARAM_Barrier_Limits_ObjRange = convert(Cint,3004) -const CPXPARAM_Barrier_Ordering = convert(Cint,3014) -const CPXPARAM_Barrier_QCPConvergeTol = convert(Cint,3020) -const CPXPARAM_Barrier_StartAlg = convert(Cint,3017) -const CPXPARAM_Benders_Strategy = convert(Cint,1501) -const CPXPARAM_Benders_Tolerances_feasibilitycut = convert(Cint,1509) -const CPXPARAM_Benders_Tolerances_optimalitycut = convert(Cint,1510) -const CPXPARAM_Benders_WorkerAlgorithm = convert(Cint,1500) -const CPXPARAM_ClockType = convert(Cint,1006) -const CPXPARAM_Conflict_Algorithm = convert(Cint,1073) -const CPXPARAM_Conflict_Display = convert(Cint,1074) -const CPXPARAM_CPUmask = convert(Cint,1144) -const CPXPARAM_DetTimeLimit = convert(Cint,1127) -const CPXPARAM_DistMIP_Rampup_DetTimeLimit = convert(Cint,2164) -const CPXPARAM_DistMIP_Rampup_Duration = convert(Cint,2163) -const CPXPARAM_DistMIP_Rampup_TimeLimit = convert(Cint,2165) -const CPXPARAM_Emphasis_Memory = convert(Cint,1082) -const CPXPARAM_Emphasis_MIP = convert(Cint,2058) -const CPXPARAM_Emphasis_Numerical = convert(Cint,1083) -const CPXPARAM_Feasopt_Mode = convert(Cint,1084) -const CPXPARAM_Feasopt_Tolerance = convert(Cint,2073) -const CPXPARAM_LPMethod = convert(Cint,1062) -const CPXPARAM_MIP_Cuts_BQP = convert(Cint,2195) -const CPXPARAM_MIP_Cuts_Cliques = convert(Cint,2003) -const CPXPARAM_MIP_Cuts_Covers = convert(Cint,2005) -const CPXPARAM_MIP_Cuts_Disjunctive = convert(Cint,2053) -const CPXPARAM_MIP_Cuts_FlowCovers = convert(Cint,2040) -const CPXPARAM_MIP_Cuts_Gomory = convert(Cint,2049) -const CPXPARAM_MIP_Cuts_GUBCovers = convert(Cint,2044) -const CPXPARAM_MIP_Cuts_Implied = convert(Cint,2041) -const CPXPARAM_MIP_Cuts_LiftProj = convert(Cint,2152) -const CPXPARAM_MIP_Cuts_LocalImplied = convert(Cint,2181) -const CPXPARAM_MIP_Cuts_MCFCut = convert(Cint,2134) -const CPXPARAM_MIP_Cuts_MIRCut = convert(Cint,2052) -const CPXPARAM_MIP_Cuts_PathCut = convert(Cint,2051) -const CPXPARAM_MIP_Cuts_RLT = convert(Cint,2196) -const CPXPARAM_MIP_Cuts_ZeroHalfCut = convert(Cint,2111) -const CPXPARAM_MIP_Display = convert(Cint,2012) -const CPXPARAM_MIP_Interval = convert(Cint,2013) -const CPXPARAM_MIP_Limits_AggForCut = convert(Cint,2054) -const CPXPARAM_MIP_Limits_AuxRootThreads = convert(Cint,2139) -const CPXPARAM_MIP_Limits_CutPasses = convert(Cint,2056) -const CPXPARAM_MIP_Limits_CutsFactor = convert(Cint,2033) -const CPXPARAM_MIP_Limits_EachCutLimit = convert(Cint,2102) -const CPXPARAM_MIP_Limits_GomoryCand = convert(Cint,2048) -const CPXPARAM_MIP_Limits_GomoryPass = convert(Cint,2050) -const CPXPARAM_MIP_Limits_Nodes = convert(Cint,2017) -const CPXPARAM_MIP_Limits_PolishTime = convert(Cint,2066) -const CPXPARAM_MIP_Limits_Populate = convert(Cint,2108) -const CPXPARAM_MIP_Limits_ProbeDetTime = convert(Cint,2150) -const CPXPARAM_MIP_Limits_ProbeTime = convert(Cint,2065) -const CPXPARAM_MIP_Limits_RepairTries = convert(Cint,2067) -const CPXPARAM_MIP_Limits_Solutions = convert(Cint,2015) -const CPXPARAM_MIP_Limits_StrongCand = convert(Cint,2045) -const CPXPARAM_MIP_Limits_StrongIt = convert(Cint,2046) -const CPXPARAM_MIP_Limits_SubMIPNodeLim = convert(Cint,2062) -const CPXPARAM_MIP_Limits_TreeMemory = convert(Cint,2027) -const CPXPARAM_MIP_OrderType = convert(Cint,2032) -const CPXPARAM_MIP_PolishAfter_AbsMIPGap = convert(Cint,2126) -const CPXPARAM_MIP_PolishAfter_DetTime = convert(Cint,2151) -const CPXPARAM_MIP_PolishAfter_MIPGap = convert(Cint,2127) -const CPXPARAM_MIP_PolishAfter_Nodes = convert(Cint,2128) -const CPXPARAM_MIP_PolishAfter_Solutions = convert(Cint,2129) -const CPXPARAM_MIP_PolishAfter_Time = convert(Cint,2130) -const CPXPARAM_MIP_Pool_AbsGap = convert(Cint,2106) -const CPXPARAM_MIP_Pool_Capacity = convert(Cint,2103) -const CPXPARAM_MIP_Pool_Intensity = convert(Cint,2107) -const CPXPARAM_MIP_Pool_RelGap = convert(Cint,2105) -const CPXPARAM_MIP_Pool_Replace = convert(Cint,2104) -const CPXPARAM_MIP_SubMIP_StartAlg = convert(Cint,2205) -const CPXPARAM_MIP_SubMIP_SubAlg = convert(Cint,2206) -const CPXPARAM_MIP_SubMIP_NodeLimit = convert(Cint,2212) -const CPXPARAM_MIP_SubMIP_Scale = convert(Cint,2207) -const CPXPARAM_MIP_Strategy_Backtrack = convert(Cint,2002) -const CPXPARAM_MIP_Strategy_BBInterval = convert(Cint,2039) -const CPXPARAM_MIP_Strategy_Branch = convert(Cint,2001) -const CPXPARAM_MIP_Strategy_CallbackReducedLP = convert(Cint,2055) -const CPXPARAM_MIP_Strategy_Dive = convert(Cint,2060) -const CPXPARAM_MIP_Strategy_File = convert(Cint,2016) -const CPXPARAM_MIP_Strategy_FPHeur = convert(Cint,2098) -const CPXPARAM_MIP_Strategy_HeuristicFreq = convert(Cint,2031) -const CPXPARAM_MIP_Strategy_KappaStats = convert(Cint,2137) -const CPXPARAM_MIP_Strategy_LBHeur = convert(Cint,2063) -const CPXPARAM_MIP_Strategy_MIQCPStrat = convert(Cint,2110) -const CPXPARAM_MIP_Strategy_NodeSelect = convert(Cint,2018) -const CPXPARAM_MIP_Strategy_Order = convert(Cint,2020) -const CPXPARAM_MIP_Strategy_PresolveNode = convert(Cint,2037) -const CPXPARAM_MIP_Strategy_Probe = convert(Cint,2042) -const CPXPARAM_MIP_Strategy_RINSHeur = convert(Cint,2061) -const CPXPARAM_MIP_Strategy_Search = convert(Cint,2109) -const CPXPARAM_MIP_Strategy_StartAlgorithm = convert(Cint,2025) -const CPXPARAM_MIP_Strategy_SubAlgorithm = convert(Cint,2026) -const CPXPARAM_MIP_Strategy_VariableSelect = convert(Cint,2028) -const CPXPARAM_MIP_Tolerances_AbsMIPGap = convert(Cint,2008) -const CPXPARAM_MIP_Tolerances_Linearization = convert(Cint,2068) -const CPXPARAM_MIP_Tolerances_Integrality = convert(Cint,2010) -const CPXPARAM_MIP_Tolerances_LowerCutoff = convert(Cint,2006) -const CPXPARAM_MIP_Tolerances_MIPGap = convert(Cint,2009) -const CPXPARAM_MIP_Tolerances_ObjDifference = convert(Cint,2019) -const CPXPARAM_MIP_Tolerances_RelObjDifference = convert(Cint,2022) -const CPXPARAM_MIP_Tolerances_UpperCutoff = convert(Cint,2007) -const CPXPARAM_Network_Display = convert(Cint,5005) -const CPXPARAM_Network_Iterations = convert(Cint,5001) -const CPXPARAM_Network_NetFind = convert(Cint,1022) -const CPXPARAM_Network_Pricing = convert(Cint,5004) -const CPXPARAM_Network_Tolerances_Feasibility = convert(Cint,5003) -const CPXPARAM_Network_Tolerances_Optimality = convert(Cint,5002) -const CPXPARAM_OptimalityTarget = convert(Cint,1131) -const CPXPARAM_Output_CloneLog = convert(Cint,1132) -const CPXPARAM_Output_IntSolFilePrefix = convert(Cint,2143) -const CPXPARAM_Output_MPSLong = convert(Cint,1081) -const CPXPARAM_Output_WriteLevel = convert(Cint,1114) -const CPXPARAM_Parallel = convert(Cint,1109) -const CPXPARAM_ParamDisplay = convert(Cint,1163) -const CPXPARAM_Preprocessing_Aggregator = convert(Cint,1003) -const CPXPARAM_Preprocessing_BoundStrength = convert(Cint,2029) -const CPXPARAM_Preprocessing_CoeffReduce = convert(Cint,2004) -const CPXPARAM_Preprocessing_Dependency = convert(Cint,1008) -const CPXPARAM_Preprocessing_Dual = convert(Cint,1044) -const CPXPARAM_Preprocessing_Fill = convert(Cint,1002) -const CPXPARAM_Preprocessing_Linear = convert(Cint,1058) -const CPXPARAM_Preprocessing_NumPass = convert(Cint,1052) -const CPXPARAM_Preprocessing_Presolve = convert(Cint,1030) -const CPXPARAM_Preprocessing_QCPDuals = convert(Cint,4003) -const CPXPARAM_Preprocessing_QPMakePSD = convert(Cint,4010) -const CPXPARAM_Preprocessing_QToLin = convert(Cint,4012) -const CPXPARAM_Preprocessing_Reduce = convert(Cint,1057) -const CPXPARAM_Preprocessing_Relax = convert(Cint,2034) -const CPXPARAM_Preprocessing_RepeatPresolve = convert(Cint,2064) -const CPXPARAM_Preprocessing_Symmetry = convert(Cint,2059) -const CPXPARAM_QPMethod = convert(Cint,1063) -const CPXPARAM_RandomSeed = convert(Cint,1124) -const CPXPARAM_Read_APIEncoding = convert(Cint,1130) -const CPXPARAM_Read_Constraints = convert(Cint,1021) -const CPXPARAM_Read_DataCheck = convert(Cint,1056) -const CPXPARAM_Read_FileEncoding = convert(Cint,1129) -const CPXPARAM_Read_Nonzeros = convert(Cint,1024) -const CPXPARAM_Read_QPNonzeros = convert(Cint,4001) -const CPXPARAM_Read_Scale = convert(Cint,1034) -const CPXPARAM_Read_Variables = convert(Cint,1023) -const CPXPARAM_Record = convert(Cint,1162) -const CPXPARAM_ScreenOutput = convert(Cint,1035) -const CPXPARAM_Sifting_Algorithm = convert(Cint,1077) -const CPXPARAM_Sifting_Simplex = convert(Cint,1158) -const CPXPARAM_Sifting_Display = convert(Cint,1076) -const CPXPARAM_Sifting_Iterations = convert(Cint,1078) -const CPXPARAM_Simplex_Crash = convert(Cint,1007) -const CPXPARAM_Simplex_DGradient = convert(Cint,1009) -const CPXPARAM_Simplex_Display = convert(Cint,1019) -const CPXPARAM_Simplex_DynamicRows = convert(Cint,1161) -const CPXPARAM_Simplex_Limits_Iterations = convert(Cint,1020) -const CPXPARAM_Simplex_Limits_LowerObj = convert(Cint,1025) -const CPXPARAM_Simplex_Limits_Perturbation = convert(Cint,1028) -const CPXPARAM_Simplex_Limits_Singularity = convert(Cint,1037) -const CPXPARAM_Simplex_Limits_UpperObj = convert(Cint,1026) -const CPXPARAM_Simplex_Perturbation_Constant = convert(Cint,1015) -const CPXPARAM_Simplex_Perturbation_Indicator = convert(Cint,1027) -const CPXPARAM_Simplex_PGradient = convert(Cint,1029) -const CPXPARAM_Simplex_Pricing = convert(Cint,1010) -const CPXPARAM_Simplex_Refactor = convert(Cint,1031) -const CPXPARAM_Simplex_Tolerances_Feasibility = convert(Cint,1016) -const CPXPARAM_Simplex_Tolerances_Markowitz = convert(Cint,1013) -const CPXPARAM_Simplex_Tolerances_Optimality = convert(Cint,1014) -const CPXPARAM_SolutionType = convert(Cint,1147) -const CPXPARAM_Threads = convert(Cint,1067) -const CPXPARAM_TimeLimit = convert(Cint,1039) -const CPXPARAM_Tune_DetTimeLimit = convert(Cint,1139) -const CPXPARAM_Tune_Display = convert(Cint,1113) -const CPXPARAM_Tune_Measure = convert(Cint,1110) -const CPXPARAM_Tune_Repeat = convert(Cint,1111) -const CPXPARAM_Tune_TimeLimit = convert(Cint,1112) -const CPXPARAM_WorkDir = convert(Cint,1064) -const CPXPARAM_WorkMem = convert(Cint,1065) -const CPXPUBLICPARAMS_H = convert(Cint,1) -const CPX_PARAM_ADVIND = convert(Cint,1001) -const CPX_PARAM_AGGFILL = convert(Cint,1002) -const CPX_PARAM_AGGIND = convert(Cint,1003) -const CPX_PARAM_CLOCKTYPE = convert(Cint,1006) -const CPX_PARAM_CRAIND = convert(Cint,1007) -const CPX_PARAM_DEPIND = convert(Cint,1008) -const CPX_PARAM_DPRIIND = convert(Cint,1009) -const CPX_PARAM_PRICELIM = convert(Cint,1010) -const CPX_PARAM_EPMRK = convert(Cint,1013) -const CPX_PARAM_EPOPT = convert(Cint,1014) -const CPX_PARAM_EPPER = convert(Cint,1015) -const CPX_PARAM_EPRHS = convert(Cint,1016) -const CPX_PARAM_SIMDISPLAY = convert(Cint,1019) -const CPX_PARAM_ITLIM = convert(Cint,1020) -const CPX_PARAM_ROWREADLIM = convert(Cint,1021) -const CPX_PARAM_NETFIND = convert(Cint,1022) -const CPX_PARAM_COLREADLIM = convert(Cint,1023) -const CPX_PARAM_NZREADLIM = convert(Cint,1024) -const CPX_PARAM_OBJLLIM = convert(Cint,1025) -const CPX_PARAM_OBJULIM = convert(Cint,1026) -const CPX_PARAM_PERIND = convert(Cint,1027) -const CPX_PARAM_PERLIM = convert(Cint,1028) -const CPX_PARAM_PPRIIND = convert(Cint,1029) -const CPX_PARAM_PREIND = convert(Cint,1030) -const CPX_PARAM_REINV = convert(Cint,1031) -const CPX_PARAM_SCAIND = convert(Cint,1034) -const CPX_PARAM_SCRIND = convert(Cint,1035) -const CPX_PARAM_SINGLIM = convert(Cint,1037) -const CPX_PARAM_TILIM = convert(Cint,1039) -const CPX_PARAM_PREDUAL = convert(Cint,1044) -const CPX_PARAM_PREPASS = convert(Cint,1052) -const CPX_PARAM_DATACHECK = convert(Cint,1056) -const CPX_PARAM_REDUCE = convert(Cint,1057) -const CPX_PARAM_PRELINEAR = convert(Cint,1058) -const CPX_PARAM_LPMETHOD = convert(Cint,1062) -const CPX_PARAM_QPMETHOD = convert(Cint,1063) -const CPX_PARAM_WORKDIR = convert(Cint,1064) -const CPX_PARAM_WORKMEM = convert(Cint,1065) -const CPX_PARAM_THREADS = convert(Cint,1067) -const CPX_PARAM_CONFLICTALG = convert(Cint,1073) -const CPX_PARAM_CONFLICTDISPLAY = convert(Cint,1074) -const CPX_PARAM_SIFTDISPLAY = convert(Cint,1076) -const CPX_PARAM_SIFTALG = convert(Cint,1077) -const CPX_PARAM_SIFTITLIM = convert(Cint,1078) -const CPX_PARAM_MPSLONGNUM = convert(Cint,1081) -const CPX_PARAM_MEMORYEMPHASIS = convert(Cint,1082) -const CPX_PARAM_NUMERICALEMPHASIS = convert(Cint,1083) -const CPX_PARAM_FEASOPTMODE = convert(Cint,1084) -const CPX_PARAM_PARALLELMODE = convert(Cint,1109) -const CPX_PARAM_TUNINGMEASURE = convert(Cint,1110) -const CPX_PARAM_TUNINGREPEAT = convert(Cint,1111) -const CPX_PARAM_TUNINGTILIM = convert(Cint,1112) -const CPX_PARAM_TUNINGDISPLAY = convert(Cint,1113) -const CPX_PARAM_WRITELEVEL = convert(Cint,1114) -const CPX_PARAM_RANDOMSEED = convert(Cint,1124) -const CPX_PARAM_DETTILIM = convert(Cint,1127) -const CPX_PARAM_FILEENCODING = convert(Cint,1129) -const CPX_PARAM_APIENCODING = convert(Cint,1130) -const CPX_PARAM_OPTIMALITYTARGET = convert(Cint,1131) -const CPX_PARAM_CLONELOG = convert(Cint,1132) -const CPX_PARAM_TUNINGDETTILIM = convert(Cint,1139) -const CPX_PARAM_CPUMASK = convert(Cint,1144) -const CPX_PARAM_SOLUTIONTYPE = convert(Cint,1147) -const CPX_PARAM_SIFTSIM = convert(Cint,1158) -const CPX_PARAM_DYNAMICROWS = convert(Cint,1161) -const CPX_PARAM_RECORD = convert(Cint,1162) -const CPX_PARAM_PARAMDISPLAY = convert(Cint,1163) -const CPX_PARAM_WORKERALG = convert(Cint,1500) -const CPX_PARAM_BENDERSSTRATEGY = convert(Cint,1501) -const CPX_PARAM_BENDERSFEASCUTTOL = convert(Cint,1509) -const CPX_PARAM_BENDERSOPTCUTTOL = convert(Cint,1510) -const CPX_PARAM_BRDIR = convert(Cint,2001) -const CPX_PARAM_BTTOL = convert(Cint,2002) -const CPX_PARAM_CLIQUES = convert(Cint,2003) -const CPX_PARAM_COEREDIND = convert(Cint,2004) -const CPX_PARAM_COVERS = convert(Cint,2005) -const CPX_PARAM_CUTLO = convert(Cint,2006) -const CPX_PARAM_CUTUP = convert(Cint,2007) -const CPX_PARAM_EPAGAP = convert(Cint,2008) -const CPX_PARAM_EPGAP = convert(Cint,2009) -const CPX_PARAM_EPINT = convert(Cint,2010) -const CPX_PARAM_MIPDISPLAY = convert(Cint,2012) -const CPX_PARAM_MIPINTERVAL = convert(Cint,2013) -const CPX_PARAM_INTSOLLIM = convert(Cint,2015) -const CPX_PARAM_NODEFILEIND = convert(Cint,2016) -const CPX_PARAM_NODELIM = convert(Cint,2017) -const CPX_PARAM_NODESEL = convert(Cint,2018) -const CPX_PARAM_OBJDIF = convert(Cint,2019) -const CPX_PARAM_MIPORDIND = convert(Cint,2020) -const CPX_PARAM_RELOBJDIF = convert(Cint,2022) -const CPX_PARAM_STARTALG = convert(Cint,2025) -const CPX_PARAM_SUBALG = convert(Cint,2026) -const CPX_PARAM_TRELIM = convert(Cint,2027) -const CPX_PARAM_VARSEL = convert(Cint,2028) -const CPX_PARAM_BNDSTRENIND = convert(Cint,2029) -const CPX_PARAM_HEURFREQ = convert(Cint,2031) -const CPX_PARAM_MIPORDTYPE = convert(Cint,2032) -const CPX_PARAM_CUTSFACTOR = convert(Cint,2033) -const CPX_PARAM_RELAXPREIND = convert(Cint,2034) -const CPX_PARAM_PRESLVND = convert(Cint,2037) -const CPX_PARAM_BBINTERVAL = convert(Cint,2039) -const CPX_PARAM_FLOWCOVERS = convert(Cint,2040) -const CPX_PARAM_IMPLBD = convert(Cint,2041) -const CPX_PARAM_PROBE = convert(Cint,2042) -const CPX_PARAM_GUBCOVERS = convert(Cint,2044) -const CPX_PARAM_STRONGCANDLIM = convert(Cint,2045) -const CPX_PARAM_STRONGITLIM = convert(Cint,2046) -const CPX_PARAM_FRACCAND = convert(Cint,2048) -const CPX_PARAM_FRACCUTS = convert(Cint,2049) -const CPX_PARAM_FRACPASS = convert(Cint,2050) -const CPX_PARAM_FLOWPATHS = convert(Cint,2051) -const CPX_PARAM_MIRCUTS = convert(Cint,2052) -const CPX_PARAM_DISJCUTS = convert(Cint,2053) -const CPX_PARAM_AGGCUTLIM = convert(Cint,2054) -const CPX_PARAM_MIPCBREDLP = convert(Cint,2055) -const CPX_PARAM_CUTPASS = convert(Cint,2056) -const CPX_PARAM_MIPEMPHASIS = convert(Cint,2058) -const CPX_PARAM_SYMMETRY = convert(Cint,2059) -const CPX_PARAM_DIVETYPE = convert(Cint,2060) -const CPX_PARAM_RINSHEUR = convert(Cint,2061) -const CPX_PARAM_SUBMIPNODELIM = convert(Cint,2062) -const CPX_PARAM_LBHEUR = convert(Cint,2063) -const CPX_PARAM_REPEATPRESOLVE = convert(Cint,2064) -const CPX_PARAM_PROBETIME = convert(Cint,2065) -const CPX_PARAM_POLISHTIME = convert(Cint,2066) -const CPX_PARAM_REPAIRTRIES = convert(Cint,2067) -const CPX_PARAM_EPLIN = convert(Cint,2068) -const CPX_PARAM_EPRELAX = convert(Cint,2073) -const CPX_PARAM_FPHEUR = convert(Cint,2098) -const CPX_PARAM_EACHCUTLIM = convert(Cint,2102) -const CPX_PARAM_SOLNPOOLCAPACITY = convert(Cint,2103) -const CPX_PARAM_SOLNPOOLREPLACE = convert(Cint,2104) -const CPX_PARAM_SOLNPOOLGAP = convert(Cint,2105) -const CPX_PARAM_SOLNPOOLAGAP = convert(Cint,2106) -const CPX_PARAM_SOLNPOOLINTENSITY = convert(Cint,2107) -const CPX_PARAM_POPULATELIM = convert(Cint,2108) -const CPX_PARAM_MIPSEARCH = convert(Cint,2109) -const CPX_PARAM_MIQCPSTRAT = convert(Cint,2110) -const CPX_PARAM_ZEROHALFCUTS = convert(Cint,2111) -const CPX_PARAM_POLISHAFTEREPAGAP = convert(Cint,2126) -const CPX_PARAM_POLISHAFTEREPGAP = convert(Cint,2127) -const CPX_PARAM_POLISHAFTERNODE = convert(Cint,2128) -const CPX_PARAM_POLISHAFTERINTSOL = convert(Cint,2129) -const CPX_PARAM_POLISHAFTERTIME = convert(Cint,2130) -const CPX_PARAM_MCFCUTS = convert(Cint,2134) -const CPX_PARAM_MIPKAPPASTATS = convert(Cint,2137) -const CPX_PARAM_AUXROOTTHREADS = convert(Cint,2139) -const CPX_PARAM_INTSOLFILEPREFIX = convert(Cint,2143) -const CPX_PARAM_PROBEDETTIME = convert(Cint,2150) -const CPX_PARAM_POLISHAFTERDETTIME = convert(Cint,2151) -const CPX_PARAM_LANDPCUTS = convert(Cint,2152) -const CPX_PARAM_RAMPUPDURATION = convert(Cint,2163) -const CPX_PARAM_RAMPUPDETTILIM = convert(Cint,2164) -const CPX_PARAM_RAMPUPTILIM = convert(Cint,2165) -const CPX_PARAM_LOCALIMPLBD = convert(Cint,2181) -const CPX_PARAM_BQPCUTS = convert(Cint,2195) -const CPX_PARAM_RLTCUTS = convert(Cint,2196) -const CPX_PARAM_SUBMIPSTARTALG = convert(Cint,2205) -const CPX_PARAM_SUBMIPSUBALG = convert(Cint,2206) -const CPX_PARAM_SUBMIPSCAIND = convert(Cint,2207) -const CPX_PARAM_SUBMIPNODELIMIT = convert(Cint,2212) -const CPX_PARAM_BAREPCOMP = convert(Cint,3002) -const CPX_PARAM_BARGROWTH = convert(Cint,3003) -const CPX_PARAM_BAROBJRNG = convert(Cint,3004) -const CPX_PARAM_BARALG = convert(Cint,3007) -const CPX_PARAM_BARCOLNZ = convert(Cint,3009) -const CPX_PARAM_BARDISPLAY = convert(Cint,3010) -const CPX_PARAM_BARITLIM = convert(Cint,3012) -const CPX_PARAM_BARMAXCOR = convert(Cint,3013) -const CPX_PARAM_BARORDER = convert(Cint,3014) -const CPX_PARAM_BARSTARTALG = convert(Cint,3017) -const CPX_PARAM_BARCROSSALG = convert(Cint,3018) -const CPX_PARAM_BARQCPEPCOMP = convert(Cint,3020) -const CPX_PARAM_QPNZREADLIM = convert(Cint,4001) -const CPX_PARAM_CALCQCPDUALS = convert(Cint,4003) -const CPX_PARAM_QPMAKEPSDIND = convert(Cint,4010) -const CPX_PARAM_QTOLININD = convert(Cint,4012) -const CPX_PARAM_NETITLIM = convert(Cint,5001) -const CPX_PARAM_NETEPOPT = convert(Cint,5002) -const CPX_PARAM_NETEPRHS = convert(Cint,5003) -const CPX_PARAM_NETPPRIIND = convert(Cint,5004) -const CPX_PARAM_NETDISPLAY = convert(Cint,5005) -const CPX_CONTINUOUS = convert(Cchar,'C') -const CPX_BINARY = convert(Cchar,'B') -const CPX_INTEGER = convert(Cchar,'I') -const CPX_SEMICONT = convert(Cchar,'S') -const CPX_SEMIINT = convert(Cchar,'N') -const CPX_TYPE_VAR = convert(Cchar,'0') -const CPX_TYPE_SOS1 = convert(Cchar,'1') -const CPX_TYPE_SOS2 = convert(Cchar,'2') -const CPX_TYPE_USER = convert(Cchar,'X') -const CPX_TYPE_ANY = convert(Cchar,'A') diff --git a/src/full_defines_1290.jl b/src/full_defines_1290.jl deleted file mode 100644 index 280fbca5..00000000 --- a/src/full_defines_1290.jl +++ /dev/null @@ -1,1261 +0,0 @@ -# This list was obtained through AWK with Cplex 12.7.1 (and then pared down). -# Some Cint manually changed to Cchar, removed convert around floating point constants -# grep "#define" cpxconst.h | awk '{ printf("const %s = convert(Cint,%s)\n",$2,$3) }' - -#const CPX_FEATURES_H = convert(Cint,1) -#const CPX_INTWIDTH_H = convert(Cint,) -#const CPXINT_MAX = convert(Cint,INT_MAX) -#const CPXINT_MIN = convert(Cint,INT_MIN) -#const CPX_PUBCONST_H = convert(Cint,) -#const CPXPUBLIC = convert(Cint,__stdcall) -#const CPXPUBVARARGS = convert(Cint,__cdecl) -#const CPXCDECL = convert(Cint,__cdecl) -#const CPXPUBLIC = convert(Cint,) -#const CPXPUBVARARGS = convert(Cint,) -#const CPXCDECL = convert(Cint,) - -const CPX_STR_PARAM_MAX = convert(Cint,512) -const CPX_VERSION = convert(Cint,12090000) -const CPX_VERSION_VERSION = convert(Cint,12) -const CPX_VERSION_RELEASE = convert(Cint,9) -const CPX_VERSION_MODIFICATION = convert(Cint,0) -const CPX_VERSION_FIX = convert(Cint,0) -const CPX_INFBOUND = 1.0E+20 #convert(Cint,1.0E+20) -const CPX_MINBOUND = 1.0E-13 #convert(Cint,1.0E-13) -const CPX_PARAMTYPE_NONE = convert(Cint,0) -const CPX_PARAMTYPE_INT = convert(Cint,1) -const CPX_PARAMTYPE_DOUBLE = convert(Cint,2) -const CPX_PARAMTYPE_STRING = convert(Cint,3) -const CPX_PARAMTYPE_LONG = convert(Cint,4) -const CPX_NO_SOLN = convert(Cint,0) -const CPX_AUTO_SOLN = convert(Cint,0) -const CPX_BASIC_SOLN = convert(Cint,1) -const CPX_NONBASIC_SOLN = convert(Cint,2) -const CPX_PRIMAL_SOLN = convert(Cint,3) -const CPX_PRECOL_LOW = convert(Cint,-1) -const CPX_PRECOL_UP = convert(Cint,-2) -const CPX_PRECOL_FIX = convert(Cint,-3) -const CPX_PRECOL_AGG = convert(Cint,-4) -const CPX_PRECOL_OTHER = convert(Cint,-5) -const CPX_PREROW_RED = convert(Cint,-1) -const CPX_PREROW_AGG = convert(Cint,-2) -const CPX_PREROW_OTHER = convert(Cint,-3) -const CPX_AUTO = convert(Cint,-1) -const CPX_ON = convert(Cint,1) -const CPX_OFF = convert(Cint,0) -const CPX_MAX = convert(Cint,-1) -const CPX_MIN = convert(Cint,1) -const CPX_DATACHECK_OFF = convert(Cint,0) -const CPX_DATACHECK_WARN = convert(Cint,1) -const CPX_DATACHECK_ASSIST = convert(Cint,2) -const CPX_PPRIIND_PARTIAL = convert(Cint,-1) -const CPX_PPRIIND_AUTO = convert(Cint,0) -const CPX_PPRIIND_DEVEX = convert(Cint,1) -const CPX_PPRIIND_STEEP = convert(Cint,2) -const CPX_PPRIIND_STEEPQSTART = convert(Cint,3) -const CPX_PPRIIND_FULL = convert(Cint,4) -const CPX_DPRIIND_AUTO = convert(Cint,0) -const CPX_DPRIIND_FULL = convert(Cint,1) -const CPX_DPRIIND_STEEP = convert(Cint,2) -const CPX_DPRIIND_FULLSTEEP = convert(Cint,3) -const CPX_DPRIIND_STEEPQSTART = convert(Cint,4) -const CPX_DPRIIND_DEVEX = convert(Cint,5) -const CPX_PARALLEL_DETERMINISTIC = convert(Cint,1) -const CPX_PARALLEL_AUTO = convert(Cint,0) -const CPX_PARALLEL_OPPORTUNISTIC = convert(Cint,-1) -const CPX_WRITELEVEL_AUTO = convert(Cint,0) -const CPX_WRITELEVEL_ALLVARS = convert(Cint,1) -const CPX_WRITELEVEL_DISCRETEVARS = convert(Cint,2) -const CPX_WRITELEVEL_NONZEROVARS = convert(Cint,3) -const CPX_WRITELEVEL_NONZERODISCRETEVARS = convert(Cint,4) -const CPX_OPTIMALITYTARGET_AUTO = convert(Cint,0) -const CPX_OPTIMALITYTARGET_OPTIMALCONVEX = convert(Cint,1) -const CPX_OPTIMALITYTARGET_FIRSTORDER = convert(Cint,2) -const CPX_OPTIMALITYTARGET_OPTIMALGLOBAL = convert(Cint,3) -const CPX_ALG_NONE = convert(Cint,-1) -const CPX_ALG_AUTOMATIC = convert(Cint,0) -const CPX_ALG_PRIMAL = convert(Cint,1) -const CPX_ALG_DUAL = convert(Cint,2) -const CPX_ALG_NET = convert(Cint,3) -const CPX_ALG_BARRIER = convert(Cint,4) -const CPX_ALG_SIFTING = convert(Cint,5) -const CPX_ALG_CONCURRENT = convert(Cint,6) -const CPX_ALG_BAROPT = convert(Cint,7) -const CPX_ALG_PIVOTIN = convert(Cint,8) -const CPX_ALG_PIVOTOUT = convert(Cint,9) -const CPX_ALG_PIVOT = convert(Cint,10) -const CPX_ALG_FEASOPT = convert(Cint,11) -const CPX_ALG_MIP = convert(Cint,12) -const CPX_ALG_BENDERS = convert(Cint,13) -const CPX_ALG_MULTIOBJ = convert(Cint,14) -const CPX_ALG_ROBUST = convert(Cint,15) -const CPX_AT_LOWER = convert(Cint,0) -const CPX_BASIC = convert(Cint,1) -const CPX_AT_UPPER = convert(Cint,2) -const CPX_FREE_SUPER = convert(Cint,3) -const CPX_NO_VARIABLE = convert(Cint,2100000000) -const CPX_CONTINUOUS = convert(Cchar,'C') -const CPX_BINARY = convert(Cchar,'B') -const CPX_INTEGER = convert(Cchar,'I') -const CPX_SEMICONT = convert(Cchar,'S') -const CPX_SEMIINT = convert(Cchar,'N') -const CPX_PREREDUCE_PRIMALANDDUAL = convert(Cint,3) -const CPX_PREREDUCE_DUALONLY = convert(Cint,2) -const CPX_PREREDUCE_PRIMALONLY = convert(Cint,1) -const CPX_PREREDUCE_NOPRIMALORDUAL = convert(Cint,0) -const CPX_CONFLICT_EXCLUDED = convert(Cint,-1) -const CPX_CONFLICT_POSSIBLE_MEMBER = convert(Cint,0) -const CPX_CONFLICT_POSSIBLE_LB = convert(Cint,1) -const CPX_CONFLICT_POSSIBLE_UB = convert(Cint,2) -const CPX_CONFLICT_MEMBER = convert(Cint,3) -const CPX_CONFLICT_LB = convert(Cint,4) -const CPX_CONFLICT_UB = convert(Cint,5) -const CPX_CONFLICTALG_AUTO = convert(Cint,0) -const CPX_CONFLICTALG_FAST = convert(Cint,1) -const CPX_CONFLICTALG_PROPAGATE = convert(Cint,2) -const CPX_CONFLICTALG_PRESOLVE = convert(Cint,3) -const CPX_CONFLICTALG_IIS = convert(Cint,4) -const CPX_CONFLICTALG_LIMITSOLVE = convert(Cint,5) -const CPX_CONFLICTALG_SOLVE = convert(Cint,6) -const CPXPROB_LP = convert(Cint,0) -const CPXPROB_MILP = convert(Cint,1) -const CPXPROB_FIXEDMILP = convert(Cint,3) -const CPXPROB_NODELP = convert(Cint,4) -const CPXPROB_QP = convert(Cint,5) -const CPXPROB_MIQP = convert(Cint,7) -const CPXPROB_FIXEDMIQP = convert(Cint,8) -const CPXPROB_NODEQP = convert(Cint,9) -const CPXPROB_QCP = convert(Cint,10) -const CPXPROB_MIQCP = convert(Cint,11) -const CPXPROB_NODEQCP = convert(Cint,12) -const CPX_LPREADER_LEGACY = convert(Cint,0) -const CPX_LPREADER_NEW = convert(Cint,1) -const CPX_PARAM_ALL_MIN = convert(Cint,1000) -const CPX_PARAM_ALL_MAX = convert(Cint,6000) -const CPX_CALLBACK_PRIMAL = convert(Cint,1) -const CPX_CALLBACK_DUAL = convert(Cint,2) -const CPX_CALLBACK_NETWORK = convert(Cint,3) -const CPX_CALLBACK_PRIMAL_CROSSOVER = convert(Cint,4) -const CPX_CALLBACK_DUAL_CROSSOVER = convert(Cint,5) -const CPX_CALLBACK_BARRIER = convert(Cint,6) -const CPX_CALLBACK_PRESOLVE = convert(Cint,7) -const CPX_CALLBACK_QPBARRIER = convert(Cint,8) -const CPX_CALLBACK_QPSIMPLEX = convert(Cint,9) -const CPX_CALLBACK_TUNING = convert(Cint,10) -const CPX_CALLBACK_INFO_PRIMAL_OBJ = convert(Cint,1) -const CPX_CALLBACK_INFO_DUAL_OBJ = convert(Cint,2) -const CPX_CALLBACK_INFO_PRIMAL_INFMEAS = convert(Cint,3) -const CPX_CALLBACK_INFO_DUAL_INFMEAS = convert(Cint,4) -const CPX_CALLBACK_INFO_PRIMAL_FEAS = convert(Cint,5) -const CPX_CALLBACK_INFO_DUAL_FEAS = convert(Cint,6) -const CPX_CALLBACK_INFO_ITCOUNT = convert(Cint,7) -const CPX_CALLBACK_INFO_CROSSOVER_PPUSH = convert(Cint,8) -const CPX_CALLBACK_INFO_CROSSOVER_PEXCH = convert(Cint,9) -const CPX_CALLBACK_INFO_CROSSOVER_DPUSH = convert(Cint,10) -const CPX_CALLBACK_INFO_CROSSOVER_DEXCH = convert(Cint,11) -const CPX_CALLBACK_INFO_CROSSOVER_SBCNT = convert(Cint,12) -const CPX_CALLBACK_INFO_PRESOLVE_ROWSGONE = convert(Cint,13) -const CPX_CALLBACK_INFO_PRESOLVE_COLSGONE = convert(Cint,14) -const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST = convert(Cint,15) -const CPX_CALLBACK_INFO_PRESOLVE_COEFFS = convert(Cint,16) -const CPX_CALLBACK_INFO_USER_PROBLEM = convert(Cint,17) -const CPX_CALLBACK_INFO_TUNING_PROGRESS = convert(Cint,18) -const CPX_CALLBACK_INFO_ENDTIME = convert(Cint,19) -const CPX_CALLBACK_INFO_ITCOUNT_LONG = convert(Cint,20) -const CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG = convert(Cint,21) -const CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG = convert(Cint,22) -const CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG = convert(Cint,23) -const CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG = convert(Cint,24) -const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST_LONG = convert(Cint,25) -const CPX_CALLBACK_INFO_PRESOLVE_COEFFS_LONG = convert(Cint,26) -const CPX_CALLBACK_INFO_ENDDETTIME = convert(Cint,27) -const CPX_CALLBACK_INFO_STARTTIME = convert(Cint,28) -const CPX_CALLBACK_INFO_STARTDETTIME = convert(Cint,29) -const CPX_TUNE_AVERAGE = convert(Cint,1) -const CPX_TUNE_MINMAX = convert(Cint,2) -const CPX_TUNE_ABORT = convert(Cint,1) -const CPX_TUNE_TILIM = convert(Cint,2) -const CPX_TUNE_DETTILIM = convert(Cint,3) -const CPX_FEASOPT_MIN_SUM = convert(Cint,0) -const CPX_FEASOPT_OPT_SUM = convert(Cint,1) -const CPX_FEASOPT_MIN_INF = convert(Cint,2) -const CPX_FEASOPT_OPT_INF = convert(Cint,3) -const CPX_FEASOPT_MIN_QUAD = convert(Cint,4) -const CPX_FEASOPT_OPT_QUAD = convert(Cint,5) -const CPX_BENDERSSTRATEGY_OFF = convert(Cint,-1) -const CPX_BENDERSSTRATEGY_AUTO = convert(Cint,0) -const CPX_BENDERSSTRATEGY_USER = convert(Cint,1) -const CPX_BENDERSSTRATEGY_WORKERS = convert(Cint,2) -const CPX_BENDERSSTRATEGY_FULL = convert(Cint,3) -const CPX_ANNOTATIONDATA_LONG = convert(Cint,1) -const CPX_ANNOTATIONDATA_DOUBLE = convert(Cint,2) -const CPX_ANNOTATIONOBJ_OBJ = convert(Cint,0) -const CPX_ANNOTATIONOBJ_COL = convert(Cint,1) -const CPX_ANNOTATIONOBJ_ROW = convert(Cint,2) -const CPX_ANNOTATIONOBJ_SOS = convert(Cint,3) -const CPX_ANNOTATIONOBJ_IND = convert(Cint,4) -const CPX_ANNOTATIONOBJ_QC = convert(Cint,5) -const CPX_ANNOTATIONOBJ_LAST = convert(Cint,6) -const CPXIIS_COMPLETE = convert(Cint,1) -const CPXIIS_PARTIAL = convert(Cint,2) -const CPXIIS_AT_LOWER = convert(Cint,0) -const CPXIIS_FIXED = convert(Cint,1) -const CPXIIS_AT_UPPER = convert(Cint,2) -# const CPX_BARCONST_H = convert(Cint,) -const CPX_BARORDER_AUTO = convert(Cint,0) -const CPX_BARORDER_AMD = convert(Cint,1) -const CPX_BARORDER_AMF = convert(Cint,2) -const CPX_BARORDER_ND = convert(Cint,3) -# const CPX_MIPCONST_H = convert(Cint,) -const CPX_MIPEMPHASIS_BALANCED = convert(Cint,0) -const CPX_MIPEMPHASIS_FEASIBILITY = convert(Cint,1) -const CPX_MIPEMPHASIS_OPTIMALITY = convert(Cint,2) -const CPX_MIPEMPHASIS_BESTBOUND = convert(Cint,3) -const CPX_MIPEMPHASIS_HIDDENFEAS = convert(Cint,4) -const CPX_TYPE_VAR = convert(Cchar,'0') -const CPX_TYPE_SOS1 = convert(Cchar,'1') -const CPX_TYPE_SOS2 = convert(Cchar,'2') -const CPX_TYPE_USER = convert(Cchar,'X') -const CPX_TYPE_ANY = convert(Cchar,'A') -const CPX_VARSEL_MININFEAS = convert(Cint,-1) -const CPX_VARSEL_DEFAULT = convert(Cint,0) -const CPX_VARSEL_MAXINFEAS = convert(Cint,1) -const CPX_VARSEL_PSEUDO = convert(Cint,2) -const CPX_VARSEL_STRONG = convert(Cint,3) -const CPX_VARSEL_PSEUDOREDUCED = convert(Cint,4) -const CPX_NODESEL_DFS = convert(Cint,0) -const CPX_NODESEL_BESTBOUND = convert(Cint,1) -const CPX_NODESEL_BESTEST = convert(Cint,2) -const CPX_NODESEL_BESTEST_ALT = convert(Cint,3) -const CPX_MIPORDER_COST = convert(Cint,1) -const CPX_MIPORDER_BOUNDS = convert(Cint,2) -const CPX_MIPORDER_SCALEDCOST = convert(Cint,3) -const CPX_BRANCH_GLOBAL = convert(Cint,0) -const CPX_BRANCH_DOWN = convert(Cint,-1) -const CPX_BRANCH_UP = convert(Cint,1) -const CPX_BRDIR_DOWN = convert(Cint,-1) -const CPX_BRDIR_AUTO = convert(Cint,0) -const CPX_BRDIR_UP = convert(Cint,1) -const CPX_CUT_COVER = convert(Cint,0) -const CPX_CUT_GUBCOVER = convert(Cint,1) -const CPX_CUT_FLOWCOVER = convert(Cint,2) -const CPX_CUT_CLIQUE = convert(Cint,3) -const CPX_CUT_FRAC = convert(Cint,4) -const CPX_CUT_MIR = convert(Cint,5) -const CPX_CUT_FLOWPATH = convert(Cint,6) -const CPX_CUT_DISJ = convert(Cint,7) -const CPX_CUT_IMPLBD = convert(Cint,8) -const CPX_CUT_ZEROHALF = convert(Cint,9) -const CPX_CUT_MCF = convert(Cint,10) -const CPX_CUT_LOCALCOVER = convert(Cint,11) -const CPX_CUT_TIGHTEN = convert(Cint,12) -const CPX_CUT_OBJDISJ = convert(Cint,13) -const CPX_CUT_LANDP = convert(Cint,14) -const CPX_CUT_USER = convert(Cint,15) -const CPX_CUT_TABLE = convert(Cint,16) -const CPX_CUT_SOLNPOOL = convert(Cint,17) -const CPX_CUT_LOCALIMPLBD = convert(Cint,18) -const CPX_CUT_BQP = convert(Cint,19) -const CPX_CUT_RLT = convert(Cint,20) -const CPX_CUT_BENDERS = convert(Cint,21) -const CPX_CUT_NUM_TYPES = convert(Cint,22) -const CPX_MIPSEARCH_AUTO = convert(Cint,0) -const CPX_MIPSEARCH_TRADITIONAL = convert(Cint,1) -const CPX_MIPSEARCH_DYNAMIC = convert(Cint,2) -const CPX_MIPKAPPA_OFF = convert(Cint,-1) -const CPX_MIPKAPPA_AUTO = convert(Cint,0) -const CPX_MIPKAPPA_SAMPLE = convert(Cint,1) -const CPX_MIPKAPPA_FULL = convert(Cint,2) -const CPX_MIPSTART_AUTO = convert(Cint,0) -const CPX_MIPSTART_CHECKFEAS = convert(Cint,1) -const CPX_MIPSTART_SOLVEFIXED = convert(Cint,2) -const CPX_MIPSTART_SOLVEMIP = convert(Cint,3) -const CPX_MIPSTART_REPAIR = convert(Cint,4) -const CPX_MIPSTART_NOCHECK = convert(Cint,5) -const CPX_CALLBACK_MIP = convert(Cint,101) -const CPX_CALLBACK_MIP_BRANCH = convert(Cint,102) -const CPX_CALLBACK_MIP_NODE = convert(Cint,103) -const CPX_CALLBACK_MIP_HEURISTIC = convert(Cint,104) -const CPX_CALLBACK_MIP_SOLVE = convert(Cint,105) -const CPX_CALLBACK_MIP_CUT_LOOP = convert(Cint,106) -const CPX_CALLBACK_MIP_PROBE = convert(Cint,107) -const CPX_CALLBACK_MIP_FRACCUT = convert(Cint,108) -const CPX_CALLBACK_MIP_DISJCUT = convert(Cint,109) -const CPX_CALLBACK_MIP_FLOWMIR = convert(Cint,110) -const CPX_CALLBACK_MIP_INCUMBENT_NODESOLN = convert(Cint,111) -const CPX_CALLBACK_MIP_DELETENODE = convert(Cint,112) -const CPX_CALLBACK_MIP_BRANCH_NOSOLN = convert(Cint,113) -const CPX_CALLBACK_MIP_CUT_LAST = convert(Cint,114) -const CPX_CALLBACK_MIP_CUT_FEAS = convert(Cint,115) -const CPX_CALLBACK_MIP_CUT_UNBD = convert(Cint,116) -const CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN = convert(Cint,117) -const CPX_CALLBACK_MIP_INCUMBENT_USERSOLN = convert(Cint,118) -const CPX_CALLBACK_MIP_INCUMBENT_MIPSTART = convert(Cint,119) -const CPX_CALLBACK_INFO_BEST_INTEGER = convert(Cint,101) -const CPX_CALLBACK_INFO_BEST_REMAINING = convert(Cint,102) -const CPX_CALLBACK_INFO_NODE_COUNT = convert(Cint,103) -const CPX_CALLBACK_INFO_NODES_LEFT = convert(Cint,104) -const CPX_CALLBACK_INFO_MIP_ITERATIONS = convert(Cint,105) -const CPX_CALLBACK_INFO_CUTOFF = convert(Cint,106) -const CPX_CALLBACK_INFO_CLIQUE_COUNT = convert(Cint,107) -const CPX_CALLBACK_INFO_COVER_COUNT = convert(Cint,108) -const CPX_CALLBACK_INFO_MIP_FEAS = convert(Cint,109) -const CPX_CALLBACK_INFO_FLOWCOVER_COUNT = convert(Cint,110) -const CPX_CALLBACK_INFO_GUBCOVER_COUNT = convert(Cint,111) -const CPX_CALLBACK_INFO_IMPLBD_COUNT = convert(Cint,112) -const CPX_CALLBACK_INFO_PROBE_PHASE = convert(Cint,113) -const CPX_CALLBACK_INFO_PROBE_PROGRESS = convert(Cint,114) -const CPX_CALLBACK_INFO_FRACCUT_COUNT = convert(Cint,115) -const CPX_CALLBACK_INFO_FRACCUT_PROGRESS = convert(Cint,116) -const CPX_CALLBACK_INFO_DISJCUT_COUNT = convert(Cint,117) -const CPX_CALLBACK_INFO_DISJCUT_PROGRESS = convert(Cint,118) -const CPX_CALLBACK_INFO_FLOWPATH_COUNT = convert(Cint,119) -const CPX_CALLBACK_INFO_MIRCUT_COUNT = convert(Cint,120) -const CPX_CALLBACK_INFO_FLOWMIR_PROGRESS = convert(Cint,121) -const CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT = convert(Cint,122) -const CPX_CALLBACK_INFO_MY_THREAD_NUM = convert(Cint,123) -const CPX_CALLBACK_INFO_USER_THREADS = convert(Cint,124) -const CPX_CALLBACK_INFO_MIP_REL_GAP = convert(Cint,125) -const CPX_CALLBACK_INFO_MCFCUT_COUNT = convert(Cint,126) -const CPX_CALLBACK_INFO_KAPPA_STABLE = convert(Cint,127) -const CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS = convert(Cint,128) -const CPX_CALLBACK_INFO_KAPPA_UNSTABLE = convert(Cint,129) -const CPX_CALLBACK_INFO_KAPPA_ILLPOSED = convert(Cint,130) -const CPX_CALLBACK_INFO_KAPPA_MAX = convert(Cint,131) -const CPX_CALLBACK_INFO_KAPPA_ATTENTION = convert(Cint,132) -const CPX_CALLBACK_INFO_LANDPCUT_COUNT = convert(Cint,133) -const CPX_CALLBACK_INFO_USERCUT_COUNT = convert(Cint,134) -const CPX_CALLBACK_INFO_TABLECUT_COUNT = convert(Cint,135) -const CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT = convert(Cint,136) -const CPX_CALLBACK_INFO_BENDERS_COUNT = convert(Cint,137) -const CPX_CALLBACK_INFO_NODE_COUNT_LONG = convert(Cint,140) -const CPX_CALLBACK_INFO_NODES_LEFT_LONG = convert(Cint,141) -const CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG = convert(Cint,142) -const CPX_CALLBACK_INFO_LAZY_SOURCE = convert(Cint,143) -const CPX_CALLBACK_INFO_NODE_SIINF = convert(Cint,201) -const CPX_CALLBACK_INFO_NODE_NIINF = convert(Cint,202) -const CPX_CALLBACK_INFO_NODE_ESTIMATE = convert(Cint,203) -const CPX_CALLBACK_INFO_NODE_DEPTH = convert(Cint,204) -const CPX_CALLBACK_INFO_NODE_OBJVAL = convert(Cint,205) -const CPX_CALLBACK_INFO_NODE_TYPE = convert(Cint,206) -const CPX_CALLBACK_INFO_NODE_VAR = convert(Cint,207) -const CPX_CALLBACK_INFO_NODE_SOS = convert(Cint,208) -const CPX_CALLBACK_INFO_NODE_SEQNUM = convert(Cint,209) -const CPX_CALLBACK_INFO_NODE_USERHANDLE = convert(Cint,210) -const CPX_CALLBACK_INFO_NODE_NODENUM = convert(Cint,211) -const CPX_CALLBACK_INFO_NODE_SEQNUM_LONG = convert(Cint,220) -const CPX_CALLBACK_INFO_NODE_NODENUM_LONG = convert(Cint,221) -const CPX_CALLBACK_INFO_NODE_DEPTH_LONG = convert(Cint,222) -const CPX_CALLBACK_INFO_SOS_TYPE = convert(Cint,240) -const CPX_CALLBACK_INFO_SOS_SIZE = convert(Cint,241) -const CPX_CALLBACK_INFO_SOS_IS_FEASIBLE = convert(Cint,242) -const CPX_CALLBACK_INFO_SOS_MEMBER_INDEX = convert(Cint,244) -const CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL = convert(Cint,246) -const CPX_CALLBACK_INFO_SOS_NUM = convert(Cint,247) -const CPX_CALLBACK_INFO_IC_NUM = convert(Cint,260) -const CPX_CALLBACK_INFO_IC_IMPLYING_VAR = convert(Cint,261) -const CPX_CALLBACK_INFO_IC_IMPLIED_VAR = convert(Cint,262) -const CPX_CALLBACK_INFO_IC_SENSE = convert(Cint,263) -const CPX_CALLBACK_INFO_IC_COMPL = convert(Cint,264) -const CPX_CALLBACK_INFO_IC_RHS = convert(Cint,265) -const CPX_CALLBACK_INFO_IC_IS_FEASIBLE = convert(Cint,266) -const CPX_INCUMBENT_ID = convert(Cint,-1) -const CPX_RAMPUP_DISABLED = convert(Cint,-1) -const CPX_RAMPUP_AUTO = convert(Cint,0) -const CPX_RAMPUP_DYNAMIC = convert(Cint,1) -const CPX_RAMPUP_INFINITE = convert(Cint,2) -const CPX_CALLBACK_DEFAULT = convert(Cint,0) -const CPX_CALLBACK_FAIL = convert(Cint,1) -const CPX_CALLBACK_SET = convert(Cint,2) -const CPX_CALLBACK_ABORT_CUT_LOOP = convert(Cint,3) -const CPX_USECUT_FORCE = convert(Cint,0) -const CPX_USECUT_PURGE = convert(Cint,1) -const CPX_USECUT_FILTER = convert(Cint,2) -const CPX_INTEGER_FEASIBLE = convert(Cint,0) -const CPX_INTEGER_INFEASIBLE = convert(Cint,1) -const CPX_IMPLIED_INTEGER_FEASIBLE = convert(Cint,2) -# const CPX_GCCONST_H = convert(Cint,) -const CPX_CON_LOWER_BOUND = convert(Cint,1) -const CPX_CON_UPPER_BOUND = convert(Cint,2) -const CPX_CON_LINEAR = convert(Cint,3) -const CPX_CON_QUADRATIC = convert(Cint,4) -const CPX_CON_SOS = convert(Cint,5) -const CPX_CON_INDICATOR = convert(Cint,6) -const CPX_CON_PWL = convert(Cint,7) -const CPX_CON_ABS = convert(Cint,7) -const CPX_CON_MINEXPR = convert(Cint,8) -const CPX_CON_MAXEXPR = convert(Cint,9) -const CPX_CON_LAST_CONTYPE = convert(Cint,10) -const CPX_INDICATOR_IF = convert(Cint,1) -const CPX_INDICATOR_ONLYIF = convert(Cint,2) -const CPX_INDICATOR_IFANDONLYIF = convert(Cint,3) -# const CPX_NETCONST_H = convert(Cint,) -const CPXNET_NO_DISPLAY_OBJECTIVE = convert(Cint,0) -const CPXNET_TRUE_OBJECTIVE = convert(Cint,1) -const CPXNET_PENALIZED_OBJECTIVE = convert(Cint,2) -const CPXNET_PRICE_AUTO = convert(Cint,0) -const CPXNET_PRICE_PARTIAL = convert(Cint,1) -const CPXNET_PRICE_MULT_PART = convert(Cint,2) -const CPXNET_PRICE_SORT_MULT_PART = convert(Cint,3) -const CPX_NETFIND_PURE = convert(Cint,1) -const CPX_NETFIND_REFLECT = convert(Cint,2) -const CPX_NETFIND_SCALE = convert(Cint,3) -# const CPX_QPCONST_H = convert(Cint,) -const CPX_QCPDUALS_NO = convert(Cint,0) -const CPX_QCPDUALS_IFPOSSIBLE = convert(Cint,1) -const CPX_QCPDUALS_FORCE = convert(Cint,2) -# const CPX_SOCPCONST_H = convert(Cint,) -# const CPX_BENDERS_ANNOTATION = convert(Cint,"cpxBendersPartition") -const CPX_BENDERS_MASTERVALUE = convert(Cint,0) -const CPX_BIGINT = convert(Cint,2100000000) -# const CPX_BIGLONG = convert(Clong,9223372036800000000LL) -const CPX_CALLBACKCONTEXT_CANDIDATE = convert(Clong,0x0020) -const CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS = convert(Clong,0x0010) -const CPX_CALLBACKCONTEXT_LOCAL_PROGRESS = convert(Clong,0x0008) -const CPX_CALLBACKCONTEXT_RELAXATION = convert(Clong,0x0040) -const CPX_CALLBACKCONTEXT_THREAD_DOWN = convert(Clong,0x0004) -const CPX_CALLBACKCONTEXT_THREAD_UP = convert(Clong,0x0002) -const CPX_DUAL_OBJ = convert(Cint,41) -const CPX_EXACT_KAPPA = convert(Cint,51) -const CPX_KAPPA = convert(Cint,39) -const CPX_KAPPA_ATTENTION = convert(Cint,57) -const CPX_KAPPA_ILLPOSED = convert(Cint,55) -const CPX_KAPPA_MAX = convert(Cint,56) -const CPX_KAPPA_STABLE = convert(Cint,52) -const CPX_KAPPA_SUSPICIOUS = convert(Cint,53) -const CPX_KAPPA_UNSTABLE = convert(Cint,54) -const CPX_LAZYCONSTRAINTCALLBACK_HEUR = CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN -const CPX_LAZYCONSTRAINTCALLBACK_MIPSTART = CPX_CALLBACK_MIP_INCUMBENT_MIPSTART -const CPX_LAZYCONSTRAINTCALLBACK_NODE = CPX_CALLBACK_MIP_INCUMBENT_NODESOLN -const CPX_MAX_COMP_SLACK = convert(Cint,19) -const CPX_MAX_DUAL_INFEAS = convert(Cint,5) -const CPX_MAX_DUAL_RESIDUAL = convert(Cint,15) -const CPX_MAX_INDSLACK_INFEAS = convert(Cint,49) -const CPX_MAX_INT_INFEAS = convert(Cint,9) -const CPX_MAX_PI = convert(Cint,25) -const CPX_MAX_PRIMAL_INFEAS = convert(Cint,1) -const CPX_MAX_PRIMAL_RESIDUAL = convert(Cint,11) -const CPX_MAX_PWLSLACK_INFEAS = convert(Cint,58) -const CPX_MAX_QCPRIMAL_RESIDUAL = convert(Cint,43) -const CPX_MAX_QCSLACK = convert(Cint,47) -const CPX_MAX_QCSLACK_INFEAS = convert(Cint,45) -const CPX_MAX_RED_COST = convert(Cint,29) -const CPX_MAX_SCALED_DUAL_INFEAS = convert(Cint,6) -const CPX_MAX_SCALED_DUAL_RESIDUAL = convert(Cint,16) -const CPX_MAX_SCALED_PI = convert(Cint,26) -const CPX_MAX_SCALED_PRIMAL_INFEAS = convert(Cint,2) -const CPX_MAX_SCALED_PRIMAL_RESIDUAL = convert(Cint,12) -const CPX_MAX_SCALED_RED_COST = convert(Cint,30) -const CPX_MAX_SCALED_SLACK = convert(Cint,28) -const CPX_MAX_SCALED_X = convert(Cint,24) -const CPX_MAX_SLACK = convert(Cint,27) -const CPX_MAX_X = convert(Cint,23) -const CPX_MULTIOBJ_BARITCNT = convert(Cint,4) -const CPX_MULTIOBJ_BESTOBJVAL = convert(Cint,15) -const CPX_MULTIOBJ_BLEND = convert(Cint,20) -const CPX_MULTIOBJ_DEGCNT = convert(Cint,7) -const CPX_MULTIOBJ_DETTIME = convert(Cint,3) -const CPX_MULTIOBJ_DEXCH = convert(Cint,13) -const CPX_MULTIOBJ_DPUSH = convert(Cint,12) -const CPX_MULTIOBJ_ERROR = convert(Cint,0) -const CPX_MULTIOBJ_ITCNT = convert(Cint,8) -const CPX_MULTIOBJ_METHOD = convert(Cint,18) -const CPX_MULTIOBJ_NODECNT = convert(Cint,16) -const CPX_MULTIOBJ_NODELEFTCNT = convert(Cint,19) -const CPX_MULTIOBJ_OBJVAL = convert(Cint,14) -const CPX_MULTIOBJ_PEXCH = convert(Cint,11) -const CPX_MULTIOBJ_PHASE1CNT = convert(Cint,9) -const CPX_MULTIOBJ_PPUSH = convert(Cint,10) -const CPX_MULTIOBJ_PRIORITY = convert(Cint,17) -const CPX_MULTIOBJ_SIFTITCNT = convert(Cint,5) -const CPX_MULTIOBJ_SIFTPHASE1CNT = convert(Cint,6) -const CPX_MULTIOBJ_STATUS = convert(Cint,1) -const CPX_MULTIOBJ_TIME = convert(Cint,2) -#const CPX_NO_ABSTOL_CHANGE = convert(Cint,NAN) -#const CPX_NO_OFFSET_CHANGE = convert(Cint,NAN) -const CPX_NO_PRIORITY_CHANGE = convert(Cint,-1) -#const CPX_NO_RELTOL_CHANGE = convert(Cint,NAN) -#const CPX_NO_WEIGHT_CHANGE = convert(Cint,NAN) -const CPX_OBJ_GAP = convert(Cint,40) -const CPX_PRIMAL_OBJ = convert(Cint,42) -const CPX_SOLNPOOL_DIV = convert(Cint,2) -const CPX_SOLNPOOL_FIFO = convert(Cint,0) -const CPX_SOLNPOOL_FILTER_DIVERSITY = convert(Cint,1) -const CPX_SOLNPOOL_FILTER_RANGE = convert(Cint,2) -const CPX_SOLNPOOL_OBJ = convert(Cint,1) -const CPX_STAT_ABORT_DETTIME_LIM = convert(Cint,25) -const CPX_STAT_ABORT_DUAL_OBJ_LIM = convert(Cint,22) -const CPX_STAT_ABORT_IT_LIM = convert(Cint,10) -const CPX_STAT_ABORT_OBJ_LIM = convert(Cint,12) -const CPX_STAT_ABORT_PRIM_OBJ_LIM = convert(Cint,21) -const CPX_STAT_ABORT_TIME_LIM = convert(Cint,11) -const CPX_STAT_ABORT_USER = convert(Cint,13) -const CPX_STAT_BENDERS_MASTER_UNBOUNDED = convert(Cint,40) -const CPX_STAT_BENDERS_NUM_BEST = convert(Cint,41) -const CPX_STAT_CONFLICT_ABORT_CONTRADICTION = convert(Cint,32) -const CPX_STAT_CONFLICT_ABORT_DETTIME_LIM = convert(Cint,39) -const CPX_STAT_CONFLICT_ABORT_IT_LIM = convert(Cint,34) -const CPX_STAT_CONFLICT_ABORT_MEM_LIM = convert(Cint,37) -const CPX_STAT_CONFLICT_ABORT_NODE_LIM = convert(Cint,35) -const CPX_STAT_CONFLICT_ABORT_OBJ_LIM = convert(Cint,36) -const CPX_STAT_CONFLICT_ABORT_TIME_LIM = convert(Cint,33) -const CPX_STAT_CONFLICT_ABORT_USER = convert(Cint,38) -const CPX_STAT_CONFLICT_FEASIBLE = convert(Cint,30) -const CPX_STAT_CONFLICT_MINIMAL = convert(Cint,31) -const CPX_STAT_FEASIBLE = convert(Cint,23) -const CPX_STAT_FEASIBLE_RELAXED_INF = convert(Cint,16) -const CPX_STAT_FEASIBLE_RELAXED_QUAD = convert(Cint,18) -const CPX_STAT_FEASIBLE_RELAXED_SUM = convert(Cint,14) -const CPX_STAT_FIRSTORDER = convert(Cint,24) -const CPX_STAT_INFEASIBLE = convert(Cint,3) -const CPX_STAT_INForUNBD = convert(Cint,4) -const CPX_STAT_MULTIOBJ_INFEASIBLE = convert(Cint,302) -const CPX_STAT_MULTIOBJ_INForUNBD = convert(Cint,303) -const CPX_STAT_MULTIOBJ_NON_OPTIMAL = convert(Cint,305) -const CPX_STAT_MULTIOBJ_OPTIMAL = convert(Cint,301) -const CPX_STAT_MULTIOBJ_STOPPED = convert(Cint,306) -const CPX_STAT_MULTIOBJ_UNBOUNDED = convert(Cint,304) -const CPX_STAT_NUM_BEST = convert(Cint,6) -const CPX_STAT_OPTIMAL = convert(Cint,1) -const CPX_STAT_OPTIMAL_FACE_UNBOUNDED = convert(Cint,20) -const CPX_STAT_OPTIMAL_INFEAS = convert(Cint,5) -const CPX_STAT_OPTIMAL_RELAXED_INF = convert(Cint,17) -const CPX_STAT_OPTIMAL_RELAXED_QUAD = convert(Cint,19) -const CPX_STAT_OPTIMAL_RELAXED_SUM = convert(Cint,15) -const CPX_STAT_UNBOUNDED = convert(Cint,2) -const CPX_SUM_COMP_SLACK = convert(Cint,21) -const CPX_SUM_DUAL_INFEAS = convert(Cint,7) -const CPX_SUM_DUAL_RESIDUAL = convert(Cint,17) -const CPX_SUM_INDSLACK_INFEAS = convert(Cint,50) -const CPX_SUM_INT_INFEAS = convert(Cint,10) -const CPX_SUM_PI = convert(Cint,33) -const CPX_SUM_PRIMAL_INFEAS = convert(Cint,3) -const CPX_SUM_PRIMAL_RESIDUAL = convert(Cint,13) -const CPX_SUM_PWLSLACK_INFEAS = convert(Cint,59) -const CPX_SUM_QCPRIMAL_RESIDUAL = convert(Cint,44) -const CPX_SUM_QCSLACK = convert(Cint,48) -const CPX_SUM_QCSLACK_INFEAS = convert(Cint,46) -const CPX_SUM_RED_COST = convert(Cint,37) -const CPX_SUM_SCALED_DUAL_INFEAS = convert(Cint,8) -const CPX_SUM_SCALED_DUAL_RESIDUAL = convert(Cint,18) -const CPX_SUM_SCALED_PI = convert(Cint,34) -const CPX_SUM_SCALED_PRIMAL_INFEAS = convert(Cint,4) -const CPX_SUM_SCALED_PRIMAL_RESIDUAL = convert(Cint,14) -const CPX_SUM_SCALED_RED_COST = convert(Cint,38) -const CPX_SUM_SCALED_SLACK = convert(Cint,36) -const CPX_SUM_SCALED_X = convert(Cint,32) -const CPX_SUM_SLACK = convert(Cint,35) -const CPX_SUM_X = convert(Cint,31) -const CPXERR_ABORT_STRONGBRANCH = convert(Cint,1263) -const CPXERR_ADJ_SIGN_QUAD = convert(Cint,1606) -const CPXERR_ADJ_SIGN_SENSE = convert(Cint,1604) -const CPXERR_ADJ_SIGNS = convert(Cint,1602) -const CPXERR_ARC_INDEX_RANGE = convert(Cint,1231) -const CPXERR_ARRAY_BAD_SOS_TYPE = convert(Cint,3009) -const CPXERR_ARRAY_NOT_ASCENDING = convert(Cint,1226) -const CPXERR_ARRAY_TOO_LONG = convert(Cint,1208) -const CPXERR_BAD_ARGUMENT = convert(Cint,1003) -const CPXERR_BAD_BOUND_SENSE = convert(Cint,1622) -const CPXERR_BAD_BOUND_TYPE = convert(Cint,1457) -const CPXERR_BAD_CHAR = convert(Cint,1537) -const CPXERR_BAD_CTYPE = convert(Cint,3021) -const CPXERR_BAD_DECOMPOSITION = convert(Cint,2002) -const CPXERR_BAD_DIRECTION = convert(Cint,3012) -const CPXERR_BAD_EXPO_RANGE = convert(Cint,1435) -const CPXERR_BAD_EXPONENT = convert(Cint,1618) -const CPXERR_BAD_FILETYPE = convert(Cint,1424) -const CPXERR_BAD_ID = convert(Cint,1617) -const CPXERR_BAD_INDCONSTR = convert(Cint,1439) -const CPXERR_BAD_INDICATOR = convert(Cint,1551) -const CPXERR_BAD_INDTYPE = convert(Cint,1216) -const CPXERR_BAD_LAZY_UCUT = convert(Cint,1438) -const CPXERR_BAD_LUB = convert(Cint,1229) -const CPXERR_BAD_METHOD = convert(Cint,1292) -const CPXERR_BAD_MULTIOBJ_ATTR = convert(Cint,1488) -const CPXERR_BAD_NUMBER = convert(Cint,1434) -const CPXERR_BAD_OBJ_SENSE = convert(Cint,1487) -const CPXERR_BAD_PARAM_NAME = convert(Cint,1028) -const CPXERR_BAD_PARAM_NUM = convert(Cint,1013) -const CPXERR_BAD_PIVOT = convert(Cint,1267) -const CPXERR_BAD_PRIORITY = convert(Cint,3006) -const CPXERR_BAD_PROB_TYPE = convert(Cint,1022) -const CPXERR_BAD_ROW_ID = convert(Cint,1532) -const CPXERR_BAD_SECTION_BOUNDS = convert(Cint,1473) -const CPXERR_BAD_SECTION_ENDATA = convert(Cint,1462) -const CPXERR_BAD_SECTION_QMATRIX = convert(Cint,1475) -const CPXERR_BAD_SENSE = convert(Cint,1215) -const CPXERR_BAD_SOS_TYPE = convert(Cint,1442) -const CPXERR_BAD_STATUS = convert(Cint,1253) -const CPXERR_BAS_FILE_SHORT = convert(Cint,1550) -const CPXERR_BAS_FILE_SIZE = convert(Cint,1555) -const CPXERR_BENDERS_MASTER_SOLVE = convert(Cint,2001) -const CPXERR_CALLBACK = convert(Cint,1006) -const CPXERR_CALLBACK_INCONSISTENT = convert(Cint,1060) -const CPXERR_CAND_NOT_POINT = convert(Cint,3025) -const CPXERR_CAND_NOT_RAY = convert(Cint,3026) -const CPXERR_CNTRL_IN_NAME = convert(Cint,1236) -const CPXERR_COL_INDEX_RANGE = convert(Cint,1201) -const CPXERR_COL_REPEAT_PRINT = convert(Cint,1478) -const CPXERR_COL_REPEATS = convert(Cint,1446) -const CPXERR_COL_ROW_REPEATS = convert(Cint,1443) -const CPXERR_COL_UNKNOWN = convert(Cint,1449) -const CPXERR_CONFLICT_UNSTABLE = convert(Cint,1720) -const CPXERR_COUNT_OVERLAP = convert(Cint,1228) -const CPXERR_COUNT_RANGE = convert(Cint,1227) -const CPXERR_CPUBINDING_FAILURE = convert(Cint,3700) -const CPXERR_DBL_MAX = convert(Cint,1233) -const CPXERR_DECOMPRESSION = convert(Cint,1027) -const CPXERR_DETTILIM_STRONGBRANCH = convert(Cint,1270) -const CPXERR_DUP_ENTRY = convert(Cint,1222) -const CPXERR_DYNFUNC = convert(Cint,1815) -const CPXERR_DYNLOAD = convert(Cint,1814) -const CPXERR_ENCODING_CONVERSION = convert(Cint,1235) -const CPXERR_EXTRA_BV_BOUND = convert(Cint,1456) -const CPXERR_EXTRA_FR_BOUND = convert(Cint,1455) -const CPXERR_EXTRA_FX_BOUND = convert(Cint,1454) -const CPXERR_EXTRA_INTEND = convert(Cint,1481) -const CPXERR_EXTRA_INTORG = convert(Cint,1480) -const CPXERR_EXTRA_SOSEND = convert(Cint,1483) -const CPXERR_EXTRA_SOSORG = convert(Cint,1482) -const CPXERR_FAIL_OPEN_READ = convert(Cint,1423) -const CPXERR_FAIL_OPEN_WRITE = convert(Cint,1422) -const CPXERR_FILE_ENTRIES = convert(Cint,1553) -const CPXERR_FILE_FORMAT = convert(Cint,1563) -const CPXERR_FILE_IO = convert(Cint,1426) -const CPXERR_FILTER_VARIABLE_TYPE = convert(Cint,3414) -const CPXERR_ILL_DEFINED_PWL = convert(Cint,1213) -const CPXERR_IN_INFOCALLBACK = convert(Cint,1804) -const CPXERR_INDEX_NOT_BASIC = convert(Cint,1251) -const CPXERR_INDEX_RANGE = convert(Cint,1200) -const CPXERR_INDEX_RANGE_HIGH = convert(Cint,1206) -const CPXERR_INDEX_RANGE_LOW = convert(Cint,1205) -const CPXERR_INT_TOO_BIG = convert(Cint,3018) -const CPXERR_INT_TOO_BIG_INPUT = convert(Cint,1463) -const CPXERR_INVALID_NUMBER = convert(Cint,1650) -const CPXERR_LIMITS_TOO_BIG = convert(Cint,1012) -const CPXERR_LINE_TOO_LONG = convert(Cint,1465) -const CPXERR_LO_BOUND_REPEATS = convert(Cint,1459) -const CPXERR_LOCK_CREATE = convert(Cint,1808) -const CPXERR_LP_NOT_IN_ENVIRONMENT = convert(Cint,1806) -const CPXERR_LP_PARSE = convert(Cint,1427) -const CPXERR_MASTER_SOLVE = convert(Cint,2005) -const CPXERR_MIPSEARCH_WITH_CALLBACKS = convert(Cint,1805) -const CPXERR_MISS_SOS_TYPE = convert(Cint,3301) -const CPXERR_MSG_NO_CHANNEL = convert(Cint,1051) -const CPXERR_MSG_NO_FILEPTR = convert(Cint,1052) -const CPXERR_MSG_NO_FUNCTION = convert(Cint,1053) -const CPXERR_MULTIOBJ_SUBPROB_SOLVE = convert(Cint,1300) -const CPXERR_MULTIPLE_PROBS_IN_REMOTE_ENVIRONMENT = convert(Cint,1816) -const CPXERR_NAME_CREATION = convert(Cint,1209) -const CPXERR_NAME_NOT_FOUND = convert(Cint,1210) -const CPXERR_NAME_TOO_LONG = convert(Cint,1464) -const CPXERR_NAN = convert(Cint,1225) -const CPXERR_NEED_OPT_SOLN = convert(Cint,1252) -const CPXERR_NEGATIVE_SURPLUS = convert(Cint,1207) -const CPXERR_NET_DATA = convert(Cint,1530) -const CPXERR_NET_FILE_SHORT = convert(Cint,1538) -const CPXERR_NO_BARRIER_SOLN = convert(Cint,1223) -const CPXERR_NO_BASIC_SOLN = convert(Cint,1261) -const CPXERR_NO_BASIS = convert(Cint,1262) -const CPXERR_NO_BOUND_SENSE = convert(Cint,1621) -const CPXERR_NO_BOUND_TYPE = convert(Cint,1460) -const CPXERR_NO_COLUMNS_SECTION = convert(Cint,1472) -const CPXERR_NO_CONFLICT = convert(Cint,1719) -const CPXERR_NO_DECOMPOSITION = convert(Cint,2000) -const CPXERR_NO_DUAL_SOLN = convert(Cint,1232) -const CPXERR_NO_ENDATA = convert(Cint,1552) -const CPXERR_NO_ENVIRONMENT = convert(Cint,1002) -const CPXERR_NO_FILENAME = convert(Cint,1421) -const CPXERR_NO_ID = convert(Cint,1616) -const CPXERR_NO_ID_FIRST = convert(Cint,1609) -const CPXERR_NO_INT_X = convert(Cint,3023) -const CPXERR_NO_KAPPASTATS = convert(Cint,1269) -const CPXERR_NO_LU_FACTOR = convert(Cint,1258) -const CPXERR_NO_MEMORY = convert(Cint,1001) -const CPXERR_NO_MIPSTART = convert(Cint,3020) -const CPXERR_NO_NAME_SECTION = convert(Cint,1441) -const CPXERR_NO_NAMES = convert(Cint,1219) -const CPXERR_NO_NORMS = convert(Cint,1264) -const CPXERR_NO_NUMBER = convert(Cint,1615) -const CPXERR_NO_NUMBER_BOUND = convert(Cint,1623) -const CPXERR_NO_NUMBER_FIRST = convert(Cint,1611) -const CPXERR_NO_OBJ_NAME = convert(Cint,1489) -const CPXERR_NO_OBJ_SENSE = convert(Cint,1436) -const CPXERR_NO_OBJECTIVE = convert(Cint,1476) -const CPXERR_NO_OP_OR_SENSE = convert(Cint,1608) -const CPXERR_NO_OPERATOR = convert(Cint,1607) -const CPXERR_NO_ORDER = convert(Cint,3016) -const CPXERR_NO_PROBLEM = convert(Cint,1009) -const CPXERR_NO_QP_OPERATOR = convert(Cint,1614) -const CPXERR_NO_QUAD_EXP = convert(Cint,1612) -const CPXERR_NO_RHS_COEFF = convert(Cint,1610) -const CPXERR_NO_RHS_IN_OBJ = convert(Cint,1211) -const CPXERR_NO_ROW_NAME = convert(Cint,1486) -const CPXERR_NO_ROW_SENSE = convert(Cint,1453) -const CPXERR_NO_ROWS_SECTION = convert(Cint,1471) -const CPXERR_NO_SENSIT = convert(Cint,1260) -const CPXERR_NO_SOLN = convert(Cint,1217) -const CPXERR_NO_SOLNPOOL = convert(Cint,3024) -const CPXERR_NO_SOS = convert(Cint,3015) -const CPXERR_NO_TREE = convert(Cint,3412) -const CPXERR_NO_VECTOR_SOLN = convert(Cint,1556) -const CPXERR_NODE_INDEX_RANGE = convert(Cint,1230) -const CPXERR_NODE_ON_DISK = convert(Cint,3504) -const CPXERR_NOT_DUAL_UNBOUNDED = convert(Cint,1265) -const CPXERR_NOT_FIXED = convert(Cint,1221) -const CPXERR_NOT_FOR_BENDERS = convert(Cint,2004) -const CPXERR_NOT_FOR_MIP = convert(Cint,1017) -const CPXERR_NOT_FOR_MULTIOBJ = convert(Cint,1070) -const CPXERR_NOT_FOR_QCP = convert(Cint,1031) -const CPXERR_NOT_FOR_QP = convert(Cint,1018) -const CPXERR_NOT_MILPCLASS = convert(Cint,1024) -const CPXERR_NOT_MIN_COST_FLOW = convert(Cint,1531) -const CPXERR_NOT_MIP = convert(Cint,3003) -const CPXERR_NOT_MIQPCLASS = convert(Cint,1029) -const CPXERR_NOT_ONE_PROBLEM = convert(Cint,1023) -const CPXERR_NOT_QP = convert(Cint,5004) -const CPXERR_NOT_SAV_FILE = convert(Cint,1560) -const CPXERR_NOT_UNBOUNDED = convert(Cint,1254) -const CPXERR_NULL_POINTER = convert(Cint,1004) -const CPXERR_ORDER_BAD_DIRECTION = convert(Cint,3007) -const CPXERR_OVERFLOW = convert(Cint,1810) -const CPXERR_PARAM_INCOMPATIBLE = convert(Cint,1807) -const CPXERR_PARAM_TOO_BIG = convert(Cint,1015) -const CPXERR_PARAM_TOO_SMALL = convert(Cint,1014) -const CPXERR_PRESLV_ABORT = convert(Cint,1106) -const CPXERR_PRESLV_BAD_PARAM = convert(Cint,1122) -const CPXERR_PRESLV_BASIS_MEM = convert(Cint,1107) -const CPXERR_PRESLV_COPYORDER = convert(Cint,1109) -const CPXERR_PRESLV_COPYSOS = convert(Cint,1108) -const CPXERR_PRESLV_CRUSHFORM = convert(Cint,1121) -const CPXERR_PRESLV_DETTIME_LIM = convert(Cint,1124) -const CPXERR_PRESLV_DUAL = convert(Cint,1119) -const CPXERR_PRESLV_FAIL_BASIS = convert(Cint,1114) -const CPXERR_PRESLV_INF = convert(Cint,1117) -const CPXERR_PRESLV_INForUNBD = convert(Cint,1101) -const CPXERR_PRESLV_NO_BASIS = convert(Cint,1115) -const CPXERR_PRESLV_NO_PROB = convert(Cint,1103) -const CPXERR_PRESLV_SOLN_MIP = convert(Cint,1110) -const CPXERR_PRESLV_SOLN_QP = convert(Cint,1111) -const CPXERR_PRESLV_START_LP = convert(Cint,1112) -const CPXERR_PRESLV_TIME_LIM = convert(Cint,1123) -const CPXERR_PRESLV_UNBD = convert(Cint,1118) -const CPXERR_PRESLV_UNCRUSHFORM = convert(Cint,1120) -const CPXERR_PRIIND = convert(Cint,1257) -const CPXERR_PRM_DATA = convert(Cint,1660) -const CPXERR_PRM_HEADER = convert(Cint,1661) -const CPXERR_PROTOCOL = convert(Cint,1812) -const CPXERR_Q_DIVISOR = convert(Cint,1619) -const CPXERR_Q_DUP_ENTRY = convert(Cint,5011) -const CPXERR_Q_NOT_INDEF = convert(Cint,5014) -const CPXERR_Q_NOT_POS_DEF = convert(Cint,5002) -const CPXERR_Q_NOT_SYMMETRIC = convert(Cint,5012) -const CPXERR_QCP_SENSE = convert(Cint,6002) -const CPXERR_QCP_SENSE_FILE = convert(Cint,1437) -const CPXERR_QUAD_EXP_NOT_2 = convert(Cint,1613) -const CPXERR_QUAD_IN_ROW = convert(Cint,1605) -const CPXERR_RANGE_SECTION_ORDER = convert(Cint,1474) -const CPXERR_RESTRICTED_VERSION = convert(Cint,1016) -const CPXERR_RHS_IN_OBJ = convert(Cint,1603) -const CPXERR_RIM_REPEATS = convert(Cint,1447) -const CPXERR_RIM_ROW_REPEATS = convert(Cint,1444) -const CPXERR_RIMNZ_REPEATS = convert(Cint,1479) -const CPXERR_ROW_INDEX_RANGE = convert(Cint,1203) -const CPXERR_ROW_REPEAT_PRINT = convert(Cint,1477) -const CPXERR_ROW_REPEATS = convert(Cint,1445) -const CPXERR_ROW_UNKNOWN = convert(Cint,1448) -const CPXERR_SAV_FILE_DATA = convert(Cint,1561) -const CPXERR_SAV_FILE_VALUE = convert(Cint,1564) -const CPXERR_SAV_FILE_WRITE = convert(Cint,1562) -const CPXERR_SBASE_ILLEGAL = convert(Cint,1554) -const CPXERR_SBASE_INCOMPAT = convert(Cint,1255) -const CPXERR_SINGULAR = convert(Cint,1256) -const CPXERR_STR_PARAM_TOO_LONG = convert(Cint,1026) -const CPXERR_SUBPROB_SOLVE = convert(Cint,3019) -const CPXERR_SYNCPRIM_CREATE = convert(Cint,1809) -const CPXERR_SYSCALL = convert(Cint,1813) -const CPXERR_THREAD_FAILED = convert(Cint,1234) -const CPXERR_TILIM_CONDITION_NO = convert(Cint,1268) -const CPXERR_TILIM_STRONGBRANCH = convert(Cint,1266) -const CPXERR_TOO_MANY_COEFFS = convert(Cint,1433) -const CPXERR_TOO_MANY_COLS = convert(Cint,1432) -const CPXERR_TOO_MANY_RIMNZ = convert(Cint,1485) -const CPXERR_TOO_MANY_RIMS = convert(Cint,1484) -const CPXERR_TOO_MANY_ROWS = convert(Cint,1431) -const CPXERR_TOO_MANY_THREADS = convert(Cint,1020) -const CPXERR_TREE_MEMORY_LIMIT = convert(Cint,3413) -const CPXERR_TUNE_MIXED = convert(Cint,1730) -const CPXERR_UNIQUE_WEIGHTS = convert(Cint,3010) -const CPXERR_UNSUPPORTED_CONSTRAINT_TYPE = convert(Cint,1212) -const CPXERR_UNSUPPORTED_OPERATION = convert(Cint,1811) -const CPXERR_UP_BOUND_REPEATS = convert(Cint,1458) -const CPXERR_WORK_FILE_OPEN = convert(Cint,1801) -const CPXERR_WORK_FILE_READ = convert(Cint,1802) -const CPXERR_WORK_FILE_WRITE = convert(Cint,1803) -const CPXERR_XMLPARSE = convert(Cint,1425) -const CPXMESSAGEBUFSIZE = convert(Cint,1024) -const CPXMI_BIGM_COEF = convert(Cint,1040) -const CPXMI_BIGM_TO_IND = convert(Cint,1041) -const CPXMI_BIGM_VARBOUND = convert(Cint,1042) -const CPXMI_CANCEL_TOL = convert(Cint,1045) -const CPXMI_EPGAP_LARGE = convert(Cint,1038) -const CPXMI_EPGAP_OBJOFFSET = convert(Cint,1037) -const CPXMI_FEAS_TOL = convert(Cint,1043) -const CPXMI_FRACTION_SCALING = convert(Cint,1047) -const CPXMI_IND_NZ_LARGE_NUM = convert(Cint,1019) -const CPXMI_IND_NZ_SMALL_NUM = convert(Cint,1020) -const CPXMI_IND_RHS_LARGE_NUM = convert(Cint,1021) -const CPXMI_IND_RHS_SMALL_NUM = convert(Cint,1022) -const CPXMI_KAPPA_ILLPOSED = convert(Cint,1035) -const CPXMI_KAPPA_SUSPICIOUS = convert(Cint,1033) -const CPXMI_KAPPA_UNSTABLE = convert(Cint,1034) -const CPXMI_LB_LARGE_NUM = convert(Cint,1003) -const CPXMI_LB_SMALL_NUM = convert(Cint,1004) -const CPXMI_LC_NZ_LARGE_NUM = convert(Cint,1023) -const CPXMI_LC_NZ_SMALL_NUM = convert(Cint,1024) -const CPXMI_LC_RHS_LARGE_NUM = convert(Cint,1025) -const CPXMI_LC_RHS_SMALL_NUM = convert(Cint,1026) -const CPXMI_MULTIOBJ_COEFFS = convert(Cint,1062) -const CPXMI_MULTIOBJ_LARGE_NUM = convert(Cint,1058) -const CPXMI_MULTIOBJ_MIX = convert(Cint,1063) -const CPXMI_MULTIOBJ_OPT_TOL = convert(Cint,1060) -const CPXMI_MULTIOBJ_SMALL_NUM = convert(Cint,1059) -const CPXMI_NZ_LARGE_NUM = convert(Cint,1009) -const CPXMI_NZ_SMALL_NUM = convert(Cint,1010) -const CPXMI_OBJ_LARGE_NUM = convert(Cint,1001) -const CPXMI_OBJ_SMALL_NUM = convert(Cint,1002) -const CPXMI_OPT_TOL = convert(Cint,1044) -const CPXMI_QC_LINNZ_LARGE_NUM = convert(Cint,1015) -const CPXMI_QC_LINNZ_SMALL_NUM = convert(Cint,1016) -const CPXMI_QC_QNZ_LARGE_NUM = convert(Cint,1017) -const CPXMI_QC_QNZ_SMALL_NUM = convert(Cint,1018) -const CPXMI_QC_RHS_LARGE_NUM = convert(Cint,1013) -const CPXMI_QC_RHS_SMALL_NUM = convert(Cint,1014) -const CPXMI_QOBJ_LARGE_NUM = convert(Cint,1011) -const CPXMI_QOBJ_SMALL_NUM = convert(Cint,1012) -const CPXMI_QOPT_TOL = convert(Cint,1046) -const CPXMI_RHS_LARGE_NUM = convert(Cint,1007) -const CPXMI_RHS_SMALL_NUM = convert(Cint,1008) -const CPXMI_SAMECOEFF_COL = convert(Cint,1050) -const CPXMI_SAMECOEFF_IND = convert(Cint,1051) -const CPXMI_SAMECOEFF_LAZY = convert(Cint,1054) -const CPXMI_SAMECOEFF_MULTIOBJ = convert(Cint,1061) -const CPXMI_SAMECOEFF_OBJ = convert(Cint,1057) -const CPXMI_SAMECOEFF_QLIN = convert(Cint,1052) -const CPXMI_SAMECOEFF_QUAD = convert(Cint,1053) -const CPXMI_SAMECOEFF_RHS = convert(Cint,1056) -const CPXMI_SAMECOEFF_ROW = convert(Cint,1049) -const CPXMI_SAMECOEFF_UCUT = convert(Cint,1055) -const CPXMI_SINGLE_PRECISION = convert(Cint,1036) -const CPXMI_SYMMETRY_BREAKING_INEQ = convert(Cint,1039) -const CPXMI_UB_LARGE_NUM = convert(Cint,1005) -const CPXMI_UB_SMALL_NUM = convert(Cint,1006) -const CPXMI_UC_NZ_LARGE_NUM = convert(Cint,1027) -const CPXMI_UC_NZ_SMALL_NUM = convert(Cint,1028) -const CPXMI_UC_RHS_LARGE_NUM = convert(Cint,1029) -const CPXMI_UC_RHS_SMALL_NUM = convert(Cint,1030) -const CPXMI_WIDE_COEFF_RANGE = convert(Cint,1048) -const CPXMIP_ABORT_FEAS = convert(Cint,113) -const CPXMIP_ABORT_INFEAS = convert(Cint,114) -const CPXMIP_ABORT_RELAXATION_UNBOUNDED = convert(Cint,133) -const CPXMIP_ABORT_RELAXED = convert(Cint,126) -const CPXMIP_BENDERS_MASTER_UNBOUNDED = convert(Cint,134) -const CPXMIP_DETTIME_LIM_FEAS = convert(Cint,131) -const CPXMIP_DETTIME_LIM_INFEAS = convert(Cint,132) -const CPXMIP_FAIL_FEAS = convert(Cint,109) -const CPXMIP_FAIL_FEAS_NO_TREE = convert(Cint,116) -const CPXMIP_FAIL_INFEAS = convert(Cint,110) -const CPXMIP_FAIL_INFEAS_NO_TREE = convert(Cint,117) -const CPXMIP_FEASIBLE = convert(Cint,127) -const CPXMIP_FEASIBLE_RELAXED_INF = convert(Cint,122) -const CPXMIP_FEASIBLE_RELAXED_QUAD = convert(Cint,124) -const CPXMIP_FEASIBLE_RELAXED_SUM = convert(Cint,120) -const CPXMIP_INFEASIBLE = convert(Cint,103) -const CPXMIP_INForUNBD = convert(Cint,119) -const CPXMIP_MEM_LIM_FEAS = convert(Cint,111) -const CPXMIP_MEM_LIM_INFEAS = convert(Cint,112) -const CPXMIP_NODE_LIM_FEAS = convert(Cint,105) -const CPXMIP_NODE_LIM_INFEAS = convert(Cint,106) -const CPXMIP_OPTIMAL = convert(Cint,101) -const CPXMIP_OPTIMAL_INFEAS = convert(Cint,115) -const CPXMIP_OPTIMAL_POPULATED = convert(Cint,129) -const CPXMIP_OPTIMAL_POPULATED_TOL = convert(Cint,130) -const CPXMIP_OPTIMAL_RELAXED_INF = convert(Cint,123) -const CPXMIP_OPTIMAL_RELAXED_QUAD = convert(Cint,125) -const CPXMIP_OPTIMAL_RELAXED_SUM = convert(Cint,121) -const CPXMIP_OPTIMAL_TOL = convert(Cint,102) -const CPXMIP_POPULATESOL_LIM = convert(Cint,128) -const CPXMIP_SOL_LIM = convert(Cint,104) -const CPXMIP_TIME_LIM_FEAS = convert(Cint,107) -const CPXMIP_TIME_LIM_INFEAS = convert(Cint,108) -const CPXMIP_UNBOUNDED = convert(Cint,118) -const CPXPARAM_H = convert(Cint,1) -const CPXPARAM_Advance = convert(Cint,1001) -const CPXPARAM_Barrier_Algorithm = convert(Cint,3007) -const CPXPARAM_Barrier_ColNonzeros = convert(Cint,3009) -const CPXPARAM_Barrier_ConvergeTol = convert(Cint,3002) -const CPXPARAM_Barrier_Crossover = convert(Cint,3018) -const CPXPARAM_Barrier_Display = convert(Cint,3010) -const CPXPARAM_Barrier_Limits_Corrections = convert(Cint,3013) -const CPXPARAM_Barrier_Limits_Growth = convert(Cint,3003) -const CPXPARAM_Barrier_Limits_Iteration = convert(Cint,3012) -const CPXPARAM_Barrier_Limits_ObjRange = convert(Cint,3004) -const CPXPARAM_Barrier_Ordering = convert(Cint,3014) -const CPXPARAM_Barrier_QCPConvergeTol = convert(Cint,3020) -const CPXPARAM_Barrier_StartAlg = convert(Cint,3017) -const CPXPARAM_Benders_Strategy = convert(Cint,1501) -const CPXPARAM_Benders_Tolerances_feasibilitycut = convert(Cint,1509) -const CPXPARAM_Benders_Tolerances_optimalitycut = convert(Cint,1510) -const CPXPARAM_Benders_WorkerAlgorithm = convert(Cint,1500) -const CPXPARAM_ClockType = convert(Cint,1006) -const CPXPARAM_Conflict_Algorithm = convert(Cint,1073) -const CPXPARAM_Conflict_Display = convert(Cint,1074) -const CPXPARAM_CPUmask = convert(Cint,1144) -const CPXPARAM_DetTimeLimit = convert(Cint,1127) -const CPXPARAM_DistMIP_Rampup_DetTimeLimit = convert(Cint,2164) -const CPXPARAM_DistMIP_Rampup_Duration = convert(Cint,2163) -const CPXPARAM_DistMIP_Rampup_TimeLimit = convert(Cint,2165) -const CPXPARAM_Emphasis_Memory = convert(Cint,1082) -const CPXPARAM_Emphasis_MIP = convert(Cint,2058) -const CPXPARAM_Emphasis_Numerical = convert(Cint,1083) -const CPXPARAM_Feasopt_Mode = convert(Cint,1084) -const CPXPARAM_Feasopt_Tolerance = convert(Cint,2073) -const CPXPARAM_LPMethod = convert(Cint,1062) -const CPXPARAM_MIP_Cuts_BQP = convert(Cint,2195) -const CPXPARAM_MIP_Cuts_Cliques = convert(Cint,2003) -const CPXPARAM_MIP_Cuts_Covers = convert(Cint,2005) -const CPXPARAM_MIP_Cuts_Disjunctive = convert(Cint,2053) -const CPXPARAM_MIP_Cuts_FlowCovers = convert(Cint,2040) -const CPXPARAM_MIP_Cuts_Gomory = convert(Cint,2049) -const CPXPARAM_MIP_Cuts_GUBCovers = convert(Cint,2044) -const CPXPARAM_MIP_Cuts_Implied = convert(Cint,2041) -const CPXPARAM_MIP_Cuts_LiftProj = convert(Cint,2152) -const CPXPARAM_MIP_Cuts_LocalImplied = convert(Cint,2181) -const CPXPARAM_MIP_Cuts_MCFCut = convert(Cint,2134) -const CPXPARAM_MIP_Cuts_MIRCut = convert(Cint,2052) -const CPXPARAM_MIP_Cuts_PathCut = convert(Cint,2051) -const CPXPARAM_MIP_Cuts_RLT = convert(Cint,2196) -const CPXPARAM_MIP_Cuts_ZeroHalfCut = convert(Cint,2111) -const CPXPARAM_MIP_Display = convert(Cint,2012) -const CPXPARAM_MIP_Interval = convert(Cint,2013) -const CPXPARAM_MIP_Limits_AggForCut = convert(Cint,2054) -const CPXPARAM_MIP_Limits_AuxRootThreads = convert(Cint,2139) -const CPXPARAM_MIP_Limits_CutPasses = convert(Cint,2056) -const CPXPARAM_MIP_Limits_CutsFactor = convert(Cint,2033) -const CPXPARAM_MIP_Limits_EachCutLimit = convert(Cint,2102) -const CPXPARAM_MIP_Limits_GomoryCand = convert(Cint,2048) -const CPXPARAM_MIP_Limits_GomoryPass = convert(Cint,2050) -const CPXPARAM_MIP_Limits_Nodes = convert(Cint,2017) -const CPXPARAM_MIP_Limits_PolishTime = convert(Cint,2066) -const CPXPARAM_MIP_Limits_Populate = convert(Cint,2108) -const CPXPARAM_MIP_Limits_ProbeDetTime = convert(Cint,2150) -const CPXPARAM_MIP_Limits_ProbeTime = convert(Cint,2065) -const CPXPARAM_MIP_Limits_RepairTries = convert(Cint,2067) -const CPXPARAM_MIP_Limits_Solutions = convert(Cint,2015) -const CPXPARAM_MIP_Limits_StrongCand = convert(Cint,2045) -const CPXPARAM_MIP_Limits_StrongIt = convert(Cint,2046) -const CPXPARAM_MIP_Limits_TreeMemory = convert(Cint,2027) -const CPXPARAM_MIP_OrderType = convert(Cint,2032) -const CPXPARAM_MIP_PolishAfter_AbsMIPGap = convert(Cint,2126) -const CPXPARAM_MIP_PolishAfter_DetTime = convert(Cint,2151) -const CPXPARAM_MIP_PolishAfter_MIPGap = convert(Cint,2127) -const CPXPARAM_MIP_PolishAfter_Nodes = convert(Cint,2128) -const CPXPARAM_MIP_PolishAfter_Solutions = convert(Cint,2129) -const CPXPARAM_MIP_PolishAfter_Time = convert(Cint,2130) -const CPXPARAM_MIP_Pool_AbsGap = convert(Cint,2106) -const CPXPARAM_MIP_Pool_Capacity = convert(Cint,2103) -const CPXPARAM_MIP_Pool_Intensity = convert(Cint,2107) -const CPXPARAM_MIP_Pool_RelGap = convert(Cint,2105) -const CPXPARAM_MIP_Pool_Replace = convert(Cint,2104) -const CPXPARAM_MIP_Strategy_Backtrack = convert(Cint,2002) -const CPXPARAM_MIP_Strategy_BBInterval = convert(Cint,2039) -const CPXPARAM_MIP_Strategy_Branch = convert(Cint,2001) -const CPXPARAM_MIP_Strategy_CallbackReducedLP = convert(Cint,2055) -const CPXPARAM_MIP_Strategy_Dive = convert(Cint,2060) -const CPXPARAM_MIP_Strategy_File = convert(Cint,2016) -const CPXPARAM_MIP_Strategy_FPHeur = convert(Cint,2098) -const CPXPARAM_MIP_Strategy_HeuristicFreq = convert(Cint,2031) -const CPXPARAM_MIP_Strategy_KappaStats = convert(Cint,2137) -const CPXPARAM_MIP_Strategy_LBHeur = convert(Cint,2063) -const CPXPARAM_MIP_Strategy_MIQCPStrat = convert(Cint,2110) -const CPXPARAM_MIP_Strategy_NodeSelect = convert(Cint,2018) -const CPXPARAM_MIP_Strategy_Order = convert(Cint,2020) -const CPXPARAM_MIP_Strategy_PresolveNode = convert(Cint,2037) -const CPXPARAM_MIP_Strategy_Probe = convert(Cint,2042) -const CPXPARAM_MIP_Strategy_RINSHeur = convert(Cint,2061) -const CPXPARAM_MIP_Strategy_Search = convert(Cint,2109) -const CPXPARAM_MIP_Strategy_StartAlgorithm = convert(Cint,2025) -const CPXPARAM_MIP_Strategy_SubAlgorithm = convert(Cint,2026) -const CPXPARAM_MIP_Strategy_VariableSelect = convert(Cint,2028) -const CPXPARAM_MIP_SubMIP_StartAlg = convert(Cint,2205) -const CPXPARAM_MIP_SubMIP_SubAlg = convert(Cint,2206) -const CPXPARAM_MIP_SubMIP_NodeLimit = convert(Cint,2212) -const CPXPARAM_MIP_SubMIP_Scale = convert(Cint,2207) -const CPXPARAM_MIP_Tolerances_AbsMIPGap = convert(Cint,2008) -const CPXPARAM_MIP_Tolerances_Linearization = convert(Cint,2068) -const CPXPARAM_MIP_Tolerances_Integrality = convert(Cint,2010) -const CPXPARAM_MIP_Tolerances_LowerCutoff = convert(Cint,2006) -const CPXPARAM_MIP_Tolerances_MIPGap = convert(Cint,2009) -const CPXPARAM_MIP_Tolerances_ObjDifference = convert(Cint,2019) -const CPXPARAM_MIP_Tolerances_RelObjDifference = convert(Cint,2022) -const CPXPARAM_MIP_Tolerances_UpperCutoff = convert(Cint,2007) -const CPXPARAM_MultiObjective_Display = convert(Cint,1600) -const CPXPARAM_Network_Display = convert(Cint,5005) -const CPXPARAM_Network_Iterations = convert(Cint,5001) -const CPXPARAM_Network_NetFind = convert(Cint,1022) -const CPXPARAM_Network_Pricing = convert(Cint,5004) -const CPXPARAM_Network_Tolerances_Feasibility = convert(Cint,5003) -const CPXPARAM_Network_Tolerances_Optimality = convert(Cint,5002) -const CPXPARAM_OptimalityTarget = convert(Cint,1131) -const CPXPARAM_Output_CloneLog = convert(Cint,1132) -const CPXPARAM_Output_IntSolFilePrefix = convert(Cint,2143) -const CPXPARAM_Output_MPSLong = convert(Cint,1081) -const CPXPARAM_Output_WriteLevel = convert(Cint,1114) -const CPXPARAM_Parallel = convert(Cint,1109) -const CPXPARAM_ParamDisplay = convert(Cint,1163) -const CPXPARAM_Preprocessing_Aggregator = convert(Cint,1003) -const CPXPARAM_Preprocessing_BoundStrength = convert(Cint,2029) -const CPXPARAM_Preprocessing_CoeffReduce = convert(Cint,2004) -const CPXPARAM_Preprocessing_Dependency = convert(Cint,1008) -const CPXPARAM_Preprocessing_Dual = convert(Cint,1044) -const CPXPARAM_Preprocessing_Fill = convert(Cint,1002) -const CPXPARAM_Preprocessing_Folding = convert(Cint,1164) -const CPXPARAM_Preprocessing_Linear = convert(Cint,1058) -const CPXPARAM_Preprocessing_NumPass = convert(Cint,1052) -const CPXPARAM_Preprocessing_Presolve = convert(Cint,1030) -const CPXPARAM_Preprocessing_QCPDuals = convert(Cint,4003) -const CPXPARAM_Preprocessing_QPMakePSD = convert(Cint,4010) -const CPXPARAM_Preprocessing_QToLin = convert(Cint,4012) -const CPXPARAM_Preprocessing_Reduce = convert(Cint,1057) -const CPXPARAM_Preprocessing_Relax = convert(Cint,2034) -const CPXPARAM_Preprocessing_RepeatPresolve = convert(Cint,2064) -const CPXPARAM_Preprocessing_Symmetry = convert(Cint,2059) -const CPXPARAM_QPMethod = convert(Cint,1063) -const CPXPARAM_RandomSeed = convert(Cint,1124) -const CPXPARAM_Read_APIEncoding = convert(Cint,1130) -const CPXPARAM_Read_Constraints = convert(Cint,1021) -const CPXPARAM_Read_DataCheck = convert(Cint,1056) -const CPXPARAM_Read_FileEncoding = convert(Cint,1129) -const CPXPARAM_Read_Nonzeros = convert(Cint,1024) -const CPXPARAM_Read_QPNonzeros = convert(Cint,4001) -const CPXPARAM_Read_Scale = convert(Cint,1034) -const CPXPARAM_Read_Variables = convert(Cint,1023) -const CPXPARAM_Read_WarningLimit = convert(Cint,1157) -const CPXPARAM_Record = convert(Cint,1162) -const CPXPARAM_ScreenOutput = convert(Cint,1035) -const CPXPARAM_Sifting_Algorithm = convert(Cint,1077) -const CPXPARAM_Sifting_Simplex = convert(Cint,1158) -const CPXPARAM_Sifting_Display = convert(Cint,1076) -const CPXPARAM_Sifting_Iterations = convert(Cint,1078) -const CPXPARAM_Simplex_Crash = convert(Cint,1007) -const CPXPARAM_Simplex_DGradient = convert(Cint,1009) -const CPXPARAM_Simplex_Display = convert(Cint,1019) -const CPXPARAM_Simplex_DynamicRows = convert(Cint,1161) -const CPXPARAM_Simplex_Limits_Iterations = convert(Cint,1020) -const CPXPARAM_Simplex_Limits_LowerObj = convert(Cint,1025) -const CPXPARAM_Simplex_Limits_Perturbation = convert(Cint,1028) -const CPXPARAM_Simplex_Limits_Singularity = convert(Cint,1037) -const CPXPARAM_Simplex_Limits_UpperObj = convert(Cint,1026) -const CPXPARAM_Simplex_Perturbation_Constant = convert(Cint,1015) -const CPXPARAM_Simplex_Perturbation_Indicator = convert(Cint,1027) -const CPXPARAM_Simplex_PGradient = convert(Cint,1029) -const CPXPARAM_Simplex_Pricing = convert(Cint,1010) -const CPXPARAM_Simplex_Refactor = convert(Cint,1031) -const CPXPARAM_Simplex_Tolerances_Feasibility = convert(Cint,1016) -const CPXPARAM_Simplex_Tolerances_Markowitz = convert(Cint,1013) -const CPXPARAM_Simplex_Tolerances_Optimality = convert(Cint,1014) -const CPXPARAM_SolutionType = convert(Cint,1147) -const CPXPARAM_Threads = convert(Cint,1067) -const CPXPARAM_TimeLimit = convert(Cint,1039) -const CPXPARAM_Tune_DetTimeLimit = convert(Cint,1139) -const CPXPARAM_Tune_Display = convert(Cint,1113) -const CPXPARAM_Tune_Measure = convert(Cint,1110) -const CPXPARAM_Tune_Repeat = convert(Cint,1111) -const CPXPARAM_Tune_TimeLimit = convert(Cint,1112) -const CPXPARAM_WorkDir = convert(Cint,1064) -const CPXPARAM_WorkMem = convert(Cint,1065) -const CPXPUBLICPARAMS_H = convert(Cint,1) -const CPX_PARAM_ADVIND = convert(Cint,1001) -const CPX_PARAM_AGGFILL = convert(Cint,1002) -const CPX_PARAM_AGGIND = convert(Cint,1003) -const CPX_PARAM_CLOCKTYPE = convert(Cint,1006) -const CPX_PARAM_CRAIND = convert(Cint,1007) -const CPX_PARAM_DEPIND = convert(Cint,1008) -const CPX_PARAM_DPRIIND = convert(Cint,1009) -const CPX_PARAM_PRICELIM = convert(Cint,1010) -const CPX_PARAM_EPMRK = convert(Cint,1013) -const CPX_PARAM_EPOPT = convert(Cint,1014) -const CPX_PARAM_EPPER = convert(Cint,1015) -const CPX_PARAM_EPRHS = convert(Cint,1016) -const CPX_PARAM_SIMDISPLAY = convert(Cint,1019) -const CPX_PARAM_ITLIM = convert(Cint,1020) -const CPX_PARAM_ROWREADLIM = convert(Cint,1021) -const CPX_PARAM_NETFIND = convert(Cint,1022) -const CPX_PARAM_COLREADLIM = convert(Cint,1023) -const CPX_PARAM_NZREADLIM = convert(Cint,1024) -const CPX_PARAM_OBJLLIM = convert(Cint,1025) -const CPX_PARAM_OBJULIM = convert(Cint,1026) -const CPX_PARAM_PERIND = convert(Cint,1027) -const CPX_PARAM_PERLIM = convert(Cint,1028) -const CPX_PARAM_PPRIIND = convert(Cint,1029) -const CPX_PARAM_PREIND = convert(Cint,1030) -const CPX_PARAM_REINV = convert(Cint,1031) -const CPX_PARAM_SCAIND = convert(Cint,1034) -const CPX_PARAM_SCRIND = convert(Cint,1035) -const CPX_PARAM_SINGLIM = convert(Cint,1037) -const CPX_PARAM_TILIM = convert(Cint,1039) -const CPX_PARAM_PREDUAL = convert(Cint,1044) -const CPX_PARAM_PREPASS = convert(Cint,1052) -const CPX_PARAM_DATACHECK = convert(Cint,1056) -const CPX_PARAM_REDUCE = convert(Cint,1057) -const CPX_PARAM_PRELINEAR = convert(Cint,1058) -const CPX_PARAM_LPMETHOD = convert(Cint,1062) -const CPX_PARAM_QPMETHOD = convert(Cint,1063) -const CPX_PARAM_WORKDIR = convert(Cint,1064) -const CPX_PARAM_WORKMEM = convert(Cint,1065) -const CPX_PARAM_THREADS = convert(Cint,1067) -const CPX_PARAM_CONFLICTALG = convert(Cint,1073) -const CPX_PARAM_CONFLICTDISPLAY = convert(Cint,1074) -const CPX_PARAM_SIFTDISPLAY = convert(Cint,1076) -const CPX_PARAM_SIFTALG = convert(Cint,1077) -const CPX_PARAM_SIFTITLIM = convert(Cint,1078) -const CPX_PARAM_MPSLONGNUM = convert(Cint,1081) -const CPX_PARAM_MEMORYEMPHASIS = convert(Cint,1082) -const CPX_PARAM_NUMERICALEMPHASIS = convert(Cint,1083) -const CPX_PARAM_FEASOPTMODE = convert(Cint,1084) -const CPX_PARAM_PARALLELMODE = convert(Cint,1109) -const CPX_PARAM_TUNINGMEASURE = convert(Cint,1110) -const CPX_PARAM_TUNINGREPEAT = convert(Cint,1111) -const CPX_PARAM_TUNINGTILIM = convert(Cint,1112) -const CPX_PARAM_TUNINGDISPLAY = convert(Cint,1113) -const CPX_PARAM_WRITELEVEL = convert(Cint,1114) -const CPX_PARAM_RANDOMSEED = convert(Cint,1124) -const CPX_PARAM_DETTILIM = convert(Cint,1127) -const CPX_PARAM_FILEENCODING = convert(Cint,1129) -const CPX_PARAM_APIENCODING = convert(Cint,1130) -const CPX_PARAM_OPTIMALITYTARGET = convert(Cint,1131) -const CPX_PARAM_CLONELOG = convert(Cint,1132) -const CPX_PARAM_TUNINGDETTILIM = convert(Cint,1139) -const CPX_PARAM_CPUMASK = convert(Cint,1144) -const CPX_PARAM_SOLUTIONTYPE = convert(Cint,1147) -const CPX_PARAM_WARNLIM = convert(Cint,1157) -const CPX_PARAM_SIFTSIM = convert(Cint,1158) -const CPX_PARAM_DYNAMICROWS = convert(Cint,1161) -const CPX_PARAM_RECORD = convert(Cint,1162) -const CPX_PARAM_PARAMDISPLAY = convert(Cint,1163) -const CPX_PARAM_FOLDING = convert(Cint,1164) -const CPX_PARAM_WORKERALG = convert(Cint,1500) -const CPX_PARAM_BENDERSSTRATEGY = convert(Cint,1501) -const CPX_PARAM_BENDERSFEASCUTTOL = convert(Cint,1509) -const CPX_PARAM_BENDERSOPTCUTTOL = convert(Cint,1510) -const CPX_PARAM_MULTIOBJDISPLAY = convert(Cint,1600) -const CPX_PARAM_BRDIR = convert(Cint,2001) -const CPX_PARAM_BTTOL = convert(Cint,2002) -const CPX_PARAM_CLIQUES = convert(Cint,2003) -const CPX_PARAM_COEREDIND = convert(Cint,2004) -const CPX_PARAM_COVERS = convert(Cint,2005) -const CPX_PARAM_CUTLO = convert(Cint,2006) -const CPX_PARAM_CUTUP = convert(Cint,2007) -const CPX_PARAM_EPAGAP = convert(Cint,2008) -const CPX_PARAM_EPGAP = convert(Cint,2009) -const CPX_PARAM_EPINT = convert(Cint,2010) -const CPX_PARAM_MIPDISPLAY = convert(Cint,2012) -const CPX_PARAM_MIPINTERVAL = convert(Cint,2013) -const CPX_PARAM_INTSOLLIM = convert(Cint,2015) -const CPX_PARAM_NODEFILEIND = convert(Cint,2016) -const CPX_PARAM_NODELIM = convert(Cint,2017) -const CPX_PARAM_NODESEL = convert(Cint,2018) -const CPX_PARAM_OBJDIF = convert(Cint,2019) -const CPX_PARAM_MIPORDIND = convert(Cint,2020) -const CPX_PARAM_RELOBJDIF = convert(Cint,2022) -const CPX_PARAM_STARTALG = convert(Cint,2025) -const CPX_PARAM_SUBALG = convert(Cint,2026) -const CPX_PARAM_TRELIM = convert(Cint,2027) -const CPX_PARAM_VARSEL = convert(Cint,2028) -const CPX_PARAM_BNDSTRENIND = convert(Cint,2029) -const CPX_PARAM_HEURFREQ = convert(Cint,2031) -const CPX_PARAM_MIPORDTYPE = convert(Cint,2032) -const CPX_PARAM_CUTSFACTOR = convert(Cint,2033) -const CPX_PARAM_RELAXPREIND = convert(Cint,2034) -const CPX_PARAM_PRESLVND = convert(Cint,2037) -const CPX_PARAM_BBINTERVAL = convert(Cint,2039) -const CPX_PARAM_FLOWCOVERS = convert(Cint,2040) -const CPX_PARAM_IMPLBD = convert(Cint,2041) -const CPX_PARAM_PROBE = convert(Cint,2042) -const CPX_PARAM_GUBCOVERS = convert(Cint,2044) -const CPX_PARAM_STRONGCANDLIM = convert(Cint,2045) -const CPX_PARAM_STRONGITLIM = convert(Cint,2046) -const CPX_PARAM_FRACCAND = convert(Cint,2048) -const CPX_PARAM_FRACCUTS = convert(Cint,2049) -const CPX_PARAM_FRACPASS = convert(Cint,2050) -const CPX_PARAM_FLOWPATHS = convert(Cint,2051) -const CPX_PARAM_MIRCUTS = convert(Cint,2052) -const CPX_PARAM_DISJCUTS = convert(Cint,2053) -const CPX_PARAM_AGGCUTLIM = convert(Cint,2054) -const CPX_PARAM_MIPCBREDLP = convert(Cint,2055) -const CPX_PARAM_CUTPASS = convert(Cint,2056) -const CPX_PARAM_MIPEMPHASIS = convert(Cint,2058) -const CPX_PARAM_SYMMETRY = convert(Cint,2059) -const CPX_PARAM_DIVETYPE = convert(Cint,2060) -const CPX_PARAM_RINSHEUR = convert(Cint,2061) -const CPX_PARAM_LBHEUR = convert(Cint,2063) -const CPX_PARAM_REPEATPRESOLVE = convert(Cint,2064) -const CPX_PARAM_PROBETIME = convert(Cint,2065) -const CPX_PARAM_POLISHTIME = convert(Cint,2066) -const CPX_PARAM_REPAIRTRIES = convert(Cint,2067) -const CPX_PARAM_EPLIN = convert(Cint,2068) -const CPX_PARAM_EPRELAX = convert(Cint,2073) -const CPX_PARAM_FPHEUR = convert(Cint,2098) -const CPX_PARAM_EACHCUTLIM = convert(Cint,2102) -const CPX_PARAM_SOLNPOOLCAPACITY = convert(Cint,2103) -const CPX_PARAM_SOLNPOOLREPLACE = convert(Cint,2104) -const CPX_PARAM_SOLNPOOLGAP = convert(Cint,2105) -const CPX_PARAM_SOLNPOOLAGAP = convert(Cint,2106) -const CPX_PARAM_SOLNPOOLINTENSITY = convert(Cint,2107) -const CPX_PARAM_POPULATELIM = convert(Cint,2108) -const CPX_PARAM_MIPSEARCH = convert(Cint,2109) -const CPX_PARAM_MIQCPSTRAT = convert(Cint,2110) -const CPX_PARAM_ZEROHALFCUTS = convert(Cint,2111) -const CPX_PARAM_POLISHAFTEREPAGAP = convert(Cint,2126) -const CPX_PARAM_POLISHAFTEREPGAP = convert(Cint,2127) -const CPX_PARAM_POLISHAFTERNODE = convert(Cint,2128) -const CPX_PARAM_POLISHAFTERINTSOL = convert(Cint,2129) -const CPX_PARAM_POLISHAFTERTIME = convert(Cint,2130) -const CPX_PARAM_MCFCUTS = convert(Cint,2134) -const CPX_PARAM_MIPKAPPASTATS = convert(Cint,2137) -const CPX_PARAM_AUXROOTTHREADS = convert(Cint,2139) -const CPX_PARAM_INTSOLFILEPREFIX = convert(Cint,2143) -const CPX_PARAM_PROBEDETTIME = convert(Cint,2150) -const CPX_PARAM_POLISHAFTERDETTIME = convert(Cint,2151) -const CPX_PARAM_LANDPCUTS = convert(Cint,2152) -const CPX_PARAM_RAMPUPDURATION = convert(Cint,2163) -const CPX_PARAM_RAMPUPDETTILIM = convert(Cint,2164) -const CPX_PARAM_RAMPUPTILIM = convert(Cint,2165) -const CPX_PARAM_LOCALIMPLBD = convert(Cint,2181) -const CPX_PARAM_BQPCUTS = convert(Cint,2195) -const CPX_PARAM_RLTCUTS = convert(Cint,2196) -const CPX_PARAM_SUBMIPSTARTALG = convert(Cint,2205) -const CPX_PARAM_SUBMIPSUBALG = convert(Cint,2206) -const CPX_PARAM_SUBMIPSCAIND = convert(Cint,2207) -const CPX_PARAM_SUBMIPNODELIMIT = convert(Cint,2212) -const CPX_PARAM_BAREPCOMP = convert(Cint,3002) -const CPX_PARAM_BARGROWTH = convert(Cint,3003) -const CPX_PARAM_BAROBJRNG = convert(Cint,3004) -const CPX_PARAM_BARALG = convert(Cint,3007) -const CPX_PARAM_BARCOLNZ = convert(Cint,3009) -const CPX_PARAM_BARDISPLAY = convert(Cint,3010) -const CPX_PARAM_BARITLIM = convert(Cint,3012) -const CPX_PARAM_BARMAXCOR = convert(Cint,3013) -const CPX_PARAM_BARORDER = convert(Cint,3014) -const CPX_PARAM_BARSTARTALG = convert(Cint,3017) -const CPX_PARAM_BARCROSSALG = convert(Cint,3018) -const CPX_PARAM_BARQCPEPCOMP = convert(Cint,3020) -const CPX_PARAM_QPNZREADLIM = convert(Cint,4001) -const CPX_PARAM_CALCQCPDUALS = convert(Cint,4003) -const CPX_PARAM_QPMAKEPSDIND = convert(Cint,4010) -const CPX_PARAM_QTOLININD = convert(Cint,4012) -const CPX_PARAM_NETITLIM = convert(Cint,5001) -const CPX_PARAM_NETEPOPT = convert(Cint,5002) -const CPX_PARAM_NETEPRHS = convert(Cint,5003) -const CPX_PARAM_NETPPRIIND = convert(Cint,5004) -const CPX_PARAM_NETDISPLAY = convert(Cint,5005) \ No newline at end of file diff --git a/src/gen/ctypes.jl b/src/gen/ctypes.jl new file mode 100644 index 00000000..436e6ad0 --- /dev/null +++ b/src/gen/ctypes.jl @@ -0,0 +1,7 @@ +## 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/gen/libcpx_api.jl b/src/gen/libcpx_api.jl new file mode 100644 index 00000000..02b409a0 --- /dev/null +++ b/src/gen/libcpx_api.jl @@ -0,0 +1,2074 @@ +# Julia wrapper for header: cplex.h +# Automatically generated using Clang.jl + + +function CPXaddcols(env, lp, ccnt, nzcnt, obj, cmatbeg, cmatind, cmatval, lb, ub, colname) + ccall((:CPXaddcols, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, ccnt, nzcnt, obj, cmatbeg, cmatind, cmatval, lb, ub, colname) +end + +function CPXaddfuncdest(env, channel, handle, msgfunction) + ccall((:CPXaddfuncdest, libcplex), Cint, (CPXCENVptr, CPXCHANNELptr, Ptr{Cvoid}, Ptr{Cvoid}), env, channel, handle, msgfunction) +end + +function CPXaddpwl(env, lp, vary, varx, preslope, postslope, nbreaks, breakx, breaky, pwlname) + ccall((:CPXaddpwl, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cdouble, Cdouble, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cchar}), env, lp, vary, varx, preslope, postslope, nbreaks, breakx, breaky, pwlname) +end + +function CPXaddrows(env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, colname, rowname) + ccall((:CPXaddrows, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}, Ptr{Ptr{Cchar}}), env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, colname, rowname) +end + +function CPXbasicpresolve(env, lp, redlb, redub, rstat) + ccall((:CPXbasicpresolve, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}), env, lp, redlb, redub, rstat) +end + +function CPXbinvacol(env, lp, j, x) + ccall((:CPXbinvacol, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, j, x) +end + +function CPXbinvarow(env, lp, i, z) + ccall((:CPXbinvarow, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, i, z) +end + +function CPXbinvcol(env, lp, j, x) + ccall((:CPXbinvcol, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, j, x) +end + +function CPXbinvrow(env, lp, i, y) + ccall((:CPXbinvrow, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, i, y) +end + +function CPXboundsa(env, lp, _begin, _end, lblower, lbupper, ublower, ubupper) + ccall((:CPXboundsa, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, _begin, _end, lblower, lbupper, ublower, ubupper) +end + +function CPXbtran(env, lp, y) + ccall((:CPXbtran, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, y) +end + +function CPXcallbackabort(context) + ccall((:CPXcallbackabort, libcplex), Cvoid, (CPXCALLBACKCONTEXTptr,), context) +end + +function CPXcallbackaddusercuts(context, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, purgeable, _local) + ccall((:CPXcallbackaddusercuts, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}), context, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, purgeable, _local) +end + +function CPXcallbackcandidateispoint(context, ispoint_p) + ccall((:CPXcallbackcandidateispoint, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cint}), context, ispoint_p) +end + +function CPXcallbackcandidateisray(context, isray_p) + ccall((:CPXcallbackcandidateisray, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cint}), context, isray_p) +end + +function CPXcallbackexitcutloop(context) + ccall((:CPXcallbackexitcutloop, libcplex), Cint, (CPXCALLBACKCONTEXTptr,), context) +end + +function CPXcallbackgetcandidatepoint(context, x, _begin, _end, obj_p) + ccall((:CPXcallbackgetcandidatepoint, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}), context, x, _begin, _end, obj_p) +end + +function CPXcallbackgetcandidateray(context, x, _begin, _end) + ccall((:CPXcallbackgetcandidateray, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint), context, x, _begin, _end) +end + +function CPXcallbackgetfunc(env, lp, contextmask_p, callback_p, cbhandle_p) + ccall((:CPXcallbackgetfunc, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{CPXLONG}, Ptr{Ptr{CPXCALLBACKFUNC}}, Ptr{Ptr{Cvoid}}), env, lp, contextmask_p, callback_p, cbhandle_p) +end + +function CPXcallbackgetincumbent(context, x, _begin, _end, obj_p) + ccall((:CPXcallbackgetincumbent, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}), context, x, _begin, _end, obj_p) +end + +function CPXcallbackgetinfodbl(context, what, data_p) + ccall((:CPXcallbackgetinfodbl, libcplex), Cint, (CPXCALLBACKCONTEXTptr, CPXCALLBACKINFO, Ptr{Cdouble}), context, what, data_p) +end + +function CPXcallbackgetinfoint(context, what, data_p) + ccall((:CPXcallbackgetinfoint, libcplex), Cint, (CPXCALLBACKCONTEXTptr, CPXCALLBACKINFO, Ptr{CPXINT}), context, what, data_p) +end + +function CPXcallbackgetinfolong(context, what, data_p) + ccall((:CPXcallbackgetinfolong, libcplex), Cint, (CPXCALLBACKCONTEXTptr, CPXCALLBACKINFO, Ptr{CPXLONG}), context, what, data_p) +end + +function CPXcallbackgetrelaxationpoint(context, x, _begin, _end, obj_p) + ccall((:CPXcallbackgetrelaxationpoint, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}), context, x, _begin, _end, obj_p) +end + +function CPXcallbackgetrelaxationstatus(context, nodelpstat_p, flags) + ccall((:CPXcallbackgetrelaxationstatus, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cint}, CPXLONG), context, nodelpstat_p, flags) +end + +function CPXcallbackmakebranch(context, varcnt, varind, varlu, varbd, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, nodeest, seqnum_p) + ccall((:CPXcallbackmakebranch, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Cint, Ptr{Cint}, Ptr{Cchar}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Ptr{Cint}), context, varcnt, varind, varlu, varbd, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, nodeest, seqnum_p) +end + +function CPXcallbackpostheursoln(context, cnt, ind, val, obj, strat) + ccall((:CPXcallbackpostheursoln, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Cint, Ptr{Cint}, Ptr{Cdouble}, Cdouble, CPXCALLBACKSOLUTIONSTRATEGY), context, cnt, ind, val, obj, strat) +end + +function CPXcallbackprunenode(context) + ccall((:CPXcallbackprunenode, libcplex), Cint, (CPXCALLBACKCONTEXTptr,), context) +end + +function CPXcallbackrejectcandidate(context, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval) + ccall((:CPXcallbackrejectcandidate, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), context, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval) +end + +function CPXcallbacksetfunc(env, lp, contextmask, callback, userhandle) + ccall((:CPXcallbacksetfunc, libcplex), Cint, (CPXENVptr, CPXLPptr, CPXLONG, CPXCALLBACKFUNC, Ptr{Cvoid}), env, lp, contextmask, callback, userhandle) +end + +function CPXcheckdfeas(env, lp, infeas_p) + ccall((:CPXcheckdfeas, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, infeas_p) +end + +function CPXcheckpfeas(env, lp, infeas_p) + ccall((:CPXcheckpfeas, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, infeas_p) +end + +function CPXchecksoln(env, lp, lpstatus_p) + ccall((:CPXchecksoln, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, lpstatus_p) +end + +function CPXchgbds(env, lp, cnt, indices, lu, bd) + ccall((:CPXchgbds, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cchar}, Ptr{Cdouble}), env, lp, cnt, indices, lu, bd) +end + +function CPXchgcoef(env, lp, i, j, newvalue) + ccall((:CPXchgcoef, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cdouble), env, lp, i, j, newvalue) +end + +function CPXchgcoeflist(env, lp, numcoefs, rowlist, collist, vallist) + ccall((:CPXchgcoeflist, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), env, lp, numcoefs, rowlist, collist, vallist) +end + +function CPXchgcolname(env, lp, cnt, indices, newname) + ccall((:CPXchgcolname, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Ptr{Cchar}}), env, lp, cnt, indices, newname) +end + +function CPXchgname(env, lp, key, ij, newname_str) + ccall((:CPXchgname, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cchar}), env, lp, key, ij, newname_str) +end + +function CPXchgobj(env, lp, cnt, indices, values) + ccall((:CPXchgobj, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, lp, cnt, indices, values) +end + +function CPXchgobjoffset(env, lp, offset) + ccall((:CPXchgobjoffset, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cdouble), env, lp, offset) +end + +function CPXchgobjsen(env, lp, maxormin) + ccall((:CPXchgobjsen, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, maxormin) +end + +function CPXchgprobname(env, lp, probname) + ccall((:CPXchgprobname, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, probname) +end + +function CPXchgprobtype(env, lp, type) + ccall((:CPXchgprobtype, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, type) +end + +function CPXchgprobtypesolnpool(env, lp, type, soln) + ccall((:CPXchgprobtypesolnpool, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, type, soln) +end + +function CPXchgrhs(env, lp, cnt, indices, values) + ccall((:CPXchgrhs, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, lp, cnt, indices, values) +end + +function CPXchgrngval(env, lp, cnt, indices, values) + ccall((:CPXchgrngval, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, lp, cnt, indices, values) +end + +function CPXchgrowname(env, lp, cnt, indices, newname) + ccall((:CPXchgrowname, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Ptr{Cchar}}), env, lp, cnt, indices, newname) +end + +function CPXchgsense(env, lp, cnt, indices, sense) + ccall((:CPXchgsense, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cchar}), env, lp, cnt, indices, sense) +end + +function CPXcleanup(env, lp, eps) + ccall((:CPXcleanup, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cdouble), env, lp, eps) +end + +function CPXcloneprob(env, lp, status_p) + ccall((:CPXcloneprob, libcplex), CPXLPptr, (CPXCENVptr, CPXCLPptr, Ptr{Cint}), env, lp, status_p) +end + +function CPXcloseCPLEX(env_p) + ccall((:CPXcloseCPLEX, libcplex), Cint, (Ptr{CPXENVptr},), env_p) +end + +function CPXclpwrite(env, lp, filename_str) + ccall((:CPXclpwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXcompletelp(env, lp) + ccall((:CPXcompletelp, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXcopybase(env, lp, cstat, rstat) + ccall((:CPXcopybase, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Ptr{Cint}), env, lp, cstat, rstat) +end + +function CPXcopybasednorms(env, lp, cstat, rstat, dnorm) + ccall((:CPXcopybasednorms, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), env, lp, cstat, rstat, dnorm) +end + +function CPXcopydnorms(env, lp, norm, head, len) + ccall((:CPXcopydnorms, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cdouble}, Ptr{Cint}, Cint), env, lp, norm, head, len) +end + +function CPXcopylp(env, lp, numcols, numrows, objsense, objective, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval) + ccall((:CPXcopylp, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, numcols, numrows, objsense, objective, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval) +end + +function CPXcopylpwnames(env, lp, numcols, numrows, objsense, objective, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval, colname, rowname) + ccall((:CPXcopylpwnames, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}, Ptr{Ptr{Cchar}}), env, lp, numcols, numrows, objsense, objective, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval, colname, rowname) +end + +function CPXcopynettolp(env, lp, net) + ccall((:CPXcopynettolp, libcplex), Cint, (CPXCENVptr, CPXLPptr, CPXCNETptr), env, lp, net) +end + +function CPXcopyobjname(env, lp, objname_str) + ccall((:CPXcopyobjname, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, objname_str) +end + +function CPXcopypnorms(env, lp, cnorm, rnorm, len) + ccall((:CPXcopypnorms, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Cint), env, lp, cnorm, rnorm, len) +end + +function CPXcopyprotected(env, lp, cnt, indices) + ccall((:CPXcopyprotected, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}), env, lp, cnt, indices) +end + +function CPXcopystart(env, lp, cstat, rstat, cprim, rprim, cdual, rdual) + ccall((:CPXcopystart, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, cstat, rstat, cprim, rprim, cdual, rdual) +end + +function CPXcreateprob(env, status_p, probname_str) + ccall((:CPXcreateprob, libcplex), CPXLPptr, (CPXCENVptr, Ptr{Cint}, Ptr{Cchar}), env, status_p, probname_str) +end + +function CPXcrushform(env, lp, len, ind, val, plen_p, poffset_p, pind, pval) + ccall((:CPXcrushform, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), env, lp, len, ind, val, plen_p, poffset_p, pind, pval) +end + +function CPXcrushpi(env, lp, pi, prepi) + ccall((:CPXcrushpi, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, pi, prepi) +end + +function CPXcrushx(env, lp, x, prex) + ccall((:CPXcrushx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, x, prex) +end + +function CPXdelcols(env, lp, _begin, _end) + ccall((:CPXdelcols, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdeldblannotation(env, lp, idx) + ccall((:CPXdeldblannotation, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, idx) +end + +function CPXdeldblannotations(env, lp, _begin, _end) + ccall((:CPXdeldblannotations, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelfuncdest(env, channel, handle, msgfunction) + ccall((:CPXdelfuncdest, libcplex), Cint, (CPXCENVptr, CPXCHANNELptr, Ptr{Cvoid}, Ptr{Cvoid}), env, channel, handle, msgfunction) +end + +function CPXdellongannotation(env, lp, idx) + ccall((:CPXdellongannotation, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, idx) +end + +function CPXdellongannotations(env, lp, _begin, _end) + ccall((:CPXdellongannotations, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelnames(env, lp) + ccall((:CPXdelnames, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXdelpwl(env, lp, _begin, _end) + ccall((:CPXdelpwl, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelrows(env, lp, _begin, _end) + ccall((:CPXdelrows, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelsetcols(env, lp, delstat) + ccall((:CPXdelsetcols, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delstat) +end + +function CPXdelsetpwl(env, lp, delstat) + ccall((:CPXdelsetpwl, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delstat) +end + +function CPXdelsetrows(env, lp, delstat) + ccall((:CPXdelsetrows, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delstat) +end + +function CPXdeserializercreate(deser_p, size, buffer) + ccall((:CPXdeserializercreate, libcplex), Cint, (Ptr{CPXDESERIALIZERptr}, CPXLONG, Ptr{Cvoid}), deser_p, size, buffer) +end + +function CPXdeserializerdestroy(deser) + ccall((:CPXdeserializerdestroy, libcplex), Cvoid, (CPXDESERIALIZERptr,), deser) +end + +function CPXdeserializerleft(deser) + ccall((:CPXdeserializerleft, libcplex), CPXLONG, (CPXCDESERIALIZERptr,), deser) +end + +function CPXdisconnectchannel(env, channel) + ccall((:CPXdisconnectchannel, libcplex), Cint, (CPXCENVptr, CPXCHANNELptr), env, channel) +end + +function CPXdjfrompi(env, lp, pi, dj) + ccall((:CPXdjfrompi, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, pi, dj) +end + +function CPXdperwrite(env, lp, filename_str, epsilon) + ccall((:CPXdperwrite, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}, Cdouble), env, lp, filename_str, epsilon) +end + +function CPXdratio(env, lp, indices, cnt, downratio, upratio, downenter, upenter, downstatus, upstatus) + ccall((:CPXdratio, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, lp, indices, cnt, downratio, upratio, downenter, upenter, downstatus, upstatus) +end + +function CPXdualfarkas(env, lp, y, proof_p) + ccall((:CPXdualfarkas, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, y, proof_p) +end + +function CPXdualopt(env, lp) + ccall((:CPXdualopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXdualwrite(env, lp, filename_str, objshift_p) + ccall((:CPXdualwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cdouble}), env, lp, filename_str, objshift_p) +end + +function CPXembwrite(env, lp, filename_str) + ccall((:CPXembwrite, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXfeasopt(env, lp, rhs, rng, lb, ub) + ccall((:CPXfeasopt, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, rhs, rng, lb, ub) +end + +function CPXfeasoptext(env, lp, grpcnt, concnt, grppref, grpbeg, grpind, grptype) + ccall((:CPXfeasoptext, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cchar}), env, lp, grpcnt, concnt, grppref, grpbeg, grpind, grptype) +end + +function CPXfinalize() + ccall((:CPXfinalize, libcplex), Cvoid, ()) +end + +function CPXflushchannel(env, channel) + ccall((:CPXflushchannel, libcplex), Cint, (CPXCENVptr, CPXCHANNELptr), env, channel) +end + +function CPXflushstdchannels(env) + ccall((:CPXflushstdchannels, libcplex), Cint, (CPXCENVptr,), env) +end + +function CPXfreepresolve(env, lp) + ccall((:CPXfreepresolve, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXfreeprob(env, lp_p) + ccall((:CPXfreeprob, libcplex), Cint, (CPXCENVptr, Ptr{CPXLPptr}), env, lp_p) +end + +function CPXftran(env, lp, x) + ccall((:CPXftran, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, x) +end + +function CPXgetax(env, lp, x, _begin, _end) + ccall((:CPXgetax, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, x, _begin, _end) +end + +function CPXgetbaritcnt(env, lp) + ccall((:CPXgetbaritcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetbase(env, lp, cstat, rstat) + ccall((:CPXgetbase, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}), env, lp, cstat, rstat) +end + +function CPXgetbasednorms(env, lp, cstat, rstat, dnorm) + ccall((:CPXgetbasednorms, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), env, lp, cstat, rstat, dnorm) +end + +function CPXgetbhead(env, lp, head, x) + ccall((:CPXgetbhead, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cdouble}), env, lp, head, x) +end + +function CPXgetcallbackinfo(env, cbdata, wherefrom, whichinfo, result_p) + ccall((:CPXgetcallbackinfo, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Ptr{Cvoid}), env, cbdata, wherefrom, whichinfo, result_p) +end + +function CPXgetchannels(env, cpxresults_p, cpxwarning_p, cpxerror_p, cpxlog_p) + ccall((:CPXgetchannels, libcplex), Cint, (CPXCENVptr, Ptr{CPXCHANNELptr}, Ptr{CPXCHANNELptr}, Ptr{CPXCHANNELptr}, Ptr{CPXCHANNELptr}), env, cpxresults_p, cpxwarning_p, cpxerror_p, cpxlog_p) +end + +function CPXgetchgparam(env, cnt_p, paramnum, pspace, surplus_p) + ccall((:CPXgetchgparam, libcplex), Cint, (CPXCENVptr, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}), env, cnt_p, paramnum, pspace, surplus_p) +end + +function CPXgetcoef(env, lp, i, j, coef_p) + ccall((:CPXgetcoef, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cdouble}), env, lp, i, j, coef_p) +end + +function CPXgetcolindex(env, lp, lname_str, index_p) + ccall((:CPXgetcolindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetcolinfeas(env, lp, x, infeasout, _begin, _end) + ccall((:CPXgetcolinfeas, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint), env, lp, x, infeasout, _begin, _end) +end + +function CPXgetcolname(env, lp, name, namestore, storespace, surplus_p, _begin, _end) + ccall((:CPXgetcolname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Ptr{Cchar}}, Ptr{Cchar}, Cint, Ptr{Cint}, Cint, Cint), env, lp, name, namestore, storespace, surplus_p, _begin, _end) +end + +function CPXgetcols(env, lp, nzcnt_p, cmatbeg, cmatind, cmatval, cmatspace, surplus_p, _begin, _end) + ccall((:CPXgetcols, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), env, lp, nzcnt_p, cmatbeg, cmatind, cmatval, cmatspace, surplus_p, _begin, _end) +end + +function CPXgetconflict(env, lp, confstat_p, rowind, rowbdstat, confnumrows_p, colind, colbdstat, confnumcols_p) + ccall((:CPXgetconflict, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, lp, confstat_p, rowind, rowbdstat, confnumrows_p, colind, colbdstat, confnumcols_p) +end + +function CPXgetconflictext(env, lp, grpstat, beg, _end) + ccall((:CPXgetconflictext, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Cint, Cint), env, lp, grpstat, beg, _end) +end + +function CPXgetcrossdexchcnt(env, lp) + ccall((:CPXgetcrossdexchcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetcrossdpushcnt(env, lp) + ccall((:CPXgetcrossdpushcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetcrosspexchcnt(env, lp) + ccall((:CPXgetcrosspexchcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetcrossppushcnt(env, lp) + ccall((:CPXgetcrossppushcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetdblannotationdefval(env, lp, idx, defval_p) + ccall((:CPXgetdblannotationdefval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, idx, defval_p) +end + +function CPXgetdblannotationindex(env, lp, annotationname_str, index_p) + ccall((:CPXgetdblannotationindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, annotationname_str, index_p) +end + +function CPXgetdblannotationname(env, lp, idx, buf_str, bufspace, surplus_p) + ccall((:CPXgetdblannotationname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cchar}, Cint, Ptr{Cint}), env, lp, idx, buf_str, bufspace, surplus_p) +end + +function CPXgetdblannotations(env, lp, idx, objtype, annotation, _begin, _end) + ccall((:CPXgetdblannotations, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cdouble}, Cint, Cint), env, lp, idx, objtype, annotation, _begin, _end) +end + +function CPXgetdblparam(env, whichparam, value_p) + ccall((:CPXgetdblparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cdouble}), env, whichparam, value_p) +end + +function CPXgetdblquality(env, lp, quality_p, what) + ccall((:CPXgetdblquality, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint), env, lp, quality_p, what) +end + +function CPXgetdettime(env, dettimestamp_p) + ccall((:CPXgetdettime, libcplex), Cint, (CPXCENVptr, Ptr{Cdouble}), env, dettimestamp_p) +end + +function CPXgetdj(env, lp, dj, _begin, _end) + ccall((:CPXgetdj, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, dj, _begin, _end) +end + +function CPXgetdnorms(env, lp, norm, head, len_p) + ccall((:CPXgetdnorms, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}), env, lp, norm, head, len_p) +end + +function CPXgetdsbcnt(env, lp) + ccall((:CPXgetdsbcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgeterrorstring(env, errcode, buffer_str) + ccall((:CPXgeterrorstring, libcplex), CPXCCHARptr, (CPXCENVptr, Cint, Ptr{Cchar}), env, errcode, buffer_str) +end + +function CPXgetgrad(env, lp, j, head, y) + ccall((:CPXgetgrad, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, lp, j, head, y) +end + +function CPXgetijdiv(env, lp, idiv_p, jdiv_p) + ccall((:CPXgetijdiv, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}), env, lp, idiv_p, jdiv_p) +end + +function CPXgetijrow(env, lp, i, j, row_p) + ccall((:CPXgetijrow, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cint}), env, lp, i, j, row_p) +end + +function CPXgetintparam(env, whichparam, value_p) + ccall((:CPXgetintparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{CPXINT}), env, whichparam, value_p) +end + +function CPXgetintquality(env, lp, quality_p, what) + ccall((:CPXgetintquality, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Cint), env, lp, quality_p, what) +end + +function CPXgetitcnt(env, lp) + ccall((:CPXgetitcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetlb(env, lp, lb, _begin, _end) + ccall((:CPXgetlb, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, lb, _begin, _end) +end + +function CPXgetlogfilename(env, buf_str, bufspace, surplus_p) + ccall((:CPXgetlogfilename, libcplex), Cint, (CPXCENVptr, Ptr{Cchar}, Cint, Ptr{Cint}), env, buf_str, bufspace, surplus_p) +end + +function CPXgetlongannotationdefval(env, lp, idx, defval_p) + ccall((:CPXgetlongannotationdefval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{CPXLONG}), env, lp, idx, defval_p) +end + +function CPXgetlongannotationindex(env, lp, annotationname_str, index_p) + ccall((:CPXgetlongannotationindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, annotationname_str, index_p) +end + +function CPXgetlongannotationname(env, lp, idx, buf_str, bufspace, surplus_p) + ccall((:CPXgetlongannotationname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cchar}, Cint, Ptr{Cint}), env, lp, idx, buf_str, bufspace, surplus_p) +end + +function CPXgetlongannotations(env, lp, idx, objtype, annotation, _begin, _end) + ccall((:CPXgetlongannotations, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{CPXLONG}, Cint, Cint), env, lp, idx, objtype, annotation, _begin, _end) +end + +function CPXgetlongparam(env, whichparam, value_p) + ccall((:CPXgetlongparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{CPXLONG}), env, whichparam, value_p) +end + +function CPXgetlpcallbackfunc(env, callback_p, cbhandle_p) + ccall((:CPXgetlpcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, callback_p, cbhandle_p) +end + +function CPXgetmethod(env, lp) + ccall((:CPXgetmethod, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnetcallbackfunc(env, callback_p, cbhandle_p) + ccall((:CPXgetnetcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, callback_p, cbhandle_p) +end + +function CPXgetnumcols(env, lp) + ccall((:CPXgetnumcols, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumcores(env, numcores_p) + ccall((:CPXgetnumcores, libcplex), Cint, (CPXCENVptr, Ptr{Cint}), env, numcores_p) +end + +function CPXgetnumdblannotations(env, lp) + ccall((:CPXgetnumdblannotations, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumlongannotations(env, lp) + ccall((:CPXgetnumlongannotations, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumnz(env, lp) + ccall((:CPXgetnumnz, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumobjs(env, lp) + ccall((:CPXgetnumobjs, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumpwl(env, lp) + ccall((:CPXgetnumpwl, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumrows(env, lp) + ccall((:CPXgetnumrows, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetobj(env, lp, obj, _begin, _end) + ccall((:CPXgetobj, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, obj, _begin, _end) +end + +function CPXgetobjname(env, lp, buf_str, bufspace, surplus_p) + ccall((:CPXgetobjname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}), env, lp, buf_str, bufspace, surplus_p) +end + +function CPXgetobjoffset(env, lp, objoffset_p) + ccall((:CPXgetobjoffset, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, objoffset_p) +end + +function CPXgetobjsen(env, lp) + ccall((:CPXgetobjsen, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetobjval(env, lp, objval_p) + ccall((:CPXgetobjval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, objval_p) +end + +function CPXgetparamhiername(env, whichparam, name_str) + ccall((:CPXgetparamhiername, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cchar}), env, whichparam, name_str) +end + +function CPXgetparamname(env, whichparam, name_str) + ccall((:CPXgetparamname, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cchar}), env, whichparam, name_str) +end + +function CPXgetparamnum(env, name_str, whichparam_p) + ccall((:CPXgetparamnum, libcplex), Cint, (CPXCENVptr, Ptr{Cchar}, Ptr{Cint}), env, name_str, whichparam_p) +end + +function CPXgetparamtype(env, whichparam, paramtype) + ccall((:CPXgetparamtype, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cint}), env, whichparam, paramtype) +end + +function CPXgetphase1cnt(env, lp) + ccall((:CPXgetphase1cnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetpi(env, lp, pi, _begin, _end) + ccall((:CPXgetpi, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, pi, _begin, _end) +end + +function CPXgetpnorms(env, lp, cnorm, rnorm, len_p) + ccall((:CPXgetpnorms, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}), env, lp, cnorm, rnorm, len_p) +end + +function CPXgetprestat(env, lp, prestat_p, pcstat, prstat, ocstat, orstat) + ccall((:CPXgetprestat, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, lp, prestat_p, pcstat, prstat, ocstat, orstat) +end + +function CPXgetprobname(env, lp, buf_str, bufspace, surplus_p) + ccall((:CPXgetprobname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}), env, lp, buf_str, bufspace, surplus_p) +end + +function CPXgetprobtype(env, lp) + ccall((:CPXgetprobtype, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetprotected(env, lp, cnt_p, indices, pspace, surplus_p) + ccall((:CPXgetprotected, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}), env, lp, cnt_p, indices, pspace, surplus_p) +end + +function CPXgetpsbcnt(env, lp) + ccall((:CPXgetpsbcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetpwl(env, lp, pwlindex, vary_p, varx_p, preslope_p, postslope_p, nbreaks_p, breakx, breaky, breakspace, surplus_p) + ccall((:CPXgetpwl, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Ptr{Cint}), env, lp, pwlindex, vary_p, varx_p, preslope_p, postslope_p, nbreaks_p, breakx, breaky, breakspace, surplus_p) +end + +function CPXgetpwlindex(env, lp, lname_str, index_p) + ccall((:CPXgetpwlindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetpwlname(env, lp, buf_str, bufspace, surplus_p, which) + ccall((:CPXgetpwlname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}, Cint), env, lp, buf_str, bufspace, surplus_p, which) +end + +function CPXgetray(env, lp, z) + ccall((:CPXgetray, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, z) +end + +function CPXgetredlp(env, lp, redlp_p) + ccall((:CPXgetredlp, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{CPXCLPptr}), env, lp, redlp_p) +end + +function CPXgetrhs(env, lp, rhs, _begin, _end) + ccall((:CPXgetrhs, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, rhs, _begin, _end) +end + +function CPXgetrngval(env, lp, rngval, _begin, _end) + ccall((:CPXgetrngval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, rngval, _begin, _end) +end + +function CPXgetrowindex(env, lp, lname_str, index_p) + ccall((:CPXgetrowindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetrowinfeas(env, lp, x, infeasout, _begin, _end) + ccall((:CPXgetrowinfeas, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint), env, lp, x, infeasout, _begin, _end) +end + +function CPXgetrowname(env, lp, name, namestore, storespace, surplus_p, _begin, _end) + ccall((:CPXgetrowname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Ptr{Cchar}}, Ptr{Cchar}, Cint, Ptr{Cint}, Cint, Cint), env, lp, name, namestore, storespace, surplus_p, _begin, _end) +end + +function CPXgetrows(env, lp, nzcnt_p, rmatbeg, rmatind, rmatval, rmatspace, surplus_p, _begin, _end) + ccall((:CPXgetrows, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), env, lp, nzcnt_p, rmatbeg, rmatind, rmatval, rmatspace, surplus_p, _begin, _end) +end + +function CPXgetsense(env, lp, sense, _begin, _end) + ccall((:CPXgetsense, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Cint), env, lp, sense, _begin, _end) +end + +function CPXgetsiftitcnt(env, lp) + ccall((:CPXgetsiftitcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetsiftphase1cnt(env, lp) + ccall((:CPXgetsiftphase1cnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetslack(env, lp, slack, _begin, _end) + ccall((:CPXgetslack, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, slack, _begin, _end) +end + +function CPXgetsolnpooldblquality(env, lp, soln, quality_p, what) + ccall((:CPXgetsolnpooldblquality, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}, Cint), env, lp, soln, quality_p, what) +end + +function CPXgetsolnpoolintquality(env, lp, soln, quality_p, what) + ccall((:CPXgetsolnpoolintquality, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Cint), env, lp, soln, quality_p, what) +end + +function CPXgetstat(env, lp) + ccall((:CPXgetstat, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetstatstring(env, statind, buffer_str) + ccall((:CPXgetstatstring, libcplex), CPXCHARptr, (CPXCENVptr, Cint, Ptr{Cchar}), env, statind, buffer_str) +end + +function CPXgetstrparam(env, whichparam, value_str) + ccall((:CPXgetstrparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cchar}), env, whichparam, value_str) +end + +function CPXgettime(env, timestamp_p) + ccall((:CPXgettime, libcplex), Cint, (CPXCENVptr, Ptr{Cdouble}), env, timestamp_p) +end + +function CPXgettuningcallbackfunc(env, callback_p, cbhandle_p) + ccall((:CPXgettuningcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, callback_p, cbhandle_p) +end + +function CPXgetub(env, lp, ub, _begin, _end) + ccall((:CPXgetub, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, ub, _begin, _end) +end + +function CPXgetweight(env, lp, rcnt, rmatbeg, rmatind, rmatval, weight, dpriind) + ccall((:CPXgetweight, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint), env, lp, rcnt, rmatbeg, rmatind, rmatval, weight, dpriind) +end + +function CPXgetx(env, lp, x, _begin, _end) + ccall((:CPXgetx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, x, _begin, _end) +end + +function CPXhybnetopt(env, lp, method) + ccall((:CPXhybnetopt, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, method) +end + +function CPXinfodblparam(env, whichparam, defvalue_p, minvalue_p, maxvalue_p) + ccall((:CPXinfodblparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, whichparam, defvalue_p, minvalue_p, maxvalue_p) +end + +function CPXinfointparam(env, whichparam, defvalue_p, minvalue_p, maxvalue_p) + ccall((:CPXinfointparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{CPXINT}, Ptr{CPXINT}, Ptr{CPXINT}), env, whichparam, defvalue_p, minvalue_p, maxvalue_p) +end + +function CPXinfolongparam(env, whichparam, defvalue_p, minvalue_p, maxvalue_p) + ccall((:CPXinfolongparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{CPXLONG}, Ptr{CPXLONG}, Ptr{CPXLONG}), env, whichparam, defvalue_p, minvalue_p, maxvalue_p) +end + +function CPXinfostrparam(env, whichparam, defvalue_str) + ccall((:CPXinfostrparam, libcplex), Cint, (CPXCENVptr, Cint, Ptr{Cchar}), env, whichparam, defvalue_str) +end + +function CPXinitialize() + ccall((:CPXinitialize, libcplex), Cvoid, ()) +end + +function CPXkilldnorms(lp) + ccall((:CPXkilldnorms, libcplex), Cint, (CPXLPptr,), lp) +end + +function CPXkillpnorms(lp) + ccall((:CPXkillpnorms, libcplex), Cint, (CPXLPptr,), lp) +end + +function CPXlpopt(env, lp) + ccall((:CPXlpopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXlprewrite(env, lp, filename_str) + ccall((:CPXlprewrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXlpwrite(env, lp, filename_str) + ccall((:CPXlpwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXmbasewrite(env, lp, filename_str) + ccall((:CPXmbasewrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXmdleave(env, lp, indices, cnt, downratio, upratio) + ccall((:CPXmdleave, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Cint, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, indices, cnt, downratio, upratio) +end + +function CPXmodelasstcallbackgetfunc(env, lp, callback_p, cbhandle_p) + ccall((:CPXmodelasstcallbackgetfunc, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Ptr{CPXMODELASSTCALLBACKFUNC}}, Ptr{Ptr{Cvoid}}), env, lp, callback_p, cbhandle_p) +end + +function CPXmodelasstcallbacksetfunc(env, lp, callback, userhandle) + ccall((:CPXmodelasstcallbacksetfunc, libcplex), Cint, (CPXENVptr, CPXLPptr, CPXMODELASSTCALLBACKFUNC, Ptr{Cvoid}), env, lp, callback, userhandle) +end + +function CPXmpsrewrite(env, lp, filename_str) + ccall((:CPXmpsrewrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXmpswrite(env, lp, filename_str) + ccall((:CPXmpswrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXmsgstr(channel, msg_str) + ccall((:CPXmsgstr, libcplex), Cint, (CPXCHANNELptr, Ptr{Cchar}), channel, msg_str) +end + +function CPXmultiobjchgattribs(env, lp, objind, offset, weight, priority, abstol, reltol, name) + ccall((:CPXmultiobjchgattribs, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cdouble, Cdouble, Cint, Cdouble, Cdouble, Ptr{Cchar}), env, lp, objind, offset, weight, priority, abstol, reltol, name) +end + +function CPXmultiobjgetdblinfo(env, lp, subprob, info_p, what) + ccall((:CPXmultiobjgetdblinfo, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}, Cint), env, lp, subprob, info_p, what) +end + +function CPXmultiobjgetindex(env, lp, name, index_p) + ccall((:CPXmultiobjgetindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, name, index_p) +end + +function CPXmultiobjgetintinfo(env, lp, subprob, info_p, what) + ccall((:CPXmultiobjgetintinfo, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Cint), env, lp, subprob, info_p, what) +end + +function CPXmultiobjgetlonginfo(env, lp, subprob, info_p, what) + ccall((:CPXmultiobjgetlonginfo, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{CPXLONG}, Cint), env, lp, subprob, info_p, what) +end + +function CPXmultiobjgetname(env, lp, objind, buf_str, bufspace, surplus_p) + ccall((:CPXmultiobjgetname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cchar}, Cint, Ptr{Cint}), env, lp, objind, buf_str, bufspace, surplus_p) +end + +function CPXmultiobjgetnumsolves(env, lp) + ccall((:CPXmultiobjgetnumsolves, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXmultiobjgetobj(env, lp, n, coeffs, _begin, _end, offset_p, weight_p, priority_p, abstol_p, reltol_p) + ccall((:CPXmultiobjgetobj, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, n, coeffs, _begin, _end, offset_p, weight_p, priority_p, abstol_p, reltol_p) +end + +function CPXmultiobjgetobjval(env, lp, n, objval_p) + ccall((:CPXmultiobjgetobjval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, n, objval_p) +end + +function CPXmultiobjgetobjvalbypriority(env, lp, priority, objval_p) + ccall((:CPXmultiobjgetobjvalbypriority, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, priority, objval_p) +end + +function CPXmultiobjopt(env, lp, paramsets) + ccall((:CPXmultiobjopt, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{CPXCPARAMSETptr}), env, lp, paramsets) +end + +function CPXmultiobjsetobj(env, lp, n, objnz, objind, objval, offset, weight, priority, abstol, reltol, objname) + ccall((:CPXmultiobjsetobj, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cdouble, Cint, Cdouble, Cdouble, Ptr{Cchar}), env, lp, n, objnz, objind, objval, offset, weight, priority, abstol, reltol, objname) +end + +function CPXNETextract(env, net, lp, colmap, rowmap) + ccall((:CPXNETextract, libcplex), Cint, (CPXCENVptr, CPXNETptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}), env, net, lp, colmap, rowmap) +end + +function CPXnewcols(env, lp, ccnt, obj, lb, ub, xctype, colname) + ccall((:CPXnewcols, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Ptr{Cchar}}), env, lp, ccnt, obj, lb, ub, xctype, colname) +end + +function CPXnewdblannotation(env, lp, annotationname_str, defval) + ccall((:CPXnewdblannotation, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}, Cdouble), env, lp, annotationname_str, defval) +end + +function CPXnewlongannotation(env, lp, annotationname_str, defval) + ccall((:CPXnewlongannotation, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}, CPXLONG), env, lp, annotationname_str, defval) +end + +function CPXnewrows(env, lp, rcnt, rhs, sense, rngval, rowname) + ccall((:CPXnewrows, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, rcnt, rhs, sense, rngval, rowname) +end + +function CPXobjsa(env, lp, _begin, _end, lower, upper) + ccall((:CPXobjsa, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, _begin, _end, lower, upper) +end + +function CPXopenCPLEX(status_p) + ccall((:CPXopenCPLEX, libcplex), CPXENVptr, (Ptr{Cint},), status_p) +end + +function CPXparamsetadddbl(env, ps, whichparam, newvalue) + ccall((:CPXparamsetadddbl, libcplex), Cint, (CPXCENVptr, CPXPARAMSETptr, Cint, Cdouble), env, ps, whichparam, newvalue) +end + +function CPXparamsetaddint(env, ps, whichparam, newvalue) + ccall((:CPXparamsetaddint, libcplex), Cint, (CPXCENVptr, CPXPARAMSETptr, Cint, CPXINT), env, ps, whichparam, newvalue) +end + +function CPXparamsetaddlong(env, ps, whichparam, newvalue) + ccall((:CPXparamsetaddlong, libcplex), Cint, (CPXCENVptr, CPXPARAMSETptr, Cint, CPXLONG), env, ps, whichparam, newvalue) +end + +function CPXparamsetaddstr(env, ps, whichparam, svalue) + ccall((:CPXparamsetaddstr, libcplex), Cint, (CPXCENVptr, CPXPARAMSETptr, Cint, Ptr{Cchar}), env, ps, whichparam, svalue) +end + +function CPXparamsetapply(env, ps) + ccall((:CPXparamsetapply, libcplex), Cint, (CPXENVptr, CPXCPARAMSETptr), env, ps) +end + +function CPXparamsetcopy(targetenv, targetps, sourceps) + ccall((:CPXparamsetcopy, libcplex), Cint, (CPXCENVptr, CPXPARAMSETptr, CPXCPARAMSETptr), targetenv, targetps, sourceps) +end + +function CPXparamsetcreate(env, status_p) + ccall((:CPXparamsetcreate, libcplex), CPXPARAMSETptr, (CPXCENVptr, Ptr{Cint}), env, status_p) +end + +function CPXparamsetdel(env, ps, whichparam) + ccall((:CPXparamsetdel, libcplex), Cint, (CPXCENVptr, CPXPARAMSETptr, Cint), env, ps, whichparam) +end + +function CPXparamsetfree(env, ps_p) + ccall((:CPXparamsetfree, libcplex), Cint, (CPXCENVptr, Ptr{CPXPARAMSETptr}), env, ps_p) +end + +function CPXparamsetgetdbl(env, ps, whichparam, dval_p) + ccall((:CPXparamsetgetdbl, libcplex), Cint, (CPXCENVptr, CPXCPARAMSETptr, Cint, Ptr{Cdouble}), env, ps, whichparam, dval_p) +end + +function CPXparamsetgetids(env, ps, cnt_p, whichparams, pspace, surplus_p) + ccall((:CPXparamsetgetids, libcplex), Cint, (CPXCENVptr, CPXCPARAMSETptr, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}), env, ps, cnt_p, whichparams, pspace, surplus_p) +end + +function CPXparamsetgetint(env, ps, whichparam, ival_p) + ccall((:CPXparamsetgetint, libcplex), Cint, (CPXCENVptr, CPXCPARAMSETptr, Cint, Ptr{CPXINT}), env, ps, whichparam, ival_p) +end + +function CPXparamsetgetlong(env, ps, whichparam, ival_p) + ccall((:CPXparamsetgetlong, libcplex), Cint, (CPXCENVptr, CPXCPARAMSETptr, Cint, Ptr{CPXLONG}), env, ps, whichparam, ival_p) +end + +function CPXparamsetgetstr(env, ps, whichparam, sval) + ccall((:CPXparamsetgetstr, libcplex), Cint, (CPXCENVptr, CPXCPARAMSETptr, Cint, Ptr{Cchar}), env, ps, whichparam, sval) +end + +function CPXparamsetreadcopy(env, ps, filename_str) + ccall((:CPXparamsetreadcopy, libcplex), Cint, (CPXENVptr, CPXPARAMSETptr, Ptr{Cchar}), env, ps, filename_str) +end + +function CPXparamsetwrite(env, ps, filename_str) + ccall((:CPXparamsetwrite, libcplex), Cint, (CPXCENVptr, CPXCPARAMSETptr, Ptr{Cchar}), env, ps, filename_str) +end + +function CPXpivot(env, lp, jenter, jleave, leavestat) + ccall((:CPXpivot, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint), env, lp, jenter, jleave, leavestat) +end + +function CPXpivotin(env, lp, rlist, rlen) + ccall((:CPXpivotin, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Cint), env, lp, rlist, rlen) +end + +function CPXpivotout(env, lp, clist, clen) + ccall((:CPXpivotout, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Cint), env, lp, clist, clen) +end + +function CPXpperwrite(env, lp, filename_str, epsilon) + ccall((:CPXpperwrite, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}, Cdouble), env, lp, filename_str, epsilon) +end + +function CPXpratio(env, lp, indices, cnt, downratio, upratio, downleave, upleave, downleavestatus, upleavestatus, downstatus, upstatus) + ccall((:CPXpratio, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, lp, indices, cnt, downratio, upratio, downleave, upleave, downleavestatus, upleavestatus, downstatus, upstatus) +end + +function CPXpreaddrows(env, lp, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, rowname) + ccall((:CPXpreaddrows, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, rowname) +end + +function CPXprechgobj(env, lp, cnt, indices, values) + ccall((:CPXprechgobj, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, lp, cnt, indices, values) +end + +function CPXpreslvwrite(env, lp, filename_str, objoff_p) + ccall((:CPXpreslvwrite, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}, Ptr{Cdouble}), env, lp, filename_str, objoff_p) +end + +function CPXpresolve(env, lp, method) + ccall((:CPXpresolve, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, method) +end + +function CPXprimopt(env, lp) + ccall((:CPXprimopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXqpdjfrompi(env, lp, pi, x, dj) + ccall((:CPXqpdjfrompi, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, pi, x, dj) +end + +function CPXqpuncrushpi(env, lp, pi, prepi, x) + ccall((:CPXqpuncrushpi, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, pi, prepi, x) +end + +function CPXreadcopyannotations(env, lp, filename) + ccall((:CPXreadcopyannotations, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename) +end + +function CPXreadcopybase(env, lp, filename_str) + ccall((:CPXreadcopybase, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXreadcopyparam(env, filename_str) + ccall((:CPXreadcopyparam, libcplex), Cint, (CPXENVptr, Ptr{Cchar}), env, filename_str) +end + +function CPXreadcopyprob(env, lp, filename_str, filetype) + ccall((:CPXreadcopyprob, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}, Ptr{Cchar}), env, lp, filename_str, filetype) +end + +function CPXreadcopysol(env, lp, filename_str) + ccall((:CPXreadcopysol, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXrefineconflict(env, lp, confnumrows_p, confnumcols_p) + ccall((:CPXrefineconflict, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Ptr{Cint}), env, lp, confnumrows_p, confnumcols_p) +end + +function CPXrefineconflictext(env, lp, grpcnt, concnt, grppref, grpbeg, grpind, grptype) + ccall((:CPXrefineconflictext, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cchar}), env, lp, grpcnt, concnt, grppref, grpbeg, grpind, grptype) +end + +function CPXrhssa(env, lp, _begin, _end, lower, upper) + ccall((:CPXrhssa, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, _begin, _end, lower, upper) +end + +function CPXrobustopt(env, lp, lblp, ublp, objchg, maxchg) + ccall((:CPXrobustopt, libcplex), Cint, (CPXCENVptr, CPXLPptr, CPXLPptr, CPXLPptr, Cdouble, Ptr{Cdouble}), env, lp, lblp, ublp, objchg, maxchg) +end + +function CPXsavwrite(env, lp, filename_str) + ccall((:CPXsavwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXserializercreate(ser_p) + ccall((:CPXserializercreate, libcplex), Cint, (Ptr{CPXSERIALIZERptr},), ser_p) +end + +function CPXserializerdestroy(ser) + ccall((:CPXserializerdestroy, libcplex), Cvoid, (CPXSERIALIZERptr,), ser) +end + +function CPXserializerlength(ser) + ccall((:CPXserializerlength, libcplex), CPXLONG, (CPXCSERIALIZERptr,), ser) +end + +function CPXserializerpayload(ser) + ccall((:CPXserializerpayload, libcplex), Ptr{Cvoid}, (CPXCSERIALIZERptr,), ser) +end + +function CPXsetdblannotations(env, lp, idx, objtype, cnt, indices, values) + ccall((:CPXsetdblannotations, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Ptr{Cint}, Ptr{Cdouble}), env, lp, idx, objtype, cnt, indices, values) +end + +function CPXsetdblparam(env, whichparam, newvalue) + ccall((:CPXsetdblparam, libcplex), Cint, (CPXENVptr, Cint, Cdouble), env, whichparam, newvalue) +end + +function CPXsetdefaults(env) + ccall((:CPXsetdefaults, libcplex), Cint, (CPXENVptr,), env) +end + +function CPXsetintparam(env, whichparam, newvalue) + ccall((:CPXsetintparam, libcplex), Cint, (CPXENVptr, Cint, CPXINT), env, whichparam, newvalue) +end + +function CPXsetlogfilename(env, filename, mode) + ccall((:CPXsetlogfilename, libcplex), Cint, (CPXCENVptr, Ptr{Cchar}, Ptr{Cchar}), env, filename, mode) +end + +function CPXsetlongannotations(env, lp, idx, objtype, cnt, indices, values) + ccall((:CPXsetlongannotations, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Ptr{Cint}, Ptr{CPXLONG}), env, lp, idx, objtype, cnt, indices, values) +end + +function CPXsetlongparam(env, whichparam, newvalue) + ccall((:CPXsetlongparam, libcplex), Cint, (CPXENVptr, Cint, CPXLONG), env, whichparam, newvalue) +end + +function CPXsetlpcallbackfunc(env, callback, cbhandle) + ccall((:CPXsetlpcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, callback, cbhandle) +end + +function CPXsetnetcallbackfunc(env, callback, cbhandle) + ccall((:CPXsetnetcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, callback, cbhandle) +end + +function CPXsetnumobjs(env, lp, n) + ccall((:CPXsetnumobjs, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint), env, lp, n) +end + +function CPXsetphase2(env, lp) + ccall((:CPXsetphase2, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXsetprofcallbackfunc(env, callback, cbhandle) + ccall((:CPXsetprofcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, callback, cbhandle) +end + +function CPXsetstrparam(env, whichparam, newvalue_str) + ccall((:CPXsetstrparam, libcplex), Cint, (CPXENVptr, Cint, Ptr{Cchar}), env, whichparam, newvalue_str) +end + +function CPXsetterminate(env, terminate_p) + ccall((:CPXsetterminate, libcplex), Cint, (CPXENVptr, Ptr{Cint}), env, terminate_p) +end + +function CPXsettuningcallbackfunc(env, callback, cbhandle) + ccall((:CPXsettuningcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, callback, cbhandle) +end + +function CPXsiftopt(env, lp) + ccall((:CPXsiftopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXslackfromx(env, lp, x, slack) + ccall((:CPXslackfromx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, x, slack) +end + +function CPXsolninfo(env, lp, solnmethod_p, solntype_p, pfeasind_p, dfeasind_p) + ccall((:CPXsolninfo, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, lp, solnmethod_p, solntype_p, pfeasind_p, dfeasind_p) +end + +function CPXsolution(env, lp, lpstat_p, objval_p, x, pi, slack, dj) + ccall((:CPXsolution, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, lpstat_p, objval_p, x, pi, slack, dj) +end + +function CPXsolwrite(env, lp, filename_str) + ccall((:CPXsolwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXsolwritesolnpool(env, lp, soln, filename_str) + ccall((:CPXsolwritesolnpool, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cchar}), env, lp, soln, filename_str) +end + +function CPXsolwritesolnpoolall(env, lp, filename_str) + ccall((:CPXsolwritesolnpoolall, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXstrongbranch(env, lp, indices, cnt, downobj, upobj, itlim) + ccall((:CPXstrongbranch, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint), env, lp, indices, cnt, downobj, upobj, itlim) +end + +function CPXtightenbds(env, lp, cnt, indices, lu, bd) + ccall((:CPXtightenbds, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cchar}, Ptr{Cdouble}), env, lp, cnt, indices, lu, bd) +end + +function CPXtuneparam(env, lp, intcnt, intnum, intval, dblcnt, dblnum, dblval, strcnt, strnum, strval, tunestat_p) + ccall((:CPXtuneparam, libcplex), Cint, (CPXENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Ptr{Ptr{Cchar}}, Ptr{Cint}), env, lp, intcnt, intnum, intval, dblcnt, dblnum, dblval, strcnt, strnum, strval, tunestat_p) +end + +function CPXtuneparamprobset(env, filecnt, filename, filetype, intcnt, intnum, intval, dblcnt, dblnum, dblval, strcnt, strnum, strval, tunestat_p) + ccall((:CPXtuneparamprobset, libcplex), Cint, (CPXENVptr, Cint, Ptr{Ptr{Cchar}}, Ptr{Ptr{Cchar}}, Cint, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Ptr{Ptr{Cchar}}, Ptr{Cint}), env, filecnt, filename, filetype, intcnt, intnum, intval, dblcnt, dblnum, dblval, strcnt, strnum, strval, tunestat_p) +end + +function CPXuncrushform(env, lp, plen, pind, pval, len_p, offset_p, ind, val) + ccall((:CPXuncrushform, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), env, lp, plen, pind, pval, len_p, offset_p, ind, val) +end + +function CPXuncrushpi(env, lp, pi, prepi) + ccall((:CPXuncrushpi, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, pi, prepi) +end + +function CPXuncrushx(env, lp, x, prex) + ccall((:CPXuncrushx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, x, prex) +end + +function CPXunscaleprob(env, lp) + ccall((:CPXunscaleprob, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXversion(env) + ccall((:CPXversion, libcplex), CPXCCHARptr, (CPXCENVptr,), env) +end + +function CPXversionnumber(env, version_p) + ccall((:CPXversionnumber, libcplex), Cint, (CPXCENVptr, Ptr{Cint}), env, version_p) +end + +function CPXwriteannotations(env, lp, filename) + ccall((:CPXwriteannotations, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename) +end + +function CPXwritebendersannotation(env, lp, filename) + ccall((:CPXwritebendersannotation, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename) +end + +function CPXwriteparam(env, filename_str) + ccall((:CPXwriteparam, libcplex), Cint, (CPXCENVptr, Ptr{Cchar}), env, filename_str) +end + +function CPXwriteprob(env, lp, filename_str, filetype) + ccall((:CPXwriteprob, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cchar}), env, lp, filename_str, filetype) +end + +function CPXbaropt(env, lp) + ccall((:CPXbaropt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXhybbaropt(env, lp, method) + ccall((:CPXhybbaropt, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint), env, lp, method) +end + +function CPXaddindconstraints(env, lp, indcnt, type, indvar, complemented, nzcnt, rhs, sense, linbeg, linind, linval, indname) + ccall((:CPXaddindconstraints, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, indcnt, type, indvar, complemented, nzcnt, rhs, sense, linbeg, linind, linval, indname) +end + +function CPXaddlazyconstraints(env, lp, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, rowname) + ccall((:CPXaddlazyconstraints, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, rowname) +end + +function CPXaddmipstarts(env, lp, mcnt, nzcnt, beg, varindices, values, effortlevel, mipstartname) + ccall((:CPXaddmipstarts, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Ptr{Cchar}}), env, lp, mcnt, nzcnt, beg, varindices, values, effortlevel, mipstartname) +end + +function CPXaddsolnpooldivfilter(env, lp, lower_bound, upper_bound, nzcnt, ind, weight, refval, lname_str) + ccall((:CPXaddsolnpooldivfilter, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cdouble, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cchar}), env, lp, lower_bound, upper_bound, nzcnt, ind, weight, refval, lname_str) +end + +function CPXaddsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, lname_str) + ccall((:CPXaddsolnpoolrngfilter, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cdouble, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}), env, lp, lb, ub, nzcnt, ind, val, lname_str) +end + +function CPXaddsos(env, lp, numsos, numsosnz, sostype, sosbeg, sosind, soswt, sosname) + ccall((:CPXaddsos, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, numsos, numsosnz, sostype, sosbeg, sosind, soswt, sosname) +end + +function CPXaddusercuts(env, lp, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, rowname) + ccall((:CPXaddusercuts, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, rowname) +end + +function CPXbendersopt(env, lp) + ccall((:CPXbendersopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXbranchcallbackbranchasCPLEX(env, cbdata, wherefrom, num, userhandle, seqnum_p) + ccall((:CPXbranchcallbackbranchasCPLEX, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Ptr{Cvoid}, Ptr{Cint}), env, cbdata, wherefrom, num, userhandle, seqnum_p) +end + +function CPXbranchcallbackbranchbds(env, cbdata, wherefrom, cnt, indices, lu, bd, nodeest, userhandle, seqnum_p) + ccall((:CPXbranchcallbackbranchbds, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Ptr{Cint}, Ptr{Cchar}, Ptr{Cdouble}, Cdouble, Ptr{Cvoid}, Ptr{Cint}), env, cbdata, wherefrom, cnt, indices, lu, bd, nodeest, userhandle, seqnum_p) +end + +function CPXbranchcallbackbranchconstraints(env, cbdata, wherefrom, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, nodeest, userhandle, seqnum_p) + ccall((:CPXbranchcallbackbranchconstraints, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Ptr{Cvoid}, Ptr{Cint}), env, cbdata, wherefrom, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, nodeest, userhandle, seqnum_p) +end + +function CPXbranchcallbackbranchgeneral(env, cbdata, wherefrom, varcnt, varind, varlu, varbd, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, nodeest, userhandle, seqnum_p) + ccall((:CPXbranchcallbackbranchgeneral, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Ptr{Cint}, Ptr{Cchar}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Ptr{Cvoid}, Ptr{Cint}), env, cbdata, wherefrom, varcnt, varind, varlu, varbd, rcnt, nzcnt, rhs, sense, rmatbeg, rmatind, rmatval, nodeest, userhandle, seqnum_p) +end + +function CPXcallbackgetgloballb(context, lb, _begin, _end) + ccall((:CPXcallbackgetgloballb, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint), context, lb, _begin, _end) +end + +function CPXcallbackgetglobalub(context, ub, _begin, _end) + ccall((:CPXcallbackgetglobalub, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint), context, ub, _begin, _end) +end + +function CPXcallbackgetlocallb(context, lb, _begin, _end) + ccall((:CPXcallbackgetlocallb, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint), context, lb, _begin, _end) +end + +function CPXcallbackgetlocalub(context, ub, _begin, _end) + ccall((:CPXcallbackgetlocalub, libcplex), Cint, (CPXCALLBACKCONTEXTptr, Ptr{Cdouble}, Cint, Cint), context, ub, _begin, _end) +end + +function CPXcallbacksetnodeuserhandle(env, cbdata, wherefrom, nodeindex, userhandle, olduserhandle_p) + ccall((:CPXcallbacksetnodeuserhandle, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Ptr{Cvoid}, Ptr{Ptr{Cvoid}}), env, cbdata, wherefrom, nodeindex, userhandle, olduserhandle_p) +end + +function CPXcallbacksetuserhandle(env, cbdata, wherefrom, userhandle, olduserhandle_p) + ccall((:CPXcallbacksetuserhandle, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Ptr{Cvoid}}), env, cbdata, wherefrom, userhandle, olduserhandle_p) +end + +function CPXchgctype(env, lp, cnt, indices, xctype) + ccall((:CPXchgctype, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cchar}), env, lp, cnt, indices, xctype) +end + +function CPXchgmipstarts(env, lp, mcnt, mipstartindices, nzcnt, beg, varindices, values, effortlevel) + ccall((:CPXchgmipstarts, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}), env, lp, mcnt, mipstartindices, nzcnt, beg, varindices, values, effortlevel) +end + +function CPXcopyctype(env, lp, xctype) + ccall((:CPXcopyctype, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, xctype) +end + +function CPXcopyorder(env, lp, cnt, indices, priority, direction) + ccall((:CPXcopyorder, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, lp, cnt, indices, priority, direction) +end + +function CPXcopysos(env, lp, numsos, numsosnz, sostype, sosbeg, sosind, soswt, sosname) + ccall((:CPXcopysos, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, lp, numsos, numsosnz, sostype, sosbeg, sosind, soswt, sosname) +end + +function CPXcutcallbackadd(env, cbdata, wherefrom, nzcnt, rhs, sense, cutind, cutval, purgeable) + ccall((:CPXcutcallbackadd, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint), env, cbdata, wherefrom, nzcnt, rhs, sense, cutind, cutval, purgeable) +end + +function CPXcutcallbackaddlocal(env, cbdata, wherefrom, nzcnt, rhs, sense, cutind, cutval) + ccall((:CPXcutcallbackaddlocal, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}), env, cbdata, wherefrom, nzcnt, rhs, sense, cutind, cutval) +end + +function CPXdelindconstrs(env, lp, _begin, _end) + ccall((:CPXdelindconstrs, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelmipstarts(env, lp, _begin, _end) + ccall((:CPXdelmipstarts, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelsetmipstarts(env, lp, delstat) + ccall((:CPXdelsetmipstarts, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delstat) +end + +function CPXdelsetsolnpoolfilters(env, lp, delstat) + ccall((:CPXdelsetsolnpoolfilters, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delstat) +end + +function CPXdelsetsolnpoolsolns(env, lp, delstat) + ccall((:CPXdelsetsolnpoolsolns, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delstat) +end + +function CPXdelsetsos(env, lp, delset) + ccall((:CPXdelsetsos, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}), env, lp, delset) +end + +function CPXdelsolnpoolfilters(env, lp, _begin, _end) + ccall((:CPXdelsolnpoolfilters, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelsolnpoolsolns(env, lp, _begin, _end) + ccall((:CPXdelsolnpoolsolns, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXdelsos(env, lp, _begin, _end) + ccall((:CPXdelsos, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXfltwrite(env, lp, filename_str) + ccall((:CPXfltwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXfreelazyconstraints(env, lp) + ccall((:CPXfreelazyconstraints, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXfreeusercuts(env, lp) + ccall((:CPXfreeusercuts, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXgetbestobjval(env, lp, objval_p) + ccall((:CPXgetbestobjval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, objval_p) +end + +function CPXgetbranchcallbackfunc(env, branchcallback_p, cbhandle_p) + ccall((:CPXgetbranchcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, branchcallback_p, cbhandle_p) +end + +function CPXgetbranchnosolncallbackfunc(env, branchnosolncallback_p, cbhandle_p) + ccall((:CPXgetbranchnosolncallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, branchnosolncallback_p, cbhandle_p) +end + +function CPXgetcallbackbranchconstraints(env, cbdata, wherefrom, which, cuts_p, nzcnt_p, rhs, sense, rmatbeg, rmatind, rmatval, rmatsz, surplus_p) + ccall((:CPXgetcallbackbranchconstraints, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}), env, cbdata, wherefrom, which, cuts_p, nzcnt_p, rhs, sense, rmatbeg, rmatind, rmatval, rmatsz, surplus_p) +end + +function CPXgetcallbackctype(env, cbdata, wherefrom, xctype, _begin, _end) + ccall((:CPXgetcallbackctype, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cchar}, Cint, Cint), env, cbdata, wherefrom, xctype, _begin, _end) +end + +function CPXgetcallbackgloballb(env, cbdata, wherefrom, lb, _begin, _end) + ccall((:CPXgetcallbackgloballb, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, lb, _begin, _end) +end + +function CPXgetcallbackglobalub(env, cbdata, wherefrom, ub, _begin, _end) + ccall((:CPXgetcallbackglobalub, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, ub, _begin, _end) +end + +function CPXgetcallbackincumbent(env, cbdata, wherefrom, x, _begin, _end) + ccall((:CPXgetcallbackincumbent, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, x, _begin, _end) +end + +function CPXgetcallbackindicatorinfo(env, cbdata, wherefrom, iindex, whichinfo, result_p) + ccall((:CPXgetcallbackindicatorinfo, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cint, Ptr{Cvoid}), env, cbdata, wherefrom, iindex, whichinfo, result_p) +end + +function CPXgetcallbacklp(env, cbdata, wherefrom, lp_p) + ccall((:CPXgetcallbacklp, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{CPXCLPptr}), env, cbdata, wherefrom, lp_p) +end + +function CPXgetcallbacknodeinfo(env, cbdata, wherefrom, nodeindex, whichinfo, result_p) + ccall((:CPXgetcallbacknodeinfo, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cint, Ptr{Cvoid}), env, cbdata, wherefrom, nodeindex, whichinfo, result_p) +end + +function CPXgetcallbacknodeintfeas(env, cbdata, wherefrom, feas, _begin, _end) + ccall((:CPXgetcallbacknodeintfeas, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cint}, Cint, Cint), env, cbdata, wherefrom, feas, _begin, _end) +end + +function CPXgetcallbacknodelb(env, cbdata, wherefrom, lb, _begin, _end) + ccall((:CPXgetcallbacknodelb, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, lb, _begin, _end) +end + +function CPXgetcallbacknodelp(env, cbdata, wherefrom, nodelp_p) + ccall((:CPXgetcallbacknodelp, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{CPXLPptr}), env, cbdata, wherefrom, nodelp_p) +end + +function CPXgetcallbacknodeobjval(env, cbdata, wherefrom, objval_p) + ccall((:CPXgetcallbacknodeobjval, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}), env, cbdata, wherefrom, objval_p) +end + +function CPXgetcallbacknodestat(env, cbdata, wherefrom, nodestat_p) + ccall((:CPXgetcallbacknodestat, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cint}), env, cbdata, wherefrom, nodestat_p) +end + +function CPXgetcallbacknodeub(env, cbdata, wherefrom, ub, _begin, _end) + ccall((:CPXgetcallbacknodeub, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, ub, _begin, _end) +end + +function CPXgetcallbacknodex(env, cbdata, wherefrom, x, _begin, _end) + ccall((:CPXgetcallbacknodex, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, x, _begin, _end) +end + +function CPXgetcallbackorder(env, cbdata, wherefrom, priority, direction, _begin, _end) + ccall((:CPXgetcallbackorder, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{Cint}, Cint, Cint), env, cbdata, wherefrom, priority, direction, _begin, _end) +end + +function CPXgetcallbackpseudocosts(env, cbdata, wherefrom, uppc, downpc, _begin, _end) + ccall((:CPXgetcallbackpseudocosts, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint), env, cbdata, wherefrom, uppc, downpc, _begin, _end) +end + +function CPXgetcallbackseqinfo(env, cbdata, wherefrom, seqid, whichinfo, result_p) + ccall((:CPXgetcallbackseqinfo, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cint, Ptr{Cvoid}), env, cbdata, wherefrom, seqid, whichinfo, result_p) +end + +function CPXgetcallbacksosinfo(env, cbdata, wherefrom, sosindex, member, whichinfo, result_p) + ccall((:CPXgetcallbacksosinfo, libcplex), Cint, (CPXCENVptr, Ptr{Cvoid}, Cint, Cint, Cint, Cint, Ptr{Cvoid}), env, cbdata, wherefrom, sosindex, member, whichinfo, result_p) +end + +function CPXgetctype(env, lp, xctype, _begin, _end) + ccall((:CPXgetctype, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Cint), env, lp, xctype, _begin, _end) +end + +function CPXgetcutoff(env, lp, cutoff_p) + ccall((:CPXgetcutoff, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, cutoff_p) +end + +function CPXgetdeletenodecallbackfunc(env, deletecallback_p, cbhandle_p) + ccall((:CPXgetdeletenodecallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, deletecallback_p, cbhandle_p) +end + +function CPXgetheuristiccallbackfunc(env, heuristiccallback_p, cbhandle_p) + ccall((:CPXgetheuristiccallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, heuristiccallback_p, cbhandle_p) +end + +function CPXgetincumbentcallbackfunc(env, incumbentcallback_p, cbhandle_p) + ccall((:CPXgetincumbentcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, incumbentcallback_p, cbhandle_p) +end + +function CPXgetindconstr(env, lp, indvar_p, complemented_p, nzcnt_p, rhs_p, sense_p, linind, linval, space, surplus_p, which) + ccall((:CPXgetindconstr, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint), env, lp, indvar_p, complemented_p, nzcnt_p, rhs_p, sense_p, linind, linval, space, surplus_p, which) +end + +function CPXgetindconstraints(env, lp, type, indvar, complemented, nzcnt_p, rhs, sense, linbeg, linind, linval, linspace, surplus_p, _begin, _end) + ccall((:CPXgetindconstraints, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), env, lp, type, indvar, complemented, nzcnt_p, rhs, sense, linbeg, linind, linval, linspace, surplus_p, _begin, _end) +end + +function CPXgetindconstrindex(env, lp, lname_str, index_p) + ccall((:CPXgetindconstrindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetindconstrinfeas(env, lp, x, infeasout, _begin, _end) + ccall((:CPXgetindconstrinfeas, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint), env, lp, x, infeasout, _begin, _end) +end + +function CPXgetindconstrname(env, lp, buf_str, bufspace, surplus_p, which) + ccall((:CPXgetindconstrname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}, Cint), env, lp, buf_str, bufspace, surplus_p, which) +end + +function CPXgetindconstrslack(env, lp, indslack, _begin, _end) + ccall((:CPXgetindconstrslack, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, indslack, _begin, _end) +end + +function CPXgetinfocallbackfunc(env, callback_p, cbhandle_p) + ccall((:CPXgetinfocallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, callback_p, cbhandle_p) +end + +function CPXgetlazyconstraintcallbackfunc(env, cutcallback_p, cbhandle_p) + ccall((:CPXgetlazyconstraintcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, cutcallback_p, cbhandle_p) +end + +function CPXgetmipcallbackfunc(env, callback_p, cbhandle_p) + ccall((:CPXgetmipcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, callback_p, cbhandle_p) +end + +function CPXgetmipitcnt(env, lp) + ccall((:CPXgetmipitcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetmiprelgap(env, lp, gap_p) + ccall((:CPXgetmiprelgap, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, gap_p) +end + +function CPXgetmipstartindex(env, lp, lname_str, index_p) + ccall((:CPXgetmipstartindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetmipstartname(env, lp, name, store, storesz, surplus_p, _begin, _end) + ccall((:CPXgetmipstartname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Ptr{Cchar}}, Ptr{Cchar}, Cint, Ptr{Cint}, Cint, Cint), env, lp, name, store, storesz, surplus_p, _begin, _end) +end + +function CPXgetmipstarts(env, lp, nzcnt_p, beg, varindices, values, effortlevel, startspace, surplus_p, _begin, _end) + ccall((:CPXgetmipstarts, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Cint, Ptr{Cint}, Cint, Cint), env, lp, nzcnt_p, beg, varindices, values, effortlevel, startspace, surplus_p, _begin, _end) +end + +function CPXgetnodecallbackfunc(env, nodecallback_p, cbhandle_p) + ccall((:CPXgetnodecallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, nodecallback_p, cbhandle_p) +end + +function CPXgetnodecnt(env, lp) + ccall((:CPXgetnodecnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnodeint(env, lp) + ccall((:CPXgetnodeint, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnodeleftcnt(env, lp) + ccall((:CPXgetnodeleftcnt, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumbin(env, lp) + ccall((:CPXgetnumbin, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumcuts(env, lp, cuttype, num_p) + ccall((:CPXgetnumcuts, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}), env, lp, cuttype, num_p) +end + +function CPXgetnumindconstrs(env, lp) + ccall((:CPXgetnumindconstrs, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumint(env, lp) + ccall((:CPXgetnumint, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumlazyconstraints(env, lp) + ccall((:CPXgetnumlazyconstraints, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnummipstarts(env, lp) + ccall((:CPXgetnummipstarts, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumsemicont(env, lp) + ccall((:CPXgetnumsemicont, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumsemiint(env, lp) + ccall((:CPXgetnumsemiint, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumsos(env, lp) + ccall((:CPXgetnumsos, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumusercuts(env, lp) + ccall((:CPXgetnumusercuts, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetorder(env, lp, cnt_p, indices, priority, direction, ordspace, surplus_p) + ccall((:CPXgetorder, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}), env, lp, cnt_p, indices, priority, direction, ordspace, surplus_p) +end + +function CPXgetsolnpooldivfilter(env, lp, lower_cutoff_p, upper_cutoff_p, nzcnt_p, ind, val, refval, space, surplus_p, which) + ccall((:CPXgetsolnpooldivfilter, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint), env, lp, lower_cutoff_p, upper_cutoff_p, nzcnt_p, ind, val, refval, space, surplus_p, which) +end + +function CPXgetsolnpoolfilterindex(env, lp, lname_str, index_p) + ccall((:CPXgetsolnpoolfilterindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetsolnpoolfiltername(env, lp, buf_str, bufspace, surplus_p, which) + ccall((:CPXgetsolnpoolfiltername, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}, Cint), env, lp, buf_str, bufspace, surplus_p, which) +end + +function CPXgetsolnpoolfiltertype(env, lp, ftype_p, which) + ccall((:CPXgetsolnpoolfiltertype, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Cint), env, lp, ftype_p, which) +end + +function CPXgetsolnpoolmeanobjval(env, lp, meanobjval_p) + ccall((:CPXgetsolnpoolmeanobjval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, meanobjval_p) +end + +function CPXgetsolnpoolnumfilters(env, lp) + ccall((:CPXgetsolnpoolnumfilters, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetsolnpoolnumreplaced(env, lp) + ccall((:CPXgetsolnpoolnumreplaced, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetsolnpoolnumsolns(env, lp) + ccall((:CPXgetsolnpoolnumsolns, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetsolnpoolobjval(env, lp, soln, objval_p) + ccall((:CPXgetsolnpoolobjval, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}), env, lp, soln, objval_p) +end + +function CPXgetsolnpoolqconstrslack(env, lp, soln, qcslack, _begin, _end) + ccall((:CPXgetsolnpoolqconstrslack, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}, Cint, Cint), env, lp, soln, qcslack, _begin, _end) +end + +function CPXgetsolnpoolrngfilter(env, lp, lb_p, ub_p, nzcnt_p, ind, val, space, surplus_p, which) + ccall((:CPXgetsolnpoolrngfilter, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint), env, lp, lb_p, ub_p, nzcnt_p, ind, val, space, surplus_p, which) +end + +function CPXgetsolnpoolslack(env, lp, soln, slack, _begin, _end) + ccall((:CPXgetsolnpoolslack, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}, Cint, Cint), env, lp, soln, slack, _begin, _end) +end + +function CPXgetsolnpoolsolnindex(env, lp, lname_str, index_p) + ccall((:CPXgetsolnpoolsolnindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetsolnpoolsolnname(env, lp, store, storesz, surplus_p, which) + ccall((:CPXgetsolnpoolsolnname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}, Cint), env, lp, store, storesz, surplus_p, which) +end + +function CPXgetsolnpoolx(env, lp, soln, x, _begin, _end) + ccall((:CPXgetsolnpoolx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cdouble}, Cint, Cint), env, lp, soln, x, _begin, _end) +end + +function CPXgetsolvecallbackfunc(env, solvecallback_p, cbhandle_p) + ccall((:CPXgetsolvecallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, solvecallback_p, cbhandle_p) +end + +function CPXgetsos(env, lp, numsosnz_p, sostype, sosbeg, sosind, soswt, sosspace, surplus_p, _begin, _end) + ccall((:CPXgetsos, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), env, lp, numsosnz_p, sostype, sosbeg, sosind, soswt, sosspace, surplus_p, _begin, _end) +end + +function CPXgetsosindex(env, lp, lname_str, index_p) + ccall((:CPXgetsosindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetsosinfeas(env, lp, x, infeasout, _begin, _end) + ccall((:CPXgetsosinfeas, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint), env, lp, x, infeasout, _begin, _end) +end + +function CPXgetsosname(env, lp, name, namestore, storespace, surplus_p, _begin, _end) + ccall((:CPXgetsosname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Ptr{Cchar}}, Ptr{Cchar}, Cint, Ptr{Cint}, Cint, Cint), env, lp, name, namestore, storespace, surplus_p, _begin, _end) +end + +function CPXgetsubmethod(env, lp) + ccall((:CPXgetsubmethod, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetsubstat(env, lp) + ccall((:CPXgetsubstat, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetusercutcallbackfunc(env, cutcallback_p, cbhandle_p) + ccall((:CPXgetusercutcallbackfunc, libcplex), Cint, (CPXCENVptr, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}), env, cutcallback_p, cbhandle_p) +end + +function CPXindconstrslackfromx(env, lp, x, indslack) + ccall((:CPXindconstrslackfromx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, x, indslack) +end + +function CPXmipopt(env, lp) + ccall((:CPXmipopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXordread(env, filename_str, numcols, colname, cnt_p, indices, priority, direction) + ccall((:CPXordread, libcplex), Cint, (CPXCENVptr, Ptr{Cchar}, Cint, Ptr{Ptr{Cchar}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, filename_str, numcols, colname, cnt_p, indices, priority, direction) +end + +function CPXordwrite(env, lp, filename_str) + ccall((:CPXordwrite, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXpopulate(env, lp) + ccall((:CPXpopulate, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXreadcopymipstarts(env, lp, filename_str) + ccall((:CPXreadcopymipstarts, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXreadcopyorder(env, lp, filename_str) + ccall((:CPXreadcopyorder, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXreadcopysolnpoolfilters(env, lp, filename_str) + ccall((:CPXreadcopysolnpoolfilters, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cchar}), env, lp, filename_str) +end + +function CPXrefinemipstartconflict(env, lp, mipstartindex, confnumrows_p, confnumcols_p) + ccall((:CPXrefinemipstartconflict, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Ptr{Cint}, Ptr{Cint}), env, lp, mipstartindex, confnumrows_p, confnumcols_p) +end + +function CPXrefinemipstartconflictext(env, lp, mipstartindex, grpcnt, concnt, grppref, grpbeg, grpind, grptype) + ccall((:CPXrefinemipstartconflictext, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cchar}), env, lp, mipstartindex, grpcnt, concnt, grppref, grpbeg, grpind, grptype) +end + +function CPXsetbranchcallbackfunc(env, branchcallback, cbhandle) + ccall((:CPXsetbranchcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, branchcallback, cbhandle) +end + +function CPXsetbranchnosolncallbackfunc(env, branchnosolncallback, cbhandle) + ccall((:CPXsetbranchnosolncallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, branchnosolncallback, cbhandle) +end + +function CPXsetdeletenodecallbackfunc(env, deletecallback, cbhandle) + ccall((:CPXsetdeletenodecallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, deletecallback, cbhandle) +end + +function CPXsetheuristiccallbackfunc(env, heuristiccallback, cbhandle) + ccall((:CPXsetheuristiccallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, heuristiccallback, cbhandle) +end + +function CPXsetincumbentcallbackfunc(env, incumbentcallback, cbhandle) + ccall((:CPXsetincumbentcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, incumbentcallback, cbhandle) +end + +function CPXsetinfocallbackfunc(env, callback, cbhandle) + ccall((:CPXsetinfocallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, callback, cbhandle) +end + +function CPXsetlazyconstraintcallbackfunc(env, lazyconcallback, cbhandle) + ccall((:CPXsetlazyconstraintcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, lazyconcallback, cbhandle) +end + +function CPXsetmipcallbackfunc(env, callback, cbhandle) + ccall((:CPXsetmipcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, callback, cbhandle) +end + +function CPXsetnodecallbackfunc(env, nodecallback, cbhandle) + ccall((:CPXsetnodecallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, nodecallback, cbhandle) +end + +function CPXsetsolvecallbackfunc(env, solvecallback, cbhandle) + ccall((:CPXsetsolvecallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, solvecallback, cbhandle) +end + +function CPXsetusercutcallbackfunc(env, cutcallback, cbhandle) + ccall((:CPXsetusercutcallbackfunc, libcplex), Cint, (CPXENVptr, Ptr{Cvoid}, Ptr{Cvoid}), env, cutcallback, cbhandle) +end + +function CPXwritemipstarts(env, lp, filename_str, _begin, _end) + ccall((:CPXwritemipstarts, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Cint), env, lp, filename_str, _begin, _end) +end + +function CPXaddindconstr(env, lp, indvar, complemented, nzcnt, rhs, sense, linind, linval, indname_str) + ccall((:CPXaddindconstr, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}), env, lp, indvar, complemented, nzcnt, rhs, sense, linind, linval, indname_str) +end + +function CPXNETaddarcs(env, net, narcs, fromnode, tonode, low, up, obj, anames) + ccall((:CPXNETaddarcs, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, net, narcs, fromnode, tonode, low, up, obj, anames) +end + +function CPXNETaddnodes(env, net, nnodes, supply, name) + ccall((:CPXNETaddnodes, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, net, nnodes, supply, name) +end + +function CPXNETbasewrite(env, net, filename_str) + ccall((:CPXNETbasewrite, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cchar}), env, net, filename_str) +end + +function CPXNETchgarcname(env, net, cnt, indices, newname) + ccall((:CPXNETchgarcname, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Ptr{Cchar}}), env, net, cnt, indices, newname) +end + +function CPXNETchgarcnodes(env, net, cnt, indices, fromnode, tonode) + ccall((:CPXNETchgarcnodes, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, net, cnt, indices, fromnode, tonode) +end + +function CPXNETchgbds(env, net, cnt, indices, lu, bd) + ccall((:CPXNETchgbds, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Cchar}, Ptr{Cdouble}), env, net, cnt, indices, lu, bd) +end + +function CPXNETchgname(env, net, key, vindex, name_str) + ccall((:CPXNETchgname, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Cint, Ptr{Cchar}), env, net, key, vindex, name_str) +end + +function CPXNETchgnodename(env, net, cnt, indices, newname) + ccall((:CPXNETchgnodename, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Ptr{Cchar}}), env, net, cnt, indices, newname) +end + +function CPXNETchgobj(env, net, cnt, indices, obj) + ccall((:CPXNETchgobj, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, net, cnt, indices, obj) +end + +function CPXNETchgobjsen(env, net, maxormin) + ccall((:CPXNETchgobjsen, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint), env, net, maxormin) +end + +function CPXNETchgsupply(env, net, cnt, indices, supply) + ccall((:CPXNETchgsupply, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Ptr{Cint}, Ptr{Cdouble}), env, net, cnt, indices, supply) +end + +function CPXNETcopybase(env, net, astat, nstat) + ccall((:CPXNETcopybase, libcplex), Cint, (CPXCENVptr, CPXNETptr, Ptr{Cint}, Ptr{Cint}), env, net, astat, nstat) +end + +function CPXNETcopynet(env, net, objsen, nnodes, supply, nnames, narcs, fromnode, tonode, low, up, obj, anames) + ccall((:CPXNETcopynet, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Cint, Ptr{Cdouble}, Ptr{Ptr{Cchar}}, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cchar}}), env, net, objsen, nnodes, supply, nnames, narcs, fromnode, tonode, low, up, obj, anames) +end + +function CPXNETcreateprob(env, status_p, name_str) + ccall((:CPXNETcreateprob, libcplex), CPXNETptr, (CPXENVptr, Ptr{Cint}, Ptr{Cchar}), env, status_p, name_str) +end + +function CPXNETdelarcs(env, net, _begin, _end) + ccall((:CPXNETdelarcs, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Cint), env, net, _begin, _end) +end + +function CPXNETdelnodes(env, net, _begin, _end) + ccall((:CPXNETdelnodes, libcplex), Cint, (CPXCENVptr, CPXNETptr, Cint, Cint), env, net, _begin, _end) +end + +function CPXNETdelset(env, net, whichnodes, whicharcs) + ccall((:CPXNETdelset, libcplex), Cint, (CPXCENVptr, CPXNETptr, Ptr{Cint}, Ptr{Cint}), env, net, whichnodes, whicharcs) +end + +function CPXNETfreeprob(env, net_p) + ccall((:CPXNETfreeprob, libcplex), Cint, (CPXENVptr, Ptr{CPXNETptr}), env, net_p) +end + +function CPXNETgetarcindex(env, net, lname_str, index_p) + ccall((:CPXNETgetarcindex, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cchar}, Ptr{Cint}), env, net, lname_str, index_p) +end + +function CPXNETgetarcname(env, net, nnames, namestore, namespc, surplus_p, _begin, _end) + ccall((:CPXNETgetarcname, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Ptr{Cchar}}, Ptr{Cchar}, Cint, Ptr{Cint}, Cint, Cint), env, net, nnames, namestore, namespc, surplus_p, _begin, _end) +end + +function CPXNETgetarcnodes(env, net, fromnode, tonode, _begin, _end) + ccall((:CPXNETgetarcnodes, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cint}, Ptr{Cint}, Cint, Cint), env, net, fromnode, tonode, _begin, _end) +end + +function CPXNETgetbase(env, net, astat, nstat) + ccall((:CPXNETgetbase, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cint}, Ptr{Cint}), env, net, astat, nstat) +end + +function CPXNETgetdj(env, net, dj, _begin, _end) + ccall((:CPXNETgetdj, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, dj, _begin, _end) +end + +function CPXNETgetitcnt(env, net) + ccall((:CPXNETgetitcnt, libcplex), Cint, (CPXCENVptr, CPXCNETptr), env, net) +end + +function CPXNETgetlb(env, net, low, _begin, _end) + ccall((:CPXNETgetlb, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, low, _begin, _end) +end + +function CPXNETgetnodearcs(env, net, arccnt_p, arcbeg, arc, arcspace, surplus_p, _begin, _end) + ccall((:CPXNETgetnodearcs, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cint, Ptr{Cint}, Cint, Cint), env, net, arccnt_p, arcbeg, arc, arcspace, surplus_p, _begin, _end) +end + +function CPXNETgetnodeindex(env, net, lname_str, index_p) + ccall((:CPXNETgetnodeindex, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cchar}, Ptr{Cint}), env, net, lname_str, index_p) +end + +function CPXNETgetnodename(env, net, nnames, namestore, namespc, surplus_p, _begin, _end) + ccall((:CPXNETgetnodename, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Ptr{Cchar}}, Ptr{Cchar}, Cint, Ptr{Cint}, Cint, Cint), env, net, nnames, namestore, namespc, surplus_p, _begin, _end) +end + +function CPXNETgetnumarcs(env, net) + ccall((:CPXNETgetnumarcs, libcplex), Cint, (CPXCENVptr, CPXCNETptr), env, net) +end + +function CPXNETgetnumnodes(env, net) + ccall((:CPXNETgetnumnodes, libcplex), Cint, (CPXCENVptr, CPXCNETptr), env, net) +end + +function CPXNETgetobj(env, net, obj, _begin, _end) + ccall((:CPXNETgetobj, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, obj, _begin, _end) +end + +function CPXNETgetobjsen(env, net) + ccall((:CPXNETgetobjsen, libcplex), Cint, (CPXCENVptr, CPXCNETptr), env, net) +end + +function CPXNETgetobjval(env, net, objval_p) + ccall((:CPXNETgetobjval, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}), env, net, objval_p) +end + +function CPXNETgetphase1cnt(env, net) + ccall((:CPXNETgetphase1cnt, libcplex), Cint, (CPXCENVptr, CPXCNETptr), env, net) +end + +function CPXNETgetpi(env, net, pi, _begin, _end) + ccall((:CPXNETgetpi, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, pi, _begin, _end) +end + +function CPXNETgetprobname(env, net, buf_str, bufspace, surplus_p) + ccall((:CPXNETgetprobname, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cchar}, Cint, Ptr{Cint}), env, net, buf_str, bufspace, surplus_p) +end + +function CPXNETgetslack(env, net, slack, _begin, _end) + ccall((:CPXNETgetslack, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, slack, _begin, _end) +end + +function CPXNETgetstat(env, net) + ccall((:CPXNETgetstat, libcplex), Cint, (CPXCENVptr, CPXCNETptr), env, net) +end + +function CPXNETgetsupply(env, net, supply, _begin, _end) + ccall((:CPXNETgetsupply, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, supply, _begin, _end) +end + +function CPXNETgetub(env, net, up, _begin, _end) + ccall((:CPXNETgetub, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, up, _begin, _end) +end + +function CPXNETgetx(env, net, x, _begin, _end) + ccall((:CPXNETgetx, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cdouble}, Cint, Cint), env, net, x, _begin, _end) +end + +function CPXNETprimopt(env, net) + ccall((:CPXNETprimopt, libcplex), Cint, (CPXCENVptr, CPXNETptr), env, net) +end + +function CPXNETreadcopybase(env, net, filename_str) + ccall((:CPXNETreadcopybase, libcplex), Cint, (CPXCENVptr, CPXNETptr, Ptr{Cchar}), env, net, filename_str) +end + +function CPXNETreadcopyprob(env, net, filename_str) + ccall((:CPXNETreadcopyprob, libcplex), Cint, (CPXCENVptr, CPXNETptr, Ptr{Cchar}), env, net, filename_str) +end + +function CPXNETsolninfo(env, net, pfeasind_p, dfeasind_p) + ccall((:CPXNETsolninfo, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cint}, Ptr{Cint}), env, net, pfeasind_p, dfeasind_p) +end + +function CPXNETsolution(env, net, netstat_p, objval_p, x, pi, slack, dj) + ccall((:CPXNETsolution, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, net, netstat_p, objval_p, x, pi, slack, dj) +end + +function CPXNETwriteprob(env, net, filename_str, format_str) + ccall((:CPXNETwriteprob, libcplex), Cint, (CPXCENVptr, CPXCNETptr, Ptr{Cchar}, Ptr{Cchar}), env, net, filename_str, format_str) +end + +function CPXchgqpcoef(env, lp, i, j, newvalue) + ccall((:CPXchgqpcoef, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cdouble), env, lp, i, j, newvalue) +end + +function CPXcopyqpsep(env, lp, qsepvec) + ccall((:CPXcopyqpsep, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cdouble}), env, lp, qsepvec) +end + +function CPXcopyquad(env, lp, qmatbeg, qmatcnt, qmatind, qmatval) + ccall((:CPXcopyquad, libcplex), Cint, (CPXCENVptr, CPXLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), env, lp, qmatbeg, qmatcnt, qmatind, qmatval) +end + +function CPXgetnumqpnz(env, lp) + ccall((:CPXgetnumqpnz, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetnumquad(env, lp) + ccall((:CPXgetnumquad, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetqpcoef(env, lp, rownum, colnum, coef_p) + ccall((:CPXgetqpcoef, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Cint, Ptr{Cdouble}), env, lp, rownum, colnum, coef_p) +end + +function CPXgetquad(env, lp, nzcnt_p, qmatbeg, qmatind, qmatval, qmatspace, surplus_p, _begin, _end) + ccall((:CPXgetquad, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint, Cint), env, lp, nzcnt_p, qmatbeg, qmatind, qmatval, qmatspace, surplus_p, _begin, _end) +end + +function CPXqpindefcertificate(env, lp, x) + ccall((:CPXqpindefcertificate, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}), env, lp, x) +end + +function CPXqpopt(env, lp) + ccall((:CPXqpopt, libcplex), Cint, (CPXCENVptr, CPXLPptr), env, lp) +end + +function CPXaddqconstr(env, lp, linnzcnt, quadnzcnt, rhs, sense, linind, linval, quadrow, quadcol, quadval, lname_str) + ccall((:CPXaddqconstr, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}), env, lp, linnzcnt, quadnzcnt, rhs, sense, linind, linval, quadrow, quadcol, quadval, lname_str) +end + +function CPXdelqconstrs(env, lp, _begin, _end) + ccall((:CPXdelqconstrs, libcplex), Cint, (CPXCENVptr, CPXLPptr, Cint, Cint), env, lp, _begin, _end) +end + +function CPXgetnumqconstrs(env, lp) + ccall((:CPXgetnumqconstrs, libcplex), Cint, (CPXCENVptr, CPXCLPptr), env, lp) +end + +function CPXgetqconstr(env, lp, linnzcnt_p, quadnzcnt_p, rhs_p, sense_p, linind, linval, linspace, linsurplus_p, quadrow, quadcol, quadval, quadspace, quadsurplus_p, which) + ccall((:CPXgetqconstr, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}, Cint), env, lp, linnzcnt_p, quadnzcnt_p, rhs_p, sense_p, linind, linval, linspace, linsurplus_p, quadrow, quadcol, quadval, quadspace, quadsurplus_p, which) +end + +function CPXgetqconstrdslack(env, lp, qind, nz_p, ind, val, space, surplus_p) + ccall((:CPXgetqconstrdslack, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Ptr{Cint}), env, lp, qind, nz_p, ind, val, space, surplus_p) +end + +function CPXgetqconstrindex(env, lp, lname_str, index_p) + ccall((:CPXgetqconstrindex, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Ptr{Cint}), env, lp, lname_str, index_p) +end + +function CPXgetqconstrinfeas(env, lp, x, infeasout, _begin, _end) + ccall((:CPXgetqconstrinfeas, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint), env, lp, x, infeasout, _begin, _end) +end + +function CPXgetqconstrname(env, lp, buf_str, bufspace, surplus_p, which) + ccall((:CPXgetqconstrname, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cchar}, Cint, Ptr{Cint}, Cint), env, lp, buf_str, bufspace, surplus_p, which) +end + +function CPXgetqconstrslack(env, lp, qcslack, _begin, _end) + ccall((:CPXgetqconstrslack, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, qcslack, _begin, _end) +end + +function CPXgetxqxax(env, lp, xqxax, _begin, _end) + ccall((:CPXgetxqxax, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Cint, Cint), env, lp, xqxax, _begin, _end) +end + +function CPXqconstrslackfromx(env, lp, x, qcslack) + ccall((:CPXqconstrslackfromx, libcplex), Cint, (CPXCENVptr, CPXCLPptr, Ptr{Cdouble}, Ptr{Cdouble}), env, lp, x, qcslack) +end +# Julia wrapper for header: cpxconst.h +# Automatically generated using Clang.jl + diff --git a/src/gen/libcpx_common.jl b/src/gen/libcpx_common.jl new file mode 100644 index 00000000..bc48de1b --- /dev/null +++ b/src/gen/libcpx_common.jl @@ -0,0 +1,1424 @@ +# Automatically generated using Clang.jl + + +const CPX_H = 1 +const CPXBAR_H = 1 +const CPXMIP_H = 1 + +# Skipping MacroDefinition: CPXgetmipobjval ( env , lp , objval_p ) CPXgetobjval ( env , lp , objval_p ) +# Skipping MacroDefinition: CPXgetmipqconstrslack ( env , lp , qcslack , begin , end ) CPXgetqconstrslack ( env , lp , qcslack , begin , end ) +# Skipping MacroDefinition: CPXgetmipslack ( env , lp , slack , begin , end ) CPXgetslack ( env , lp , slack , begin , end ) +# Skipping MacroDefinition: CPXgetmipx ( env , lp , x , begin , end ) CPXgetx ( env , lp , x , begin , end ) + +const CPXGC_H = 1 +const CPXNET_H = 1 +const CPXQP_H = 1 +const CPXSOCP_H = 1 +const CPX_FEATURES_H = 1 +const CPX_FEATURE_REMOTE_OBJECT = 1 +const CPX_FEATURE_DISTRIBUTED_MIP = 1 +const CPX_CPXAUTOINTTYPES_H_H = 1 +const CPXBYTE_DEFINED = 1 +const CPXINT_DEFINED = 1 +const CPXLONG_DEFINED = 1 +const CPXSHORT_DEFINED = 1 +const CPXSIZE_BITS = 64 +const CPXULONG_DEFINED = 1 +const CPXINT_MAX = 2147483647 +const CPXINT_MIN = -2147483648 +const CPXDEPRECATEDAPI = nothing +const CPXDEPRECATED = nothing +const CPXDEPRECATEDENUMVAL = nothing +const CPX_STR_PARAM_MAX = 512 + +# Skipping MacroDefinition: CPX_STATIC_INLINE static inline +# Skipping MacroDefinition: CALLBACK_BRANCH_ARGS CPXCENVptr xenv , void * cbdata , int wherefrom , void * cbhandle , int brtype , int brset , int nodecnt , int bdcnt , const int * nodebeg , const int * xindex , const char * lu , const double * bd , const double * nodeest , int * useraction_p +# Skipping MacroDefinition: CALLBACK_NODE_ARGS CPXCENVptr xenv , void * cbdata , int wherefrom , void * cbhandle , int * nodeindex , int * useraction +# Skipping MacroDefinition: CALLBACK_HEURISTIC_ARGS CPXCENVptr xenv , void * cbdata , int wherefrom , void * cbhandle , double * objval_p , double * x , int * checkfeas_p , int * useraction_p +# Skipping MacroDefinition: CALLBACK_SOLVE_ARGS CPXCENVptr xenv , void * cbdata , int wherefrom , void * cbhandle , int * useraction +# Skipping MacroDefinition: CALLBACK_CUT_ARGS CPXCENVptr xenv , void * cbdata , int wherefrom , void * cbhandle , int * useraction_p +# Skipping MacroDefinition: CALLBACK_INCUMBENT_ARGS CPXCENVptr xenv , void * cbdata , int wherefrom , void * cbhandle , double objval , double * x , int * isfeas_p , int * useraction_p +# Skipping MacroDefinition: CALLBACK_DELETENODE_ARGS CPXCENVptr xenv , int wherefrom , void * cbhandle , int seqnum , void * handle + +const CPX_VERSION = 12100000 +const CPX_VERSION_VERSION = 12 +const CPX_VERSION_RELEASE = 10 +const CPX_VERSION_MODIFICATION = 0 +const CPX_VERSION_FIX = 0 +const CPX_INFBOUND = 1.0e20 +const CPX_MINBOUND = 1.0e-13 +const CPX_PARAMTYPE_NONE = 0 +const CPX_PARAMTYPE_INT = 1 +const CPX_PARAMTYPE_DOUBLE = 2 +const CPX_PARAMTYPE_STRING = 3 +const CPX_PARAMTYPE_LONG = 4 +const CPX_NO_SOLN = 0 +const CPX_AUTO_SOLN = 0 +const CPX_BASIC_SOLN = 1 +const CPX_NONBASIC_SOLN = 2 +const CPX_PRIMAL_SOLN = 3 +const CPX_PRECOL_LOW = -1 +const CPX_PRECOL_UP = -2 +const CPX_PRECOL_FIX = -3 +const CPX_PRECOL_AGG = -4 +const CPX_PRECOL_OTHER = -5 +const CPX_PREROW_RED = -1 +const CPX_PREROW_AGG = -2 +const CPX_PREROW_OTHER = -3 +const CPX_AUTO = -1 +const CPX_ON = 1 +const CPX_OFF = 0 +const CPX_MAX = -1 +const CPX_MIN = 1 +const CPX_DATACHECK_OFF = 0 +const CPX_DATACHECK_WARN = 1 +const CPX_DATACHECK_ASSIST = 2 +const CPX_PPRIIND_PARTIAL = -1 +const CPX_PPRIIND_AUTO = 0 +const CPX_PPRIIND_DEVEX = 1 +const CPX_PPRIIND_STEEP = 2 +const CPX_PPRIIND_STEEPQSTART = 3 +const CPX_PPRIIND_FULL = 4 +const CPX_DPRIIND_AUTO = 0 +const CPX_DPRIIND_FULL = 1 +const CPX_DPRIIND_STEEP = 2 +const CPX_DPRIIND_FULLSTEEP = 3 +const CPX_DPRIIND_STEEPQSTART = 4 +const CPX_DPRIIND_DEVEX = 5 +const CPX_PARALLEL_DETERMINISTIC = 1 +const CPX_PARALLEL_AUTO = 0 +const CPX_PARALLEL_OPPORTUNISTIC = -1 +const CPX_WRITELEVEL_AUTO = 0 +const CPX_WRITELEVEL_ALLVARS = 1 +const CPX_WRITELEVEL_DISCRETEVARS = 2 +const CPX_WRITELEVEL_NONZEROVARS = 3 +const CPX_WRITELEVEL_NONZERODISCRETEVARS = 4 +const CPX_OPTIMALITYTARGET_AUTO = 0 +const CPX_OPTIMALITYTARGET_OPTIMALCONVEX = 1 +const CPX_OPTIMALITYTARGET_FIRSTORDER = 2 +const CPX_OPTIMALITYTARGET_OPTIMALGLOBAL = 3 +const CPX_ALG_NONE = -1 +const CPX_ALG_AUTOMATIC = 0 +const CPX_ALG_PRIMAL = 1 +const CPX_ALG_DUAL = 2 +const CPX_ALG_NET = 3 +const CPX_ALG_BARRIER = 4 +const CPX_ALG_SIFTING = 5 +const CPX_ALG_CONCURRENT = 6 +const CPX_ALG_BAROPT = 7 +const CPX_ALG_PIVOTIN = 8 +const CPX_ALG_PIVOTOUT = 9 +const CPX_ALG_PIVOT = 10 +const CPX_ALG_FEASOPT = 11 +const CPX_ALG_MIP = 12 +const CPX_ALG_BENDERS = 13 +const CPX_ALG_MULTIOBJ = 14 +const CPX_ALG_ROBUST = 15 +const CPX_AT_LOWER = 0 +const CPX_BASIC = 1 +const CPX_AT_UPPER = 2 +const CPX_FREE_SUPER = 3 +const CPX_NO_VARIABLE = 2100000000 +const CPX_CONTINUOUS = 'C' +const CPX_BINARY = 'B' +const CPX_INTEGER = 'I' +const CPX_SEMICONT = 'S' +const CPX_SEMIINT = 'N' +const CPX_PREREDUCE_PRIMALANDDUAL = 3 +const CPX_PREREDUCE_DUALONLY = 2 +const CPX_PREREDUCE_PRIMALONLY = 1 +const CPX_PREREDUCE_NOPRIMALORDUAL = 0 +const CPX_CONFLICT_EXCLUDED = -1 +const CPX_CONFLICT_POSSIBLE_MEMBER = 0 +const CPX_CONFLICT_POSSIBLE_LB = 1 +const CPX_CONFLICT_POSSIBLE_UB = 2 +const CPX_CONFLICT_MEMBER = 3 +const CPX_CONFLICT_LB = 4 +const CPX_CONFLICT_UB = 5 +const CPX_CONFLICTALG_AUTO = 0 +const CPX_CONFLICTALG_FAST = 1 +const CPX_CONFLICTALG_PROPAGATE = 2 +const CPX_CONFLICTALG_PRESOLVE = 3 +const CPX_CONFLICTALG_IIS = 4 +const CPX_CONFLICTALG_LIMITSOLVE = 5 +const CPX_CONFLICTALG_SOLVE = 6 +const CPXPROB_LP = 0 +const CPXPROB_MILP = 1 +const CPXPROB_FIXEDMILP = 3 +const CPXPROB_NODELP = 4 +const CPXPROB_QP = 5 +const CPXPROB_MIQP = 7 +const CPXPROB_FIXEDMIQP = 8 +const CPXPROB_NODEQP = 9 +const CPXPROB_QCP = 10 +const CPXPROB_MIQCP = 11 +const CPXPROB_NODEQCP = 12 +const CPX_LPREADER_LEGACY = 0 +const CPX_LPREADER_NEW = 1 +const CPX_PARAM_ALL_MIN = 1000 +const CPX_PARAM_ALL_MAX = 6000 +const CPX_CALLBACK_PRIMAL = 1 +const CPX_CALLBACK_DUAL = 2 +const CPX_CALLBACK_NETWORK = 3 +const CPX_CALLBACK_PRIMAL_CROSSOVER = 4 +const CPX_CALLBACK_DUAL_CROSSOVER = 5 +const CPX_CALLBACK_BARRIER = 6 +const CPX_CALLBACK_PRESOLVE = 7 +const CPX_CALLBACK_QPBARRIER = 8 +const CPX_CALLBACK_QPSIMPLEX = 9 +const CPX_CALLBACK_TUNING = 10 +const CPX_CALLBACK_INFO_PRIMAL_OBJ = 1 +const CPX_CALLBACK_INFO_DUAL_OBJ = 2 +const CPX_CALLBACK_INFO_PRIMAL_INFMEAS = 3 +const CPX_CALLBACK_INFO_DUAL_INFMEAS = 4 +const CPX_CALLBACK_INFO_PRIMAL_FEAS = 5 +const CPX_CALLBACK_INFO_DUAL_FEAS = 6 +const CPX_CALLBACK_INFO_ITCOUNT = 7 +const CPX_CALLBACK_INFO_CROSSOVER_PPUSH = 8 +const CPX_CALLBACK_INFO_CROSSOVER_PEXCH = 9 +const CPX_CALLBACK_INFO_CROSSOVER_DPUSH = 10 +const CPX_CALLBACK_INFO_CROSSOVER_DEXCH = 11 +const CPX_CALLBACK_INFO_CROSSOVER_SBCNT = 12 +const CPX_CALLBACK_INFO_PRESOLVE_ROWSGONE = 13 +const CPX_CALLBACK_INFO_PRESOLVE_COLSGONE = 14 +const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST = 15 +const CPX_CALLBACK_INFO_PRESOLVE_COEFFS = 16 +const CPX_CALLBACK_INFO_USER_PROBLEM = 17 +const CPX_CALLBACK_INFO_TUNING_PROGRESS = 18 +const CPX_CALLBACK_INFO_ENDTIME = 19 +const CPX_CALLBACK_INFO_ITCOUNT_LONG = 20 +const CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG = 21 +const CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG = 22 +const CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG = 23 +const CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG = 24 +const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST_LONG = 25 +const CPX_CALLBACK_INFO_PRESOLVE_COEFFS_LONG = 26 +const CPX_CALLBACK_INFO_ENDDETTIME = 27 +const CPX_CALLBACK_INFO_STARTTIME = 28 +const CPX_CALLBACK_INFO_STARTDETTIME = 29 +const CPX_TUNE_AVERAGE = 1 +const CPX_TUNE_MINMAX = 2 +const CPX_TUNE_ABORT = 1 +const CPX_TUNE_TILIM = 2 +const CPX_TUNE_DETTILIM = 3 +const CPX_FEASOPT_MIN_SUM = 0 +const CPX_FEASOPT_OPT_SUM = 1 +const CPX_FEASOPT_MIN_INF = 2 +const CPX_FEASOPT_OPT_INF = 3 +const CPX_FEASOPT_MIN_QUAD = 4 +const CPX_FEASOPT_OPT_QUAD = 5 +const CPX_BENDERSSTRATEGY_OFF = -1 +const CPX_BENDERSSTRATEGY_AUTO = 0 +const CPX_BENDERSSTRATEGY_USER = 1 +const CPX_BENDERSSTRATEGY_WORKERS = 2 +const CPX_BENDERSSTRATEGY_FULL = 3 +const CPX_ANNOTATIONDATA_LONG = 1 +const CPX_ANNOTATIONDATA_DOUBLE = 2 +const CPX_ANNOTATIONOBJ_OBJ = 0 +const CPX_ANNOTATIONOBJ_COL = 1 +const CPX_ANNOTATIONOBJ_ROW = 2 +const CPX_ANNOTATIONOBJ_SOS = 3 +const CPX_ANNOTATIONOBJ_IND = 4 +const CPX_ANNOTATIONOBJ_QC = 5 +const CPX_ANNOTATIONOBJ_LAST = 6 +const CPXIIS_COMPLETE = 1 +const CPXIIS_PARTIAL = 2 +const CPXIIS_AT_LOWER = 0 +const CPXIIS_FIXED = 1 +const CPXIIS_AT_UPPER = 2 +const CPX_BARORDER_AUTO = 0 +const CPX_BARORDER_AMD = 1 +const CPX_BARORDER_AMF = 2 +const CPX_BARORDER_ND = 3 +const CPX_MIPEMPHASIS_BALANCED = 0 +const CPX_MIPEMPHASIS_FEASIBILITY = 1 +const CPX_MIPEMPHASIS_OPTIMALITY = 2 +const CPX_MIPEMPHASIS_BESTBOUND = 3 +const CPX_MIPEMPHASIS_HIDDENFEAS = 4 +const CPX_TYPE_VAR = '0' +const CPX_TYPE_SOS1 = '1' +const CPX_TYPE_SOS2 = '2' +const CPX_TYPE_USER = 'X' +const CPX_TYPE_ANY = 'A' +const CPX_VARSEL_MININFEAS = -1 +const CPX_VARSEL_DEFAULT = 0 +const CPX_VARSEL_MAXINFEAS = 1 +const CPX_VARSEL_PSEUDO = 2 +const CPX_VARSEL_STRONG = 3 +const CPX_VARSEL_PSEUDOREDUCED = 4 +const CPX_NODESEL_DFS = 0 +const CPX_NODESEL_BESTBOUND = 1 +const CPX_NODESEL_BESTEST = 2 +const CPX_NODESEL_BESTEST_ALT = 3 +const CPX_MIPORDER_COST = 1 +const CPX_MIPORDER_BOUNDS = 2 +const CPX_MIPORDER_SCALEDCOST = 3 +const CPX_BRANCH_GLOBAL = 0 +const CPX_BRANCH_DOWN = -1 +const CPX_BRANCH_UP = 1 +const CPX_BRDIR_DOWN = -1 +const CPX_BRDIR_AUTO = 0 +const CPX_BRDIR_UP = 1 +const CPX_CUT_COVER = 0 +const CPX_CUT_GUBCOVER = 1 +const CPX_CUT_FLOWCOVER = 2 +const CPX_CUT_CLIQUE = 3 +const CPX_CUT_FRAC = 4 +const CPX_CUT_MIR = 5 +const CPX_CUT_FLOWPATH = 6 +const CPX_CUT_DISJ = 7 +const CPX_CUT_IMPLBD = 8 +const CPX_CUT_ZEROHALF = 9 +const CPX_CUT_MCF = 10 +const CPX_CUT_LOCALCOVER = 11 +const CPX_CUT_TIGHTEN = 12 +const CPX_CUT_OBJDISJ = 13 +const CPX_CUT_LANDP = 14 +const CPX_CUT_USER = 15 +const CPX_CUT_TABLE = 16 +const CPX_CUT_SOLNPOOL = 17 +const CPX_CUT_LOCALIMPLBD = 18 +const CPX_CUT_BQP = 19 +const CPX_CUT_RLT = 20 +const CPX_CUT_BENDERS = 21 +const CPX_CUT_NUM_TYPES = 22 +const CPX_MIPSEARCH_AUTO = 0 +const CPX_MIPSEARCH_TRADITIONAL = 1 +const CPX_MIPSEARCH_DYNAMIC = 2 +const CPX_MIPKAPPA_OFF = -1 +const CPX_MIPKAPPA_AUTO = 0 +const CPX_MIPKAPPA_SAMPLE = 1 +const CPX_MIPKAPPA_FULL = 2 +const CPX_MIPSTART_AUTO = 0 +const CPX_MIPSTART_CHECKFEAS = 1 +const CPX_MIPSTART_SOLVEFIXED = 2 +const CPX_MIPSTART_SOLVEMIP = 3 +const CPX_MIPSTART_REPAIR = 4 +const CPX_MIPSTART_NOCHECK = 5 +const CPX_CALLBACK_MIP = 101 +const CPX_CALLBACK_MIP_BRANCH = 102 +const CPX_CALLBACK_MIP_NODE = 103 +const CPX_CALLBACK_MIP_HEURISTIC = 104 +const CPX_CALLBACK_MIP_SOLVE = 105 +const CPX_CALLBACK_MIP_CUT_LOOP = 106 +const CPX_CALLBACK_MIP_PROBE = 107 +const CPX_CALLBACK_MIP_FRACCUT = 108 +const CPX_CALLBACK_MIP_DISJCUT = 109 +const CPX_CALLBACK_MIP_FLOWMIR = 110 +const CPX_CALLBACK_MIP_INCUMBENT_NODESOLN = 111 +const CPX_CALLBACK_MIP_DELETENODE = 112 +const CPX_CALLBACK_MIP_BRANCH_NOSOLN = 113 +const CPX_CALLBACK_MIP_CUT_LAST = 114 +const CPX_CALLBACK_MIP_CUT_FEAS = 115 +const CPX_CALLBACK_MIP_CUT_UNBD = 116 +const CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN = 117 +const CPX_CALLBACK_MIP_INCUMBENT_USERSOLN = 118 +const CPX_CALLBACK_MIP_INCUMBENT_MIPSTART = 119 +const CPX_CALLBACK_INFO_BEST_INTEGER = 101 +const CPX_CALLBACK_INFO_BEST_REMAINING = 102 +const CPX_CALLBACK_INFO_NODE_COUNT = 103 +const CPX_CALLBACK_INFO_NODES_LEFT = 104 +const CPX_CALLBACK_INFO_MIP_ITERATIONS = 105 +const CPX_CALLBACK_INFO_CUTOFF = 106 +const CPX_CALLBACK_INFO_CLIQUE_COUNT = 107 +const CPX_CALLBACK_INFO_COVER_COUNT = 108 +const CPX_CALLBACK_INFO_MIP_FEAS = 109 +const CPX_CALLBACK_INFO_FLOWCOVER_COUNT = 110 +const CPX_CALLBACK_INFO_GUBCOVER_COUNT = 111 +const CPX_CALLBACK_INFO_IMPLBD_COUNT = 112 +const CPX_CALLBACK_INFO_PROBE_PHASE = 113 +const CPX_CALLBACK_INFO_PROBE_PROGRESS = 114 +const CPX_CALLBACK_INFO_FRACCUT_COUNT = 115 +const CPX_CALLBACK_INFO_FRACCUT_PROGRESS = 116 +const CPX_CALLBACK_INFO_DISJCUT_COUNT = 117 +const CPX_CALLBACK_INFO_DISJCUT_PROGRESS = 118 +const CPX_CALLBACK_INFO_FLOWPATH_COUNT = 119 +const CPX_CALLBACK_INFO_MIRCUT_COUNT = 120 +const CPX_CALLBACK_INFO_FLOWMIR_PROGRESS = 121 +const CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT = 122 +const CPX_CALLBACK_INFO_MY_THREAD_NUM = 123 +const CPX_CALLBACK_INFO_USER_THREADS = 124 +const CPX_CALLBACK_INFO_MIP_REL_GAP = 125 +const CPX_CALLBACK_INFO_MCFCUT_COUNT = 126 +const CPX_CALLBACK_INFO_KAPPA_STABLE = 127 +const CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS = 128 +const CPX_CALLBACK_INFO_KAPPA_UNSTABLE = 129 +const CPX_CALLBACK_INFO_KAPPA_ILLPOSED = 130 +const CPX_CALLBACK_INFO_KAPPA_MAX = 131 +const CPX_CALLBACK_INFO_KAPPA_ATTENTION = 132 +const CPX_CALLBACK_INFO_LANDPCUT_COUNT = 133 +const CPX_CALLBACK_INFO_USERCUT_COUNT = 134 +const CPX_CALLBACK_INFO_TABLECUT_COUNT = 135 +const CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT = 136 +const CPX_CALLBACK_INFO_BENDERS_COUNT = 137 +const CPX_CALLBACK_INFO_NODE_COUNT_LONG = 140 +const CPX_CALLBACK_INFO_NODES_LEFT_LONG = 141 +const CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG = 142 +const CPX_CALLBACK_INFO_LAZY_SOURCE = 143 +const CPX_CALLBACK_INFO_NODE_SIINF = 201 +const CPX_CALLBACK_INFO_NODE_NIINF = 202 +const CPX_CALLBACK_INFO_NODE_ESTIMATE = 203 +const CPX_CALLBACK_INFO_NODE_DEPTH = 204 +const CPX_CALLBACK_INFO_NODE_OBJVAL = 205 +const CPX_CALLBACK_INFO_NODE_TYPE = 206 +const CPX_CALLBACK_INFO_NODE_VAR = 207 +const CPX_CALLBACK_INFO_NODE_SOS = 208 +const CPX_CALLBACK_INFO_NODE_SEQNUM = 209 +const CPX_CALLBACK_INFO_NODE_USERHANDLE = 210 +const CPX_CALLBACK_INFO_NODE_NODENUM = 211 +const CPX_CALLBACK_INFO_NODE_SEQNUM_LONG = 220 +const CPX_CALLBACK_INFO_NODE_NODENUM_LONG = 221 +const CPX_CALLBACK_INFO_NODE_DEPTH_LONG = 222 +const CPX_CALLBACK_INFO_SOS_TYPE = 240 +const CPX_CALLBACK_INFO_SOS_SIZE = 241 +const CPX_CALLBACK_INFO_SOS_IS_FEASIBLE = 242 +const CPX_CALLBACK_INFO_SOS_MEMBER_INDEX = 244 +const CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL = 246 +const CPX_CALLBACK_INFO_SOS_NUM = 247 +const CPX_CALLBACK_INFO_IC_NUM = 260 +const CPX_CALLBACK_INFO_IC_IMPLYING_VAR = 261 +const CPX_CALLBACK_INFO_IC_IMPLIED_VAR = 262 +const CPX_CALLBACK_INFO_IC_SENSE = 263 +const CPX_CALLBACK_INFO_IC_COMPL = 264 +const CPX_CALLBACK_INFO_IC_RHS = 265 +const CPX_CALLBACK_INFO_IC_IS_FEASIBLE = 266 +const CPX_INCUMBENT_ID = -1 +const CPX_RAMPUP_DISABLED = -1 +const CPX_RAMPUP_AUTO = 0 +const CPX_RAMPUP_DYNAMIC = 1 +const CPX_RAMPUP_INFINITE = 2 +const CPX_CALLBACK_DEFAULT = 0 +const CPX_CALLBACK_FAIL = 1 +const CPX_CALLBACK_SET = 2 +const CPX_CALLBACK_ABORT_CUT_LOOP = 3 +const CPX_USECUT_FORCE = 0 +const CPX_USECUT_PURGE = 1 +const CPX_USECUT_FILTER = 2 +const CPX_INTEGER_FEASIBLE = 0 +const CPX_INTEGER_INFEASIBLE = 1 +const CPX_IMPLIED_INTEGER_FEASIBLE = 2 +const CPX_CON_LOWER_BOUND = 1 +const CPX_CON_UPPER_BOUND = 2 +const CPX_CON_LINEAR = 3 +const CPX_CON_QUADRATIC = 4 +const CPX_CON_SOS = 5 +const CPX_CON_INDICATOR = 6 +const CPX_CON_PWL = 7 +const CPX_CON_ABS = 7 +const CPX_CON_MINEXPR = 8 +const CPX_CON_MAXEXPR = 9 +const CPX_CON_LAST_CONTYPE = 10 +const CPX_INDICATOR_IF = 1 +const CPX_INDICATOR_ONLYIF = 2 +const CPX_INDICATOR_IFANDONLYIF = 3 +const CPXNET_NO_DISPLAY_OBJECTIVE = 0 +const CPXNET_TRUE_OBJECTIVE = 1 +const CPXNET_PENALIZED_OBJECTIVE = 2 +const CPXNET_PRICE_AUTO = 0 +const CPXNET_PRICE_PARTIAL = 1 +const CPXNET_PRICE_MULT_PART = 2 +const CPXNET_PRICE_SORT_MULT_PART = 3 +const CPX_NETFIND_PURE = 1 +const CPX_NETFIND_REFLECT = 2 +const CPX_NETFIND_SCALE = 3 +const CPX_QCPDUALS_NO = 0 +const CPX_QCPDUALS_IFPOSSIBLE = 1 +const CPX_QCPDUALS_FORCE = 2 +const CPX_CPXAUTOCONSTANTS_H_H = 1 +const CPX_BENDERS_ANNOTATION = "cpxBendersPartition" +const CPX_BENDERS_MASTERVALUE = 0 +const CPX_BIGINT = 2100000000 +const CPX_BIGLONG = Int64(9223372036800000000) +const CPX_CALLBACKCONTEXT_BRANCHING = 0x0080 +const CPX_CALLBACKCONTEXT_CANDIDATE = 0x0020 +const CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS = 0x0010 +const CPX_CALLBACKCONTEXT_LOCAL_PROGRESS = 0x0008 +const CPX_CALLBACKCONTEXT_RELAXATION = 0x0040 +const CPX_CALLBACKCONTEXT_THREAD_DOWN = 0x0004 +const CPX_CALLBACKCONTEXT_THREAD_UP = 0x0002 +const CPX_DUAL_OBJ = 41 +const CPX_EXACT_KAPPA = 51 +const CPX_KAPPA = 39 +const CPX_KAPPA_ATTENTION = 57 +const CPX_KAPPA_ILLPOSED = 55 +const CPX_KAPPA_MAX = 56 +const CPX_KAPPA_STABLE = 52 +const CPX_KAPPA_SUSPICIOUS = 53 +const CPX_KAPPA_UNSTABLE = 54 +const CPX_LAZYCONSTRAINTCALLBACK_HEUR = CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN +const CPX_LAZYCONSTRAINTCALLBACK_MIPSTART = CPX_CALLBACK_MIP_INCUMBENT_MIPSTART +const CPX_LAZYCONSTRAINTCALLBACK_NODE = CPX_CALLBACK_MIP_INCUMBENT_NODESOLN +const CPX_LAZYCONSTRAINTCALLBACK_USER = CPX_CALLBACK_MIP_INCUMBENT_USERSOLN +const CPX_MAX_COMP_SLACK = 19 +const CPX_MAX_DUAL_INFEAS = 5 +const CPX_MAX_DUAL_RESIDUAL = 15 +const CPX_MAX_INDSLACK_INFEAS = 49 +const CPX_MAX_INT_INFEAS = 9 +const CPX_MAX_PI = 25 +const CPX_MAX_PRIMAL_INFEAS = 1 +const CPX_MAX_PRIMAL_RESIDUAL = 11 +const CPX_MAX_PWLSLACK_INFEAS = 58 +const CPX_MAX_QCPRIMAL_RESIDUAL = 43 +const CPX_MAX_QCSLACK = 47 +const CPX_MAX_QCSLACK_INFEAS = 45 +const CPX_MAX_RED_COST = 29 +const CPX_MAX_SCALED_DUAL_INFEAS = 6 +const CPX_MAX_SCALED_DUAL_RESIDUAL = 16 +const CPX_MAX_SCALED_PI = 26 +const CPX_MAX_SCALED_PRIMAL_INFEAS = 2 +const CPX_MAX_SCALED_PRIMAL_RESIDUAL = 12 +const CPX_MAX_SCALED_RED_COST = 30 +const CPX_MAX_SCALED_SLACK = 28 +const CPX_MAX_SCALED_X = 24 +const CPX_MAX_SLACK = 27 +const CPX_MAX_X = 23 +const CPX_MULTIOBJ_BARITCNT = 4 +const CPX_MULTIOBJ_BESTOBJVAL = 15 +const CPX_MULTIOBJ_BLEND = 20 +const CPX_MULTIOBJ_DEGCNT = 7 +const CPX_MULTIOBJ_DETTIME = 3 +const CPX_MULTIOBJ_DEXCH = 13 +const CPX_MULTIOBJ_DPUSH = 12 +const CPX_MULTIOBJ_ERROR = 0 +const CPX_MULTIOBJ_ITCNT = 8 +const CPX_MULTIOBJ_METHOD = 18 +const CPX_MULTIOBJ_NODECNT = 16 +const CPX_MULTIOBJ_NODELEFTCNT = 19 +const CPX_MULTIOBJ_OBJVAL = 14 +const CPX_MULTIOBJ_PEXCH = 11 +const CPX_MULTIOBJ_PHASE1CNT = 9 +const CPX_MULTIOBJ_PPUSH = 10 +const CPX_MULTIOBJ_PRIORITY = 17 +const CPX_MULTIOBJ_SIFTITCNT = 5 +const CPX_MULTIOBJ_SIFTPHASE1CNT = 6 +const CPX_MULTIOBJ_STATUS = 1 +const CPX_MULTIOBJ_TIME = 2 +const CPX_NO_ABSTOL_CHANGE = NaN +const CPX_NO_OFFSET_CHANGE = NaN +const CPX_NO_PRIORITY_CHANGE = -1 +const CPX_NO_RELTOL_CHANGE = NaN +const CPX_NO_WEIGHT_CHANGE = NaN +const CPX_OBJ_GAP = 40 +const CPX_PRIMAL_OBJ = 42 +const CPX_RELAXATION_FLAG_NOSOLVE = 0x0001 +const CPX_SOLNPOOL_DIV = 2 +const CPX_SOLNPOOL_FIFO = 0 +const CPX_SOLNPOOL_FILTER_DIVERSITY = 1 +const CPX_SOLNPOOL_FILTER_RANGE = 2 +const CPX_SOLNPOOL_OBJ = 1 +const CPX_STAT_ABORT_DETTIME_LIM = 25 +const CPX_STAT_ABORT_DUAL_OBJ_LIM = 22 +const CPX_STAT_ABORT_IT_LIM = 10 +const CPX_STAT_ABORT_OBJ_LIM = 12 +const CPX_STAT_ABORT_PRIM_OBJ_LIM = 21 +const CPX_STAT_ABORT_TIME_LIM = 11 +const CPX_STAT_ABORT_USER = 13 +const CPX_STAT_BENDERS_NUM_BEST = 41 +const CPX_STAT_CONFLICT_ABORT_CONTRADICTION = 32 +const CPX_STAT_CONFLICT_ABORT_DETTIME_LIM = 39 +const CPX_STAT_CONFLICT_ABORT_IT_LIM = 34 +const CPX_STAT_CONFLICT_ABORT_MEM_LIM = 37 +const CPX_STAT_CONFLICT_ABORT_NODE_LIM = 35 +const CPX_STAT_CONFLICT_ABORT_OBJ_LIM = 36 +const CPX_STAT_CONFLICT_ABORT_TIME_LIM = 33 +const CPX_STAT_CONFLICT_ABORT_USER = 38 +const CPX_STAT_CONFLICT_FEASIBLE = 30 +const CPX_STAT_CONFLICT_MINIMAL = 31 +const CPX_STAT_FEASIBLE = 23 +const CPX_STAT_FEASIBLE_RELAXED_INF = 16 +const CPX_STAT_FEASIBLE_RELAXED_QUAD = 18 +const CPX_STAT_FEASIBLE_RELAXED_SUM = 14 +const CPX_STAT_FIRSTORDER = 24 +const CPX_STAT_INFEASIBLE = 3 +const CPX_STAT_INForUNBD = 4 +const CPX_STAT_MULTIOBJ_INFEASIBLE = 302 +const CPX_STAT_MULTIOBJ_INForUNBD = 303 +const CPX_STAT_MULTIOBJ_NON_OPTIMAL = 305 +const CPX_STAT_MULTIOBJ_OPTIMAL = 301 +const CPX_STAT_MULTIOBJ_STOPPED = 306 +const CPX_STAT_MULTIOBJ_UNBOUNDED = 304 +const CPX_STAT_NUM_BEST = 6 +const CPX_STAT_OPTIMAL = 1 +const CPX_STAT_OPTIMAL_FACE_UNBOUNDED = 20 +const CPX_STAT_OPTIMAL_INFEAS = 5 +const CPX_STAT_OPTIMAL_RELAXED_INF = 17 +const CPX_STAT_OPTIMAL_RELAXED_QUAD = 19 +const CPX_STAT_OPTIMAL_RELAXED_SUM = 15 +const CPX_STAT_UNBOUNDED = 2 +const CPX_SUM_COMP_SLACK = 21 +const CPX_SUM_DUAL_INFEAS = 7 +const CPX_SUM_DUAL_RESIDUAL = 17 +const CPX_SUM_INDSLACK_INFEAS = 50 +const CPX_SUM_INT_INFEAS = 10 +const CPX_SUM_PI = 33 +const CPX_SUM_PRIMAL_INFEAS = 3 +const CPX_SUM_PRIMAL_RESIDUAL = 13 +const CPX_SUM_PWLSLACK_INFEAS = 59 +const CPX_SUM_QCPRIMAL_RESIDUAL = 44 +const CPX_SUM_QCSLACK = 48 +const CPX_SUM_QCSLACK_INFEAS = 46 +const CPX_SUM_RED_COST = 37 +const CPX_SUM_SCALED_DUAL_INFEAS = 8 +const CPX_SUM_SCALED_DUAL_RESIDUAL = 18 +const CPX_SUM_SCALED_PI = 34 +const CPX_SUM_SCALED_PRIMAL_INFEAS = 4 +const CPX_SUM_SCALED_PRIMAL_RESIDUAL = 14 +const CPX_SUM_SCALED_RED_COST = 38 +const CPX_SUM_SCALED_SLACK = 36 +const CPX_SUM_SCALED_X = 32 +const CPX_SUM_SLACK = 35 +const CPX_SUM_X = 31 +const CPXERR_ABORT_STRONGBRANCH = 1263 +const CPXERR_ADJ_SIGN_QUAD = 1606 +const CPXERR_ADJ_SIGN_SENSE = 1604 +const CPXERR_ADJ_SIGNS = 1602 +const CPXERR_ARC_INDEX_RANGE = 1231 +const CPXERR_ARRAY_BAD_SOS_TYPE = 3009 +const CPXERR_ARRAY_NOT_ASCENDING = 1226 +const CPXERR_ARRAY_TOO_LONG = 1208 +const CPXERR_BAD_ARGUMENT = 1003 +const CPXERR_BAD_BOUND_SENSE = 1622 +const CPXERR_BAD_BOUND_TYPE = 1457 +const CPXERR_BAD_CHAR = 1537 +const CPXERR_BAD_CTYPE = 3021 +const CPXERR_BAD_DECOMPOSITION = 2002 +const CPXERR_BAD_DIRECTION = 3012 +const CPXERR_BAD_EXPO_RANGE = 1435 +const CPXERR_BAD_EXPONENT = 1618 +const CPXERR_BAD_FILETYPE = 1424 +const CPXERR_BAD_ID = 1617 +const CPXERR_BAD_INDCONSTR = 1439 +const CPXERR_BAD_INDICATOR = 1551 +const CPXERR_BAD_INDTYPE = 1216 +const CPXERR_BAD_LAZY_UCUT = 1438 +const CPXERR_BAD_LUB = 1229 +const CPXERR_BAD_METHOD = 1292 +const CPXERR_BAD_MULTIOBJ_ATTR = 1488 +const CPXERR_BAD_NUMBER = 1434 +const CPXERR_BAD_OBJ_SENSE = 1487 +const CPXERR_BAD_PARAM_NAME = 1028 +const CPXERR_BAD_PARAM_NUM = 1013 +const CPXERR_BAD_PIVOT = 1267 +const CPXERR_BAD_PRIORITY = 3006 +const CPXERR_BAD_PROB_TYPE = 1022 +const CPXERR_BAD_ROW_ID = 1532 +const CPXERR_BAD_SECTION_BOUNDS = 1473 +const CPXERR_BAD_SECTION_ENDATA = 1462 +const CPXERR_BAD_SECTION_QMATRIX = 1475 +const CPXERR_BAD_SENSE = 1215 +const CPXERR_BAD_SOS_TYPE = 1442 +const CPXERR_BAD_STATUS = 1253 +const CPXERR_BAS_FILE_SHORT = 1550 +const CPXERR_BAS_FILE_SIZE = 1555 +const CPXERR_BENDERS_MASTER_SOLVE = 2001 +const CPXERR_CALLBACK = 1006 +const CPXERR_CALLBACK_INCONSISTENT = 1060 +const CPXERR_CAND_NOT_POINT = 3025 +const CPXERR_CAND_NOT_RAY = 3026 +const CPXERR_CNTRL_IN_NAME = 1236 +const CPXERR_COL_INDEX_RANGE = 1201 +const CPXERR_COL_REPEAT_PRINT = 1478 +const CPXERR_COL_REPEATS = 1446 +const CPXERR_COL_ROW_REPEATS = 1443 +const CPXERR_COL_UNKNOWN = 1449 +const CPXERR_CONFLICT_UNSTABLE = 1720 +const CPXERR_COUNT_OVERLAP = 1228 +const CPXERR_COUNT_RANGE = 1227 +const CPXERR_CPUBINDING_FAILURE = 3700 +const CPXERR_DBL_MAX = 1233 +const CPXERR_DECOMPRESSION = 1027 +const CPXERR_DETTILIM_STRONGBRANCH = 1270 +const CPXERR_DUP_ENTRY = 1222 +const CPXERR_DYNFUNC = 1815 +const CPXERR_DYNLOAD = 1814 +const CPXERR_ENCODING_CONVERSION = 1235 +const CPXERR_EXTRA_BV_BOUND = 1456 +const CPXERR_EXTRA_FR_BOUND = 1455 +const CPXERR_EXTRA_FX_BOUND = 1454 +const CPXERR_EXTRA_INTEND = 1481 +const CPXERR_EXTRA_INTORG = 1480 +const CPXERR_EXTRA_SOSEND = 1483 +const CPXERR_EXTRA_SOSORG = 1482 +const CPXERR_FAIL_OPEN_READ = 1423 +const CPXERR_FAIL_OPEN_WRITE = 1422 +const CPXERR_FILE_ENTRIES = 1553 +const CPXERR_FILE_FORMAT = 1563 +const CPXERR_FILE_IO = 1426 +const CPXERR_FILTER_VARIABLE_TYPE = 3414 +const CPXERR_ILL_DEFINED_PWL = 1213 +const CPXERR_IN_INFOCALLBACK = 1804 +const CPXERR_INDEX_NOT_BASIC = 1251 +const CPXERR_INDEX_RANGE = 1200 +const CPXERR_INDEX_RANGE_HIGH = 1206 +const CPXERR_INDEX_RANGE_LOW = 1205 +const CPXERR_INT_TOO_BIG = 3018 +const CPXERR_INT_TOO_BIG_INPUT = 1463 +const CPXERR_INVALID_NUMBER = 1650 +const CPXERR_LIMITS_TOO_BIG = 1012 +const CPXERR_LINE_TOO_LONG = 1465 +const CPXERR_LO_BOUND_REPEATS = 1459 +const CPXERR_LOCK_CREATE = 1808 +const CPXERR_LP_NOT_IN_ENVIRONMENT = 1806 +const CPXERR_LP_PARSE = 1427 +const CPXERR_MASTER_SOLVE = 2005 +const CPXERR_MIPSEARCH_WITH_CALLBACKS = 1805 +const CPXERR_MISS_SOS_TYPE = 3301 +const CPXERR_MSG_NO_CHANNEL = 1051 +const CPXERR_MSG_NO_FILEPTR = 1052 +const CPXERR_MSG_NO_FUNCTION = 1053 +const CPXERR_MULTIOBJ_SUBPROB_SOLVE = 1300 +const CPXERR_MULTIPLE_PROBS_IN_REMOTE_ENVIRONMENT = 1816 +const CPXERR_NAME_CREATION = 1209 +const CPXERR_NAME_NOT_FOUND = 1210 +const CPXERR_NAME_TOO_LONG = 1464 +const CPXERR_NAN = 1225 +const CPXERR_NEED_OPT_SOLN = 1252 +const CPXERR_NEGATIVE_SURPLUS = 1207 +const CPXERR_NET_DATA = 1530 +const CPXERR_NET_FILE_SHORT = 1538 +const CPXERR_NO_BARRIER_SOLN = 1223 +const CPXERR_NO_BASIC_SOLN = 1261 +const CPXERR_NO_BASIS = 1262 +const CPXERR_NO_BOUND_SENSE = 1621 +const CPXERR_NO_BOUND_TYPE = 1460 +const CPXERR_NO_COLUMNS_SECTION = 1472 +const CPXERR_NO_CONFLICT = 1719 +const CPXERR_NO_DECOMPOSITION = 2000 +const CPXERR_NO_DUAL_SOLN = 1232 +const CPXERR_NO_ENDATA = 1552 +const CPXERR_NO_ENVIRONMENT = 1002 +const CPXERR_NO_FILENAME = 1421 +const CPXERR_NO_ID = 1616 +const CPXERR_NO_ID_FIRST = 1609 +const CPXERR_NO_INT_X = 3023 +const CPXERR_NO_KAPPASTATS = 1269 +const CPXERR_NO_LU_FACTOR = 1258 +const CPXERR_NO_MEMORY = 1001 +const CPXERR_NO_MIPSTART = 3020 +const CPXERR_NO_NAME_SECTION = 1441 +const CPXERR_NO_NAMES = 1219 +const CPXERR_NO_NORMS = 1264 +const CPXERR_NO_NUMBER = 1615 +const CPXERR_NO_NUMBER_BOUND = 1623 +const CPXERR_NO_NUMBER_FIRST = 1611 +const CPXERR_NO_OBJ_NAME = 1489 +const CPXERR_NO_OBJ_SENSE = 1436 +const CPXERR_NO_OBJECTIVE = 1476 +const CPXERR_NO_OP_OR_SENSE = 1608 +const CPXERR_NO_OPERATOR = 1607 +const CPXERR_NO_ORDER = 3016 +const CPXERR_NO_PROBLEM = 1009 +const CPXERR_NO_QP_OPERATOR = 1614 +const CPXERR_NO_QUAD_EXP = 1612 +const CPXERR_NO_RHS_COEFF = 1610 +const CPXERR_NO_RHS_IN_OBJ = 1211 +const CPXERR_NO_ROW_NAME = 1486 +const CPXERR_NO_ROW_SENSE = 1453 +const CPXERR_NO_ROWS_SECTION = 1471 +const CPXERR_NO_SENSIT = 1260 +const CPXERR_NO_SOLN = 1217 +const CPXERR_NO_SOLNPOOL = 3024 +const CPXERR_NO_SOS = 3015 +const CPXERR_NO_TREE = 3412 +const CPXERR_NO_VECTOR_SOLN = 1556 +const CPXERR_NODE_INDEX_RANGE = 1230 +const CPXERR_NODE_ON_DISK = 3504 +const CPXERR_NOT_DUAL_UNBOUNDED = 1265 +const CPXERR_NOT_FIXED = 1221 +const CPXERR_NOT_FOR_BENDERS = 2004 +const CPXERR_NOT_FOR_DISTMIP = 1071 +const CPXERR_NOT_FOR_MIP = 1017 +const CPXERR_NOT_FOR_MULTIOBJ = 1070 +const CPXERR_NOT_FOR_QCP = 1031 +const CPXERR_NOT_FOR_QP = 1018 +const CPXERR_NOT_MILPCLASS = 1024 +const CPXERR_NOT_MIN_COST_FLOW = 1531 +const CPXERR_NOT_MIP = 3003 +const CPXERR_NOT_MIQPCLASS = 1029 +const CPXERR_NOT_ONE_PROBLEM = 1023 +const CPXERR_NOT_QP = 5004 +const CPXERR_NOT_SAV_FILE = 1560 +const CPXERR_NOT_UNBOUNDED = 1254 +const CPXERR_NULL_POINTER = 1004 +const CPXERR_ORDER_BAD_DIRECTION = 3007 +const CPXERR_OVERFLOW = 1810 +const CPXERR_PARAM_INCOMPATIBLE = 1807 +const CPXERR_PARAM_TOO_BIG = 1015 +const CPXERR_PARAM_TOO_SMALL = 1014 +const CPXERR_PRESLV_ABORT = 1106 +const CPXERR_PRESLV_BAD_PARAM = 1122 +const CPXERR_PRESLV_BASIS_MEM = 1107 +const CPXERR_PRESLV_COPYORDER = 1109 +const CPXERR_PRESLV_COPYSOS = 1108 +const CPXERR_PRESLV_CRUSHFORM = 1121 +const CPXERR_PRESLV_DETTIME_LIM = 1124 +const CPXERR_PRESLV_DUAL = 1119 +const CPXERR_PRESLV_FAIL_BASIS = 1114 +const CPXERR_PRESLV_INF = 1117 +const CPXERR_PRESLV_INForUNBD = 1101 +const CPXERR_PRESLV_NO_BASIS = 1115 +const CPXERR_PRESLV_NO_PROB = 1103 +const CPXERR_PRESLV_SOLN_MIP = 1110 +const CPXERR_PRESLV_SOLN_QP = 1111 +const CPXERR_PRESLV_START_LP = 1112 +const CPXERR_PRESLV_TIME_LIM = 1123 +const CPXERR_PRESLV_UNBD = 1118 +const CPXERR_PRESLV_UNCRUSHFORM = 1120 +const CPXERR_PRIIND = 1257 +const CPXERR_PRM_DATA = 1660 +const CPXERR_PROTOCOL = 1812 +const CPXERR_Q_DIVISOR = 1619 +const CPXERR_Q_DUP_ENTRY = 5011 +const CPXERR_Q_NOT_INDEF = 5014 +const CPXERR_Q_NOT_POS_DEF = 5002 +const CPXERR_Q_NOT_SYMMETRIC = 5012 +const CPXERR_QCP_SENSE = 6002 +const CPXERR_QCP_SENSE_FILE = 1437 +const CPXERR_QUAD_EXP_NOT_2 = 1613 +const CPXERR_QUAD_IN_ROW = 1605 +const CPXERR_RANGE_SECTION_ORDER = 1474 +const CPXERR_RESTRICTED_VERSION = 1016 +const CPXERR_RHS_IN_OBJ = 1603 +const CPXERR_RIM_REPEATS = 1447 +const CPXERR_RIM_ROW_REPEATS = 1444 +const CPXERR_RIMNZ_REPEATS = 1479 +const CPXERR_ROW_INDEX_RANGE = 1203 +const CPXERR_ROW_REPEAT_PRINT = 1477 +const CPXERR_ROW_REPEATS = 1445 +const CPXERR_ROW_UNKNOWN = 1448 +const CPXERR_SAV_FILE_DATA = 1561 +const CPXERR_SAV_FILE_VALUE = 1564 +const CPXERR_SAV_FILE_WRITE = 1562 +const CPXERR_SBASE_ILLEGAL = 1554 +const CPXERR_SBASE_INCOMPAT = 1255 +const CPXERR_SINGULAR = 1256 +const CPXERR_STR_PARAM_TOO_LONG = 1026 +const CPXERR_SUBPROB_SOLVE = 3019 +const CPXERR_SYNCPRIM_CREATE = 1809 +const CPXERR_SYSCALL = 1813 +const CPXERR_THREAD_FAILED = 1234 +const CPXERR_TILIM_CONDITION_NO = 1268 +const CPXERR_TILIM_STRONGBRANCH = 1266 +const CPXERR_TOO_MANY_COEFFS = 1433 +const CPXERR_TOO_MANY_COLS = 1432 +const CPXERR_TOO_MANY_RIMNZ = 1485 +const CPXERR_TOO_MANY_RIMS = 1484 +const CPXERR_TOO_MANY_ROWS = 1431 +const CPXERR_TOO_MANY_THREADS = 1020 +const CPXERR_TREE_MEMORY_LIMIT = 3413 +const CPXERR_TUNE_MIXED = 1730 +const CPXERR_UNIQUE_WEIGHTS = 3010 +const CPXERR_UNSUPPORTED_CONSTRAINT_TYPE = 1212 +const CPXERR_UNSUPPORTED_OPERATION = 1811 +const CPXERR_UP_BOUND_REPEATS = 1458 +const CPXERR_WORK_FILE_OPEN = 1801 +const CPXERR_WORK_FILE_READ = 1802 +const CPXERR_WORK_FILE_WRITE = 1803 +const CPXERR_XMLPARSE = 1425 +const CPXMESSAGEBUFSIZE = 1024 +const CPXMI_BIGM_COEF = 1040 +const CPXMI_BIGM_TO_IND = 1041 +const CPXMI_BIGM_VARBOUND = 1042 +const CPXMI_CANCEL_TOL = 1045 +const CPXMI_EPGAP_LARGE = 1038 +const CPXMI_EPGAP_OBJOFFSET = 1037 +const CPXMI_FEAS_TOL = 1043 +const CPXMI_FRACTION_SCALING = 1047 +const CPXMI_IND_NZ_LARGE_NUM = 1019 +const CPXMI_IND_NZ_SMALL_NUM = 1020 +const CPXMI_IND_RHS_LARGE_NUM = 1021 +const CPXMI_IND_RHS_SMALL_NUM = 1022 +const CPXMI_KAPPA_ILLPOSED = 1035 +const CPXMI_KAPPA_SUSPICIOUS = 1033 +const CPXMI_KAPPA_UNSTABLE = 1034 +const CPXMI_LB_LARGE_NUM = 1003 +const CPXMI_LB_SMALL_NUM = 1004 +const CPXMI_LC_NZ_LARGE_NUM = 1023 +const CPXMI_LC_NZ_SMALL_NUM = 1024 +const CPXMI_LC_RHS_LARGE_NUM = 1025 +const CPXMI_LC_RHS_SMALL_NUM = 1026 +const CPXMI_MULTIOBJ_COEFFS = 1062 +const CPXMI_MULTIOBJ_LARGE_NUM = 1058 +const CPXMI_MULTIOBJ_MIX = 1063 +const CPXMI_MULTIOBJ_OPT_TOL = 1060 +const CPXMI_MULTIOBJ_SMALL_NUM = 1059 +const CPXMI_NZ_LARGE_NUM = 1009 +const CPXMI_NZ_SMALL_NUM = 1010 +const CPXMI_OBJ_LARGE_NUM = 1001 +const CPXMI_OBJ_SMALL_NUM = 1002 +const CPXMI_OPT_TOL = 1044 +const CPXMI_QC_LINNZ_LARGE_NUM = 1015 +const CPXMI_QC_LINNZ_SMALL_NUM = 1016 +const CPXMI_QC_QNZ_LARGE_NUM = 1017 +const CPXMI_QC_QNZ_SMALL_NUM = 1018 +const CPXMI_QC_RHS_LARGE_NUM = 1013 +const CPXMI_QC_RHS_SMALL_NUM = 1014 +const CPXMI_QOBJ_LARGE_NUM = 1011 +const CPXMI_QOBJ_SMALL_NUM = 1012 +const CPXMI_QOPT_TOL = 1046 +const CPXMI_RHS_LARGE_NUM = 1007 +const CPXMI_RHS_SMALL_NUM = 1008 +const CPXMI_SAMECOEFF_COL = 1050 +const CPXMI_SAMECOEFF_IND = 1051 +const CPXMI_SAMECOEFF_LAZY = 1054 +const CPXMI_SAMECOEFF_MULTIOBJ = 1061 +const CPXMI_SAMECOEFF_OBJ = 1057 +const CPXMI_SAMECOEFF_QLIN = 1052 +const CPXMI_SAMECOEFF_QUAD = 1053 +const CPXMI_SAMECOEFF_RHS = 1056 +const CPXMI_SAMECOEFF_ROW = 1049 +const CPXMI_SAMECOEFF_UCUT = 1055 +const CPXMI_SINGLE_PRECISION = 1036 +const CPXMI_SYMMETRY_BREAKING_INEQ = 1039 +const CPXMI_UB_LARGE_NUM = 1005 +const CPXMI_UB_SMALL_NUM = 1006 +const CPXMI_UC_NZ_LARGE_NUM = 1027 +const CPXMI_UC_NZ_SMALL_NUM = 1028 +const CPXMI_UC_RHS_LARGE_NUM = 1029 +const CPXMI_UC_RHS_SMALL_NUM = 1030 +const CPXMI_WIDE_COEFF_RANGE = 1048 +const CPXMIP_ABORT_FEAS = 113 +const CPXMIP_ABORT_INFEAS = 114 +const CPXMIP_ABORT_RELAXATION_UNBOUNDED = 133 +const CPXMIP_ABORT_RELAXED = 126 +const CPXMIP_DETTIME_LIM_FEAS = 131 +const CPXMIP_DETTIME_LIM_INFEAS = 132 +const CPXMIP_FAIL_FEAS = 109 +const CPXMIP_FAIL_FEAS_NO_TREE = 116 +const CPXMIP_FAIL_INFEAS = 110 +const CPXMIP_FAIL_INFEAS_NO_TREE = 117 +const CPXMIP_FEASIBLE = 127 +const CPXMIP_FEASIBLE_RELAXED_INF = 122 +const CPXMIP_FEASIBLE_RELAXED_QUAD = 124 +const CPXMIP_FEASIBLE_RELAXED_SUM = 120 +const CPXMIP_INFEASIBLE = 103 +const CPXMIP_INForUNBD = 119 +const CPXMIP_MEM_LIM_FEAS = 111 +const CPXMIP_MEM_LIM_INFEAS = 112 +const CPXMIP_NODE_LIM_FEAS = 105 +const CPXMIP_NODE_LIM_INFEAS = 106 +const CPXMIP_OPTIMAL = 101 +const CPXMIP_OPTIMAL_INFEAS = 115 +const CPXMIP_OPTIMAL_POPULATED = 129 +const CPXMIP_OPTIMAL_POPULATED_TOL = 130 +const CPXMIP_OPTIMAL_RELAXED_INF = 123 +const CPXMIP_OPTIMAL_RELAXED_QUAD = 125 +const CPXMIP_OPTIMAL_RELAXED_SUM = 121 +const CPXMIP_OPTIMAL_TOL = 102 +const CPXMIP_POPULATESOL_LIM = 128 +const CPXMIP_SOL_LIM = 104 +const CPXMIP_TIME_LIM_FEAS = 107 +const CPXMIP_TIME_LIM_INFEAS = 108 +const CPXMIP_UNBOUNDED = 118 +const CPX_CPXAUTOENUMS_H_H = 1 +const CPXPARAM_H = 1 +const CPXPARAM_Advance = 1001 +const CPXPARAM_Barrier_Algorithm = 3007 +const CPXPARAM_Barrier_ColNonzeros = 3009 +const CPXPARAM_Barrier_ConvergeTol = 3002 +const CPXPARAM_Barrier_Crossover = 3018 +const CPXPARAM_Barrier_Display = 3010 +const CPXPARAM_Barrier_Limits_Corrections = 3013 +const CPXPARAM_Barrier_Limits_Growth = 3003 +const CPXPARAM_Barrier_Limits_Iteration = 3012 +const CPXPARAM_Barrier_Limits_ObjRange = 3004 +const CPXPARAM_Barrier_Ordering = 3014 +const CPXPARAM_Barrier_QCPConvergeTol = 3020 +const CPXPARAM_Barrier_StartAlg = 3017 +const CPXPARAM_Benders_Strategy = 1501 +const CPXPARAM_Benders_Tolerances_feasibilitycut = 1509 +const CPXPARAM_Benders_Tolerances_optimalitycut = 1510 +const CPXPARAM_Benders_WorkerAlgorithm = 1500 +const CPXPARAM_ClockType = 1006 +const CPXPARAM_Conflict_Algorithm = 1073 +const CPXPARAM_Conflict_Display = 1074 +const CPXPARAM_CPUmask = 1144 +const CPXPARAM_DetTimeLimit = 1127 +const CPXPARAM_DistMIP_Rampup_DetTimeLimit = 2164 +const CPXPARAM_DistMIP_Rampup_Duration = 2163 +const CPXPARAM_DistMIP_Rampup_TimeLimit = 2165 +const CPXPARAM_Emphasis_Memory = 1082 +const CPXPARAM_Emphasis_MIP = 2058 +const CPXPARAM_Emphasis_Numerical = 1083 +const CPXPARAM_Feasopt_Mode = 1084 +const CPXPARAM_Feasopt_Tolerance = 2073 +const CPXPARAM_LPMethod = 1062 +const CPXPARAM_MIP_Cuts_BQP = 2195 +const CPXPARAM_MIP_Cuts_Cliques = 2003 +const CPXPARAM_MIP_Cuts_Covers = 2005 +const CPXPARAM_MIP_Cuts_Disjunctive = 2053 +const CPXPARAM_MIP_Cuts_FlowCovers = 2040 +const CPXPARAM_MIP_Cuts_Gomory = 2049 +const CPXPARAM_MIP_Cuts_GUBCovers = 2044 +const CPXPARAM_MIP_Cuts_Implied = 2041 +const CPXPARAM_MIP_Cuts_LiftProj = 2152 +const CPXPARAM_MIP_Cuts_LocalImplied = 2181 +const CPXPARAM_MIP_Cuts_MCFCut = 2134 +const CPXPARAM_MIP_Cuts_MIRCut = 2052 +const CPXPARAM_MIP_Cuts_PathCut = 2051 +const CPXPARAM_MIP_Cuts_RLT = 2196 +const CPXPARAM_MIP_Cuts_ZeroHalfCut = 2111 +const CPXPARAM_MIP_Display = 2012 +const CPXPARAM_MIP_Interval = 2013 +const CPXPARAM_MIP_Limits_AggForCut = 2054 +const CPXPARAM_MIP_Limits_AuxRootThreads = 2139 +const CPXPARAM_MIP_Limits_CutPasses = 2056 +const CPXPARAM_MIP_Limits_CutsFactor = 2033 +const CPXPARAM_MIP_Limits_EachCutLimit = 2102 +const CPXPARAM_MIP_Limits_GomoryCand = 2048 +const CPXPARAM_MIP_Limits_GomoryPass = 2050 +const CPXPARAM_MIP_Limits_Nodes = 2017 +const CPXPARAM_MIP_Limits_PolishTime = 2066 +const CPXPARAM_MIP_Limits_Populate = 2108 +const CPXPARAM_MIP_Limits_ProbeDetTime = 2150 +const CPXPARAM_MIP_Limits_ProbeTime = 2065 +const CPXPARAM_MIP_Limits_RepairTries = 2067 +const CPXPARAM_MIP_Limits_Solutions = 2015 +const CPXPARAM_MIP_Limits_StrongCand = 2045 +const CPXPARAM_MIP_Limits_StrongIt = 2046 +const CPXPARAM_MIP_Limits_TreeMemory = 2027 +const CPXPARAM_MIP_OrderType = 2032 +const CPXPARAM_MIP_PolishAfter_AbsMIPGap = 2126 +const CPXPARAM_MIP_PolishAfter_DetTime = 2151 +const CPXPARAM_MIP_PolishAfter_MIPGap = 2127 +const CPXPARAM_MIP_PolishAfter_Nodes = 2128 +const CPXPARAM_MIP_PolishAfter_Solutions = 2129 +const CPXPARAM_MIP_PolishAfter_Time = 2130 +const CPXPARAM_MIP_Pool_AbsGap = 2106 +const CPXPARAM_MIP_Pool_Capacity = 2103 +const CPXPARAM_MIP_Pool_Intensity = 2107 +const CPXPARAM_MIP_Pool_RelGap = 2105 +const CPXPARAM_MIP_Pool_Replace = 2104 +const CPXPARAM_MIP_Strategy_Backtrack = 2002 +const CPXPARAM_MIP_Strategy_BBInterval = 2039 +const CPXPARAM_MIP_Strategy_Branch = 2001 +const CPXPARAM_MIP_Strategy_CallbackReducedLP = 2055 +const CPXPARAM_MIP_Strategy_Dive = 2060 +const CPXPARAM_MIP_Strategy_File = 2016 +const CPXPARAM_MIP_Strategy_FPHeur = 2098 +const CPXPARAM_MIP_Strategy_HeuristicEffort = 2120 +const CPXPARAM_MIP_Strategy_HeuristicFreq = 2031 +const CPXPARAM_MIP_Strategy_KappaStats = 2137 +const CPXPARAM_MIP_Strategy_LBHeur = 2063 +const CPXPARAM_MIP_Strategy_MIQCPStrat = 2110 +const CPXPARAM_MIP_Strategy_NodeSelect = 2018 +const CPXPARAM_MIP_Strategy_Order = 2020 +const CPXPARAM_MIP_Strategy_PresolveNode = 2037 +const CPXPARAM_MIP_Strategy_Probe = 2042 +const CPXPARAM_MIP_Strategy_RINSHeur = 2061 +const CPXPARAM_MIP_Strategy_Search = 2109 +const CPXPARAM_MIP_Strategy_StartAlgorithm = 2025 +const CPXPARAM_MIP_Strategy_SubAlgorithm = 2026 +const CPXPARAM_MIP_Strategy_VariableSelect = 2028 +const CPXPARAM_MIP_SubMIP_StartAlg = 2205 +const CPXPARAM_MIP_SubMIP_SubAlg = 2206 +const CPXPARAM_MIP_SubMIP_NodeLimit = 2212 +const CPXPARAM_MIP_SubMIP_Scale = 2207 +const CPXPARAM_MIP_Tolerances_AbsMIPGap = 2008 +const CPXPARAM_MIP_Tolerances_Linearization = 2068 +const CPXPARAM_MIP_Tolerances_Integrality = 2010 +const CPXPARAM_MIP_Tolerances_LowerCutoff = 2006 +const CPXPARAM_MIP_Tolerances_MIPGap = 2009 +const CPXPARAM_MIP_Tolerances_ObjDifference = 2019 +const CPXPARAM_MIP_Tolerances_RelObjDifference = 2022 +const CPXPARAM_MIP_Tolerances_UpperCutoff = 2007 +const CPXPARAM_MultiObjective_Display = 1600 +const CPXPARAM_Network_Display = 5005 +const CPXPARAM_Network_Iterations = 5001 +const CPXPARAM_Network_NetFind = 1022 +const CPXPARAM_Network_Pricing = 5004 +const CPXPARAM_Network_Tolerances_Feasibility = 5003 +const CPXPARAM_Network_Tolerances_Optimality = 5002 +const CPXPARAM_OptimalityTarget = 1131 +const CPXPARAM_Output_CloneLog = 1132 +const CPXPARAM_Output_IntSolFilePrefix = 2143 +const CPXPARAM_Output_MPSLong = 1081 +const CPXPARAM_Output_WriteLevel = 1114 +const CPXPARAM_Parallel = 1109 +const CPXPARAM_ParamDisplay = 1163 +const CPXPARAM_Preprocessing_Aggregator = 1003 +const CPXPARAM_Preprocessing_BoundStrength = 2029 +const CPXPARAM_Preprocessing_CoeffReduce = 2004 +const CPXPARAM_Preprocessing_Dependency = 1008 +const CPXPARAM_Preprocessing_Dual = 1044 +const CPXPARAM_Preprocessing_Fill = 1002 +const CPXPARAM_Preprocessing_Folding = 1164 +const CPXPARAM_Preprocessing_Linear = 1058 +const CPXPARAM_Preprocessing_NumPass = 1052 +const CPXPARAM_Preprocessing_Presolve = 1030 +const CPXPARAM_Preprocessing_QCPDuals = 4003 +const CPXPARAM_Preprocessing_QPMakePSD = 4010 +const CPXPARAM_Preprocessing_QToLin = 4012 +const CPXPARAM_Preprocessing_Reduce = 1057 +const CPXPARAM_Preprocessing_Relax = 2034 +const CPXPARAM_Preprocessing_RepeatPresolve = 2064 +const CPXPARAM_Preprocessing_Symmetry = 2059 +const CPXPARAM_QPMethod = 1063 +const CPXPARAM_RandomSeed = 1124 +const CPXPARAM_Read_APIEncoding = 1130 +const CPXPARAM_Read_Constraints = 1021 +const CPXPARAM_Read_DataCheck = 1056 +const CPXPARAM_Read_FileEncoding = 1129 +const CPXPARAM_Read_Nonzeros = 1024 +const CPXPARAM_Read_QPNonzeros = 4001 +const CPXPARAM_Read_Scale = 1034 +const CPXPARAM_Read_Variables = 1023 +const CPXPARAM_Read_WarningLimit = 1157 +const CPXPARAM_Record = 1162 +const CPXPARAM_ScreenOutput = 1035 +const CPXPARAM_Sifting_Algorithm = 1077 +const CPXPARAM_Sifting_Simplex = 1158 +const CPXPARAM_Sifting_Display = 1076 +const CPXPARAM_Sifting_Iterations = 1078 +const CPXPARAM_Simplex_Crash = 1007 +const CPXPARAM_Simplex_DGradient = 1009 +const CPXPARAM_Simplex_Display = 1019 +const CPXPARAM_Simplex_DynamicRows = 1161 +const CPXPARAM_Simplex_Limits_Iterations = 1020 +const CPXPARAM_Simplex_Limits_LowerObj = 1025 +const CPXPARAM_Simplex_Limits_Perturbation = 1028 +const CPXPARAM_Simplex_Limits_Singularity = 1037 +const CPXPARAM_Simplex_Limits_UpperObj = 1026 +const CPXPARAM_Simplex_Perturbation_Constant = 1015 +const CPXPARAM_Simplex_Perturbation_Indicator = 1027 +const CPXPARAM_Simplex_PGradient = 1029 +const CPXPARAM_Simplex_Pricing = 1010 +const CPXPARAM_Simplex_Refactor = 1031 +const CPXPARAM_Simplex_Tolerances_Feasibility = 1016 +const CPXPARAM_Simplex_Tolerances_Markowitz = 1013 +const CPXPARAM_Simplex_Tolerances_Optimality = 1014 +const CPXPARAM_SolutionType = 1147 +const CPXPARAM_Threads = 1067 +const CPXPARAM_TimeLimit = 1039 +const CPXPARAM_Tune_DetTimeLimit = 1139 +const CPXPARAM_Tune_Display = 1113 +const CPXPARAM_Tune_Measure = 1110 +const CPXPARAM_Tune_Repeat = 1111 +const CPXPARAM_Tune_TimeLimit = 1112 +const CPXPARAM_WorkDir = 1064 +const CPXPARAM_WorkMem = 1065 +const CPXPUBLICPARAMS_H = 1 +const CPX_PARAM_ADVIND = 1001 +const CPX_PARAM_AGGFILL = 1002 +const CPX_PARAM_AGGIND = 1003 +const CPX_PARAM_CLOCKTYPE = 1006 +const CPX_PARAM_CRAIND = 1007 +const CPX_PARAM_DEPIND = 1008 +const CPX_PARAM_DPRIIND = 1009 +const CPX_PARAM_PRICELIM = 1010 +const CPX_PARAM_EPMRK = 1013 +const CPX_PARAM_EPOPT = 1014 +const CPX_PARAM_EPPER = 1015 +const CPX_PARAM_EPRHS = 1016 +const CPX_PARAM_SIMDISPLAY = 1019 +const CPX_PARAM_ITLIM = 1020 +const CPX_PARAM_ROWREADLIM = 1021 +const CPX_PARAM_NETFIND = 1022 +const CPX_PARAM_COLREADLIM = 1023 +const CPX_PARAM_NZREADLIM = 1024 +const CPX_PARAM_OBJLLIM = 1025 +const CPX_PARAM_OBJULIM = 1026 +const CPX_PARAM_PERIND = 1027 +const CPX_PARAM_PERLIM = 1028 +const CPX_PARAM_PPRIIND = 1029 +const CPX_PARAM_PREIND = 1030 +const CPX_PARAM_REINV = 1031 +const CPX_PARAM_SCAIND = 1034 +const CPX_PARAM_SCRIND = 1035 +const CPX_PARAM_SINGLIM = 1037 +const CPX_PARAM_TILIM = 1039 +const CPX_PARAM_PREDUAL = 1044 +const CPX_PARAM_PREPASS = 1052 +const CPX_PARAM_DATACHECK = 1056 +const CPX_PARAM_REDUCE = 1057 +const CPX_PARAM_PRELINEAR = 1058 +const CPX_PARAM_LPMETHOD = 1062 +const CPX_PARAM_QPMETHOD = 1063 +const CPX_PARAM_WORKDIR = 1064 +const CPX_PARAM_WORKMEM = 1065 +const CPX_PARAM_THREADS = 1067 +const CPX_PARAM_CONFLICTALG = 1073 +const CPX_PARAM_CONFLICTDISPLAY = 1074 +const CPX_PARAM_SIFTDISPLAY = 1076 +const CPX_PARAM_SIFTALG = 1077 +const CPX_PARAM_SIFTITLIM = 1078 +const CPX_PARAM_MPSLONGNUM = 1081 +const CPX_PARAM_MEMORYEMPHASIS = 1082 +const CPX_PARAM_NUMERICALEMPHASIS = 1083 +const CPX_PARAM_FEASOPTMODE = 1084 +const CPX_PARAM_PARALLELMODE = 1109 +const CPX_PARAM_TUNINGMEASURE = 1110 +const CPX_PARAM_TUNINGREPEAT = 1111 +const CPX_PARAM_TUNINGTILIM = 1112 +const CPX_PARAM_TUNINGDISPLAY = 1113 +const CPX_PARAM_WRITELEVEL = 1114 +const CPX_PARAM_RANDOMSEED = 1124 +const CPX_PARAM_DETTILIM = 1127 +const CPX_PARAM_FILEENCODING = 1129 +const CPX_PARAM_APIENCODING = 1130 +const CPX_PARAM_OPTIMALITYTARGET = 1131 +const CPX_PARAM_CLONELOG = 1132 +const CPX_PARAM_TUNINGDETTILIM = 1139 +const CPX_PARAM_CPUMASK = 1144 +const CPX_PARAM_SOLUTIONTYPE = 1147 +const CPX_PARAM_WARNLIM = 1157 +const CPX_PARAM_SIFTSIM = 1158 +const CPX_PARAM_DYNAMICROWS = 1161 +const CPX_PARAM_RECORD = 1162 +const CPX_PARAM_PARAMDISPLAY = 1163 +const CPX_PARAM_FOLDING = 1164 +const CPX_PARAM_WORKERALG = 1500 +const CPX_PARAM_BENDERSSTRATEGY = 1501 +const CPX_PARAM_BENDERSFEASCUTTOL = 1509 +const CPX_PARAM_BENDERSOPTCUTTOL = 1510 +const CPX_PARAM_MULTIOBJDISPLAY = 1600 +const CPX_PARAM_BRDIR = 2001 +const CPX_PARAM_BTTOL = 2002 +const CPX_PARAM_CLIQUES = 2003 +const CPX_PARAM_COEREDIND = 2004 +const CPX_PARAM_COVERS = 2005 +const CPX_PARAM_CUTLO = 2006 +const CPX_PARAM_CUTUP = 2007 +const CPX_PARAM_EPAGAP = 2008 +const CPX_PARAM_EPGAP = 2009 +const CPX_PARAM_EPINT = 2010 +const CPX_PARAM_MIPDISPLAY = 2012 +const CPX_PARAM_MIPINTERVAL = 2013 +const CPX_PARAM_INTSOLLIM = 2015 +const CPX_PARAM_NODEFILEIND = 2016 +const CPX_PARAM_NODELIM = 2017 +const CPX_PARAM_NODESEL = 2018 +const CPX_PARAM_OBJDIF = 2019 +const CPX_PARAM_MIPORDIND = 2020 +const CPX_PARAM_RELOBJDIF = 2022 +const CPX_PARAM_STARTALG = 2025 +const CPX_PARAM_SUBALG = 2026 +const CPX_PARAM_TRELIM = 2027 +const CPX_PARAM_VARSEL = 2028 +const CPX_PARAM_BNDSTRENIND = 2029 +const CPX_PARAM_HEURFREQ = 2031 +const CPX_PARAM_MIPORDTYPE = 2032 +const CPX_PARAM_CUTSFACTOR = 2033 +const CPX_PARAM_RELAXPREIND = 2034 +const CPX_PARAM_PRESLVND = 2037 +const CPX_PARAM_BBINTERVAL = 2039 +const CPX_PARAM_FLOWCOVERS = 2040 +const CPX_PARAM_IMPLBD = 2041 +const CPX_PARAM_PROBE = 2042 +const CPX_PARAM_GUBCOVERS = 2044 +const CPX_PARAM_STRONGCANDLIM = 2045 +const CPX_PARAM_STRONGITLIM = 2046 +const CPX_PARAM_FRACCAND = 2048 +const CPX_PARAM_FRACCUTS = 2049 +const CPX_PARAM_FRACPASS = 2050 +const CPX_PARAM_FLOWPATHS = 2051 +const CPX_PARAM_MIRCUTS = 2052 +const CPX_PARAM_DISJCUTS = 2053 +const CPX_PARAM_AGGCUTLIM = 2054 +const CPX_PARAM_MIPCBREDLP = 2055 +const CPX_PARAM_CUTPASS = 2056 +const CPX_PARAM_MIPEMPHASIS = 2058 +const CPX_PARAM_SYMMETRY = 2059 +const CPX_PARAM_DIVETYPE = 2060 +const CPX_PARAM_RINSHEUR = 2061 +const CPX_PARAM_LBHEUR = 2063 +const CPX_PARAM_REPEATPRESOLVE = 2064 +const CPX_PARAM_PROBETIME = 2065 +const CPX_PARAM_POLISHTIME = 2066 +const CPX_PARAM_REPAIRTRIES = 2067 +const CPX_PARAM_EPLIN = 2068 +const CPX_PARAM_EPRELAX = 2073 +const CPX_PARAM_FPHEUR = 2098 +const CPX_PARAM_EACHCUTLIM = 2102 +const CPX_PARAM_SOLNPOOLCAPACITY = 2103 +const CPX_PARAM_SOLNPOOLREPLACE = 2104 +const CPX_PARAM_SOLNPOOLGAP = 2105 +const CPX_PARAM_SOLNPOOLAGAP = 2106 +const CPX_PARAM_SOLNPOOLINTENSITY = 2107 +const CPX_PARAM_POPULATELIM = 2108 +const CPX_PARAM_MIPSEARCH = 2109 +const CPX_PARAM_MIQCPSTRAT = 2110 +const CPX_PARAM_ZEROHALFCUTS = 2111 +const CPX_PARAM_HEUREFFORT = 2120 +const CPX_PARAM_POLISHAFTEREPAGAP = 2126 +const CPX_PARAM_POLISHAFTEREPGAP = 2127 +const CPX_PARAM_POLISHAFTERNODE = 2128 +const CPX_PARAM_POLISHAFTERINTSOL = 2129 +const CPX_PARAM_POLISHAFTERTIME = 2130 +const CPX_PARAM_MCFCUTS = 2134 +const CPX_PARAM_MIPKAPPASTATS = 2137 +const CPX_PARAM_AUXROOTTHREADS = 2139 +const CPX_PARAM_INTSOLFILEPREFIX = 2143 +const CPX_PARAM_PROBEDETTIME = 2150 +const CPX_PARAM_POLISHAFTERDETTIME = 2151 +const CPX_PARAM_LANDPCUTS = 2152 +const CPX_PARAM_RAMPUPDURATION = 2163 +const CPX_PARAM_RAMPUPDETTILIM = 2164 +const CPX_PARAM_RAMPUPTILIM = 2165 +const CPX_PARAM_LOCALIMPLBD = 2181 +const CPX_PARAM_BQPCUTS = 2195 +const CPX_PARAM_RLTCUTS = 2196 +const CPX_PARAM_SUBMIPSTARTALG = 2205 +const CPX_PARAM_SUBMIPSUBALG = 2206 +const CPX_PARAM_SUBMIPSCAIND = 2207 +const CPX_PARAM_SUBMIPNODELIMIT = 2212 +const CPX_PARAM_BAREPCOMP = 3002 +const CPX_PARAM_BARGROWTH = 3003 +const CPX_PARAM_BAROBJRNG = 3004 +const CPX_PARAM_BARALG = 3007 +const CPX_PARAM_BARCOLNZ = 3009 +const CPX_PARAM_BARDISPLAY = 3010 +const CPX_PARAM_BARITLIM = 3012 +const CPX_PARAM_BARMAXCOR = 3013 +const CPX_PARAM_BARORDER = 3014 +const CPX_PARAM_BARSTARTALG = 3017 +const CPX_PARAM_BARCROSSALG = 3018 +const CPX_PARAM_BARQCPEPCOMP = 3020 +const CPX_PARAM_QPNZREADLIM = 4001 +const CPX_PARAM_CALCQCPDUALS = 4003 +const CPX_PARAM_QPMAKEPSDIND = 4010 +const CPX_PARAM_QTOLININD = 4012 +const CPX_PARAM_NETITLIM = 5001 +const CPX_PARAM_NETEPOPT = 5002 +const CPX_PARAM_NETEPRHS = 5003 +const CPX_PARAM_NETPPRIIND = 5004 +const CPX_PARAM_NETDISPLAY = 5005 +const CPX_CPXAUTOTYPES_H_H = 1 +const CPX_CPXAUTOSTRUCTS_H_H = 1 +const CPXBYTE = UInt8 +const CPXINT = Cint +const CPXLONG = Clonglong +const CPXSHORT = Int16 +const CPXSIZE = CPXLONG +const CPXULONG = Culonglong +const CPXBYTE_TEST = NTuple{1, Cint} +const CPXSHORT_TEST = NTuple{1, Cint} +const CPXINT_TEST = NTuple{1, Cint} +const CPXLONG_TEST = NTuple{1, Cint} +const CPXULONG_TEST = NTuple{1, Cint} +const CPXSIZE_BITS_TEST = NTuple{1, Cint} +const cpxenv = Cvoid +const CPXENVptr = Ptr{cpxenv} +const CPXCENVptr = Ptr{cpxenv} +const cpxchannel = Cvoid +const CPXCHANNELptr = Ptr{cpxchannel} +const paramset = Cvoid +const CPXPARAMSETptr = Ptr{paramset} +const CPXCPARAMSETptr = Ptr{paramset} +const cpxlp = Cvoid +const CPXLPptr = Ptr{cpxlp} +const CPXCLPptr = Ptr{cpxlp} +const cpxnet = Cvoid +const CPXNETptr = Ptr{cpxnet} +const CPXCNETptr = Ptr{cpxnet} +const CPXCHARptr = Cstring +const CPXCCHARptr = Cstring +const CPXVOIDptr = Ptr{Cvoid} + +struct cpxiodevice + cpxiodev_eof::Ptr{Cvoid} + cpxiodev_error::Ptr{Cvoid} + cpxiodev_rewind::Ptr{Cvoid} + cpxiodev_flush::Ptr{Cvoid} + cpxiodev_close::Ptr{Cvoid} + cpxiodev_putc::Ptr{Cvoid} + cpxiodev_puts::Ptr{Cvoid} + cpxiodev_read::Ptr{Cvoid} + cpxiodev_write::Ptr{Cvoid} +end + +const CPXIODEVICE = cpxiodevice +const CPXIODEVICEptr = Ptr{cpxiodevice} + +const CPXNAMEFUNCTION = Ptr{Cvoid} + +@cenum CPXCALLBACKINFO::UInt32 begin + CPXCALLBACKINFO_THREADID = 0 + CPXCALLBACKINFO_NODECOUNT = 1 + CPXCALLBACKINFO_ITCOUNT = 2 + CPXCALLBACKINFO_BEST_SOL = 3 + CPXCALLBACKINFO_BEST_BND = 4 + CPXCALLBACKINFO_THREADS = 5 + CPXCALLBACKINFO_FEASIBLE = 6 + CPXCALLBACKINFO_TIME = 7 + CPXCALLBACKINFO_DETTIME = 8 + CPXCALLBACKINFO_NODEUID = 9 + CPXCALLBACKINFO_NODEDEPTH = 10 + CPXCALLBACKINFO_CANDIDATE_SOURCE = 11 + CPXCALLBACKINFO_RESTARTS = 12 +end + +@cenum CPXCALLBACKSOLUTIONSTRATEGY::Int32 begin + CPXCALLBACKSOLUTION_NOCHECK = -1 + CPXCALLBACKSOLUTION_CHECKFEAS = 0 + CPXCALLBACKSOLUTION_PROPAGATE = 1 + CPXCALLBACKSOLUTION_SOLVE = 2 +end + +@cenum CPXINFOTYPE::UInt32 begin + CPXINFO_BYTE = 0 + CPXINFO_SHORT = 1 + CPXINFO_INT = 2 + CPXINFO_LONG = 3 + CPXINFO_DOUBLE = 4 +end + + +const cpxasynchandle = Cvoid +const CPXASYNCptr = Ptr{cpxasynchandle} +const cpxcallbackcontext = Cvoid +const CPXCALLBACKCONTEXTptr = Ptr{cpxcallbackcontext} + +const CPXCALLBACKFUNC = Ptr{Cvoid} + +const CPXCASYNCptr = Ptr{cpxasynchandle} + +struct cpxdeserializer + getbyte::Ptr{Cvoid} + getshort::Ptr{Cvoid} + getint::Ptr{Cvoid} + getlong::Ptr{Cvoid} + getfloat::Ptr{Cvoid} + getdouble::Ptr{Cvoid} + getbytes::Ptr{Cvoid} + getshorts::Ptr{Cvoid} + getints::Ptr{Cvoid} + getlongs::Ptr{Cvoid} + getfloats::Ptr{Cvoid} + getdoubles::Ptr{Cvoid} +end + +const CPXCDESERIALIZERptr = Ptr{cpxdeserializer} +const cpxenvgroup = Cvoid +const CPXCENVGROUPptr = Ptr{cpxenvgroup} +const messagehandler = Cvoid +const CPXCMESSAGEHANDLERptr = Ptr{messagehandler} + +struct cpxserializer + addbyte::Ptr{Cvoid} + addshort::Ptr{Cvoid} + addint::Ptr{Cvoid} + addlong::Ptr{Cvoid} + addfloat::Ptr{Cvoid} + adddouble::Ptr{Cvoid} + addbytes::Ptr{Cvoid} + addshorts::Ptr{Cvoid} + addints::Ptr{Cvoid} + addlongs::Ptr{Cvoid} + addfloats::Ptr{Cvoid} + adddoubles::Ptr{Cvoid} +end + +const CPXCSERIALIZERptr = Ptr{cpxserializer} +const CPXDESERIALIZERptr = Ptr{cpxdeserializer} +const CPXENVGROUPptr = Ptr{cpxenvgroup} + +const CPXINFOHANDLER = Ptr{Cvoid} + +const CPXMESSAGEHANDLERptr = Ptr{messagehandler} + +const CPXMODELASSTCALLBACKFUNC = Ptr{Cvoid} + +const CPXSERIALIZERptr = Ptr{cpxserializer} + +const CPXUSERFUNCTION = Ptr{Cvoid} diff --git a/test/C_API/constants.jl b/test/C_API/constants.jl deleted file mode 100644 index 1e7d0a20..00000000 --- a/test/C_API/constants.jl +++ /dev/null @@ -1,8 +0,0 @@ -@testset "Checking value of constants from cpxconst.h" begin - version_split = split(CPLEX.version(), '.') - version = parse(Int, version_split[1]) - release = parse(Int, version_split[2]) - @test CPLEX.CPX_VERSION_VERSION == version - @test CPLEX.CPX_VERSION_RELEASE == release - @test div(CPLEX.CPX_VERSION, 10000) == version * 100 + release -end diff --git a/test/C_API/gencb_01.jl b/test/C_API/gencb_01.jl deleted file mode 100644 index 1bf3590d..00000000 --- a/test/C_API/gencb_01.jl +++ /dev/null @@ -1,18 +0,0 @@ -# A test for abort in the generic callback. -# Solve: - # minimize x - # s.t. x is integral: 0 <= x <= 1 - -@testset "GenCB_01" begin - env = CPLEX.Env() - CPLEX.set_param!(env, "CPX_PARAM_THREADS", 1) - model = CPLEX.Model(env, "callback_test") - CPLEX.add_vars!(model, [1.0], [0.0], [1.0]) - CPLEX.c_api_chgctype(model, Int32[1], Cchar['I']) - function my_callback(cb_context::CPLEX.CallbackContext, context_id::Clong) - CPLEX.cbabort(cb_context) - end - CPLEX.cbsetfunc(model, CPLEX.CPX_CALLBACKCONTEXT_CANDIDATE, my_callback) - CPLEX.optimize!(model) - @test CPLEX.get_status(model) == :CPXMIP_ABORT_INFEAS -end diff --git a/test/C_API/gencb_02.jl b/test/C_API/gencb_02.jl deleted file mode 100644 index 888bdf62..00000000 --- a/test/C_API/gencb_02.jl +++ /dev/null @@ -1,56 +0,0 @@ -@testset "GenCB_02" begin - env = CPLEX.Env() - CPLEX.set_param!(env, "CPX_PARAM_THREADS", 1) - # Change some settings to force CPLEX to call the callback. - CPLEX.set_param!(env, "CPX_PARAM_PREIND", 0) - CPLEX.set_param!(env, "CPX_PARAM_HEURFREQ", -1) - model = CPLEX.Model(env, "GenCB_02") - # max 0.5x + y - # s.t. 0 <= x <= 1 - # 0 <= y <= 1 - CPLEX.add_var!(model, 0.5, 0, 1) - CPLEX.add_var!(model, 1.0, 0, 1) - CPLEX.set_sense!(model, :Max) - CPLEX.set_vartype!(model, ['B', 'B']) - CPLEX.add_constr!(model, [1.0, 1.0], '<', 1.5) - was_heuristic_called = false - function my_round_down_heur( - cb_context::CPLEX.CallbackContext, context_id::Clong) - if context_id == CPLEX.CPX_CALLBACKCONTEXT_RELAXATION - relaxed_solution = Vector{Float64}(undef, 2) - relaxed_objective = Ref{Float64}(0.0) - CPLEX.cbgetrelaxationpoint( - cb_context, - relaxed_solution, - Cint(0), - Cint(1), - relaxed_objective - ) - objective_value = relaxed_objective[] - for j in 1:2 - frac = relaxed_solution[j] - floor(relaxed_solution[j]) - if frac > 1.0e-6 - objective_value -= frac - relaxed_solution[j] -= frac - end - end - was_heuristic_called = true - return CPLEX.cbpostheursoln( - cb_context, - Cint(2), - Cint[0, 1], - relaxed_solution, - objective_value, - CPLEX.CPXCALLBACKSOLUTION_PROPAGATE - ) - else - error("Heuristic should not be called from $(context_id).") - end - end - CPLEX.cbsetfunc( - model, CPLEX.CPX_CALLBACKCONTEXT_RELAXATION, my_round_down_heur) - CPLEX.optimize!(model) - @test was_heuristic_called - @test CPLEX.get_status(model) == :CPXMIP_OPTIMAL - @test CPLEX.get_objval(model) ≈ 1.0 -end diff --git a/test/C_API/gencb_03.jl b/test/C_API/gencb_03.jl deleted file mode 100644 index 53d09b0c..00000000 --- a/test/C_API/gencb_03.jl +++ /dev/null @@ -1,47 +0,0 @@ -@testset "GenCB_03" begin - env = CPLEX.Env() - CPLEX.set_param!(env, "CPX_PARAM_THREADS", 1) - model = CPLEX.Model(env, "LazyCB_test") - # max 0.5x + y - # s.t. 0 <= x <= 2 - # 0 <= y <= 2 - CPLEX.add_var!(model, 0.5, 0, 2) - CPLEX.add_var!(model, 1.0, 0, 2) - CPLEX.set_sense!(model, :Max) - CPLEX.set_vartype!(model, ['I', 'I']) - function my_callback(cb_context::CPLEX.CallbackContext, context_id::Clong) - if context_id == CPLEX.CPX_CALLBACKCONTEXT_CANDIDATE - primal_sol = Vector{Float64}(undef, 2) - objective = Ref{Float64}(0.0) - CPLEX.cbgetcandidatepoint( - cb_context, - primal_sol, - Cint(0), - Cint(1), - objective - ) - @assert isapprox( - 0.5 * primal_sol[1] + primal_sol[2], objective[], atol=1e-6) - if sum(primal_sol) > 3.0 + 1e-6 - CPLEX.cbrejectcandidate( - cb_context, - Cint(1), - Cint(2), - Cdouble[3.0], - Cchar['L'], - Cint[0], - Cint[0, 1], - Cdouble[1.0, 1.0] - ) - end - else - error("Callback shold not be called from context_id $(context_id).") - end - end - CPLEX.cbsetfunc(model, CPLEX.CPX_CALLBACKCONTEXT_CANDIDATE, my_callback) - CPLEX.optimize!(model) - sol = CPLEX.get_solution(model) - @test sol ≈ [1, 2] - @test CPLEX.get_objval(model) ≈ 2.5 - @test CPLEX.get_status(model) == :CPXMIP_OPTIMAL -end diff --git a/test/C_API/iis.jl b/test/C_API/iis.jl deleted file mode 100644 index 9c7ceeac..00000000 --- a/test/C_API/iis.jl +++ /dev/null @@ -1,35 +0,0 @@ -# a simple LP example -# -# maximize x -# -# s.t. x >= 2 -# x <= 1 -# x >= 0 -# -# conflict: the two constraints - -@testset "IIS" begin - env = CPLEX.Env() - - model = CPLEX.Model(env, "iis") - CPLEX.set_sense!(model, :Max) - - # add variables - CPLEX.add_var!(model, 1.0, 0., Inf) # x - - # add constraints - CPLEX.add_constr!(model, [1.], '>', 2.) - CPLEX.add_constr!(model, [1.], '<', 1.) - - # compute conflict - c = CPLEX.c_api_getconflict(model) - - @test c !== nothing - @test c.stat == CPLEX.CPX_STAT_CONFLICT_MINIMAL - @test c.nrows == 2 - @test c.rowind[1] == 0 - @test c.rowind[2] == 1 - @test c.ncols == 0 - - # gc() # test finalizers -end diff --git a/test/C_API/low_level_api.jl b/test/C_API/low_level_api.jl deleted file mode 100644 index 1f049774..00000000 --- a/test/C_API/low_level_api.jl +++ /dev/null @@ -1,5 +0,0 @@ -@testset "Low-level API" begin - env = CPLEX.Env() - CPLEX.set_logfile(env, "cplex.log") - CPLEX.close_CPLEX(env) -end diff --git a/test/C_API/lp_01.jl b/test/C_API/lp_01.jl deleted file mode 100644 index 2744185f..00000000 --- a/test/C_API/lp_01.jl +++ /dev/null @@ -1,38 +0,0 @@ -# a simple LP example -# -# maximize x + y -# -# s.t. 50 x + 24 y <= 2400 -# 30 x + 33 y <= 2100 -# x >= 45, y >= 5 -# -# solution: x = 45, y = 6.25, objv = 51.25 - -@testset "LP 01" begin - env = CPLEX.Env() - - # method = getparam(env, "Method") - # println("method = $method") - - model = CPLEX.Model(env, "lp_01") - CPLEX.set_sense!(model, :Max) - - # add variables - CPLEX.add_var!(model, 1.0, 45., Inf) # x - CPLEX.add_var!(model, 1.0, 5., Inf) # y - - # add constraints - CPLEX.add_constr!(model, [50., 24.], '<', 2400.) - CPLEX.add_constr!(model, [30., 33.], '<', 2100.) - - # perform optimization - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test sol[1] ≈ 45 - @test sol[2] ≈ 6.25 - - @test CPLEX.get_objval(model) ≈ 51.25 - - # gc() # test finalizers -end diff --git a/test/C_API/lp_02.jl b/test/C_API/lp_02.jl deleted file mode 100644 index 2bef0fe1..00000000 --- a/test/C_API/lp_02.jl +++ /dev/null @@ -1,31 +0,0 @@ -# LP programming using MATLAB-like construction -# -# maximize 1000 x + 350 y -# -# s.t. x >= 30, y >= 0 -# x - 1.5y >= 0 (i.e. -x + 1.5 y <= 0) -# 12 x + 8 y <= 1000 -# 1000 x + 300 y <= 70000 -# -# solution: (59.0909, 36.3636) -# objv: 71818.1818 - -@testset "LP 02" begin - env = CPLEX.Env() - - model = CPLEX.cplex_model(env; - name="lp_02", - sense=:Max, - f = [1000., 350.], - A = [-1. 1.5; 12. 8.; 1000. 300.], - b = [0., 1000., 70000.], - lb = [0., 30.]) - - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test sol[1] ≈ 650/11 - @test sol[2] ≈ 400/11 - - @test CPLEX.get_objval(model) ≈ 790000/11 -end diff --git a/test/C_API/lp_03.jl b/test/C_API/lp_03.jl deleted file mode 100644 index 46fbd941..00000000 --- a/test/C_API/lp_03.jl +++ /dev/null @@ -1,54 +0,0 @@ -@testset "LP 03" begin - # Test get/set objective coefficients in LP - - env = CPLEX.Env() - - # original model - # - # maximize 2x + 2y - # - # s.t. 0.2 <= x, y <= 1 - # - - model = CPLEX.cplex_model(env; - name="lp_03", - sense=:Max, - f=[2.0, 2.0], - lb=[0.2, 0.2], - ub=[1.0, 1.0]) - - lb_ = CPLEX.get_varLB(model) - ub_ = CPLEX.get_varUB(model) - c_ = CPLEX.get_obj(model) - - @test lb_ == [0.2, 0.2] - @test ub_ == [1.0, 1.0] - @test c_ == [2.0, 2.0] - - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test sol[1] ≈ 1 - @test sol[2] ≈ 1 - @test CPLEX.get_objval(model) ≈ 4 - - - # change objective (warm start) - # - # maximize x - y - # - # s.t. 0.2 <= x, y <= 1 - # - - CPLEX.set_obj!(model, [1, -1]) - - c_ = CPLEX.get_obj(model) - @test c_ == [1.0, -1.0] - - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test sol[1] ≈ 1 - @test sol[2] ≈ 0.2 - @test CPLEX.get_objval(model) ≈ 0.8 -end diff --git a/test/C_API/mip_01.jl b/test/C_API/mip_01.jl deleted file mode 100644 index 15120fef..00000000 --- a/test/C_API/mip_01.jl +++ /dev/null @@ -1,29 +0,0 @@ -# an example on mixed integer programming -# -# maximize x + 2 y + 5 z -# -# s.t. x + y + z <= 10 -# x + 2 y + z <= 15 -# -# x is continuous: 0 <= x <= 5 -# y is integer: 0 <= y <= 10 -# z is binary - -@testset "MIP 01" begin - env = CPLEX.Env() - model = CPLEX.Model(env, "mip_01") - CPLEX.set_sense!(model, :Max) - CPLEX.set_param!(env, "CPX_PARAM_MIPDISPLAY", 1) - CPLEX.set_param!(env, "CPX_PARAM_MIPINTERVAL", 1) - CPLEX.add_var!(model, 1.0, 0.0, 5.0) # x - CPLEX.add_var!(model, 2.0, 0.0, 10.0) # y - CPLEX.add_var!(model, 5.0, 0.0, 1.0) # z - CPLEX.set_vartype!(model, ['C', 'I', 'B']) - @test model.has_int == true - CPLEX.add_constr!(model, ones(3), '<', 10.0) - CPLEX.add_constr!(model, [1.0, 2.0, 1.0], '<', 15.0) - CPLEX.optimize!(model) - sol = CPLEX.get_solution(model) - @test sol ≈ [4.0, 5.0, 1.0] - @test CPLEX.get_objval(model) ≈ 19 -end diff --git a/test/C_API/qcqp_01.jl b/test/C_API/qcqp_01.jl deleted file mode 100644 index dc91f652..00000000 --- a/test/C_API/qcqp_01.jl +++ /dev/null @@ -1,26 +0,0 @@ -# QCP example -# maximize x + y -# -# s.t. x, y >= 0 -# x^2 + y^2 <= 1 -# -# solution: (0.71, 0.71) objv = 1.414 - -@testset "QCQP 01" begin - env = CPLEX.Env() - - model = CPLEX.Model(env, "qcqp_01") - CPLEX.set_sense!(model, :Max) - - CPLEX.add_vars!(model, [1., 1.], 0., Inf) - - # add_qpterms!(model, linearindices, linearcoeffs, qrowinds, qcolinds, qcoeffs, sense, rhs) - CPLEX.add_qconstr!(model, [], [], [1, 2], [1, 2], [1, 1.], '<', 1.0) - - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test isapprox(sol[1], sqrt(2)/2, rtol=1e-4) - @test isapprox(sol[2], sqrt(2)/2, rtol=1e-4) - @test isapprox(CPLEX.get_objval(model), sqrt(2), rtol=1e-8) -end diff --git a/test/C_API/qp_01.jl b/test/C_API/qp_01.jl deleted file mode 100644 index c72b725e..00000000 --- a/test/C_API/qp_01.jl +++ /dev/null @@ -1,28 +0,0 @@ -# QP example -# -# minimize 2 x^2 + y^2 + xy + x + y -# -# s.t. x, y >= 0 -# x + y = 1 -# -# solution: (0.25, 0.75), objv = 1.875 -# - -@testset "QP 01" begin - env = CPLEX.Env() - CPLEX.set_param!(env, "CPX_PARAM_SCRIND", 0) - - model = CPLEX.Model(env, "qp_02") - - CPLEX.add_vars!(model, [1., 1.], 0., Inf) - - CPLEX.add_qpterms!(model, [1, 1, 2], [1, 2, 2], [2., 1., 1.]) - CPLEX.add_constr!(model, [1., 1.], '=', 1.) - - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test abs(sol[1]) < 1e-4 - @test isapprox(sol[2], 1, rtol=1e-4) - @test isapprox(CPLEX.get_objval(model), 1.5, rtol=1e-8) -end diff --git a/test/C_API/qp_02.jl b/test/C_API/qp_02.jl deleted file mode 100644 index afa85457..00000000 --- a/test/C_API/qp_02.jl +++ /dev/null @@ -1,26 +0,0 @@ -# Quadratic programming in MATLAB-like style -# -# minimize x^2 + xy + y^2 + yz + z^2 -# -# s.t. x + 2 y + 3 z >= 4 -# x + y >= 1 -# - -@testset "QP 02" begin - env = CPLEX.Env() - - model = CPLEX.cplex_model(env; - name = "qp_02", - f = [0., 0., 0.], - H = [2. 1. 0.; 1. 2. 1.; 0. 1. 2.], - A = -[1. 2. 3.; 1. 1. 0.], - b = -[4., 1.]) - - CPLEX.optimize!(model) - - sol = CPLEX.get_solution(model) - @test isapprox(sol[1], 0.571429, rtol=1e-4) - @test isapprox(sol[2], 0.428571, rtol=1e-4) - @test isapprox(sol[3], 0.857143, rtol=1e-4) - @test isapprox(CPLEX.get_objval(model), 1.857142864, rtol=1e-8) -end diff --git a/test/MathOptInterface/MOI_callbacks.jl b/test/MathOptInterface/MOI_callbacks.jl index 6fb84090..f1ad0c46 100644 --- a/test/MathOptInterface/MOI_callbacks.jl +++ b/test/MathOptInterface/MOI_callbacks.jl @@ -1,3 +1,5 @@ +module TestCallbacks + using CPLEX using Random using Test @@ -51,339 +53,358 @@ function callback_knapsack_model() return model, x, item_weights end -@testset "LazyConstraintCallback" begin - @testset "LazyConstraint" begin - model, x, y = callback_simple_model() - lazy_called = false - MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin - lazy_called = true - x_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), x) - y_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), y) - @test MOI.supports(model, MOI.LazyConstraint(cb_data)) - if y_val - x_val > 1 + 1e-6 - MOI.submit( - model, - MOI.LazyConstraint(cb_data), - MOI.ScalarAffineFunction{Float64}( - MOI.ScalarAffineTerm.([-1.0, 1.0], [x, y]), - 0.0 - ), - MOI.LessThan{Float64}(1.0) - ) - elseif y_val + x_val > 3 + 1e-6 - MOI.submit( - model, - MOI.LazyConstraint(cb_data), - MOI.ScalarAffineFunction{Float64}( - MOI.ScalarAffineTerm.([1.0, 1.0], [x, y]), - 0.0 - ), MOI.LessThan{Float64}(3.0) - ) - end - end) - @test MOI.supports(model, MOI.LazyConstraintCallback()) - MOI.optimize!(model) - @test lazy_called - @test MOI.get(model, MOI.VariablePrimal(), x) == 1 - @test MOI.get(model, MOI.VariablePrimal(), y) == 2 - end - @testset "OptimizeInProgress" begin - model, x, y = callback_simple_model() - MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin - @test_throws( - MOI.OptimizeInProgress(MOI.VariablePrimal()), - MOI.get(model, MOI.VariablePrimal(), x) - ) - @test_throws( - MOI.OptimizeInProgress(MOI.ObjectiveValue()), - MOI.get(model, MOI.ObjectiveValue()) - ) - @test_throws( - MOI.OptimizeInProgress(MOI.ObjectiveBound()), - MOI.get(model, MOI.ObjectiveBound()) - ) - end) - MOI.optimize!(model) - end - @testset "UserCut" begin - model, x, y = callback_simple_model() - cb = nothing - MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin - cb = cb_data +function test_LazyConstraint() + model, x, y = callback_simple_model() + lazy_called = false + MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin + lazy_called = true + x_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), x) + y_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), y) + @test MOI.supports(model, MOI.LazyConstraint(cb_data)) + if y_val - x_val > 1 + 1e-6 MOI.submit( model, - MOI.UserCut(cb_data), - MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(1.0, x)], 0.0), - MOI.LessThan(2.0) + MOI.LazyConstraint(cb_data), + MOI.ScalarAffineFunction{Float64}( + MOI.ScalarAffineTerm.([-1.0, 1.0], [x, y]), + 0.0 + ), + MOI.LessThan{Float64}(1.0) ) - end) - @test_throws( - MOI.InvalidCallbackUsage( - MOI.LazyConstraintCallback(), - MOI.UserCut(cb) - ), - MOI.optimize!(model) - ) - end - @testset "HeuristicSolution" begin - model, x, y = callback_simple_model() - cb = nothing - MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin - cb = cb_data + elseif y_val + x_val > 3 + 1e-6 MOI.submit( model, - MOI.HeuristicSolution(cb_data), - [x], - [2.0] + MOI.LazyConstraint(cb_data), + MOI.ScalarAffineFunction{Float64}( + MOI.ScalarAffineTerm.([1.0, 1.0], [x, y]), + 0.0 + ), MOI.LessThan{Float64}(3.0) ) - end) + end + end) + @test MOI.supports(model, MOI.LazyConstraintCallback()) + MOI.optimize!(model) + @test lazy_called + @test MOI.get(model, MOI.VariablePrimal(), x) == 1 + @test MOI.get(model, MOI.VariablePrimal(), y) == 2 +end + +function test_OptimizeInProgress() + model, x, y = callback_simple_model() + MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin @test_throws( - MOI.InvalidCallbackUsage( - MOI.LazyConstraintCallback(), - MOI.HeuristicSolution(cb) - ), - MOI.optimize!(model) + MOI.OptimizeInProgress(MOI.VariablePrimal()), + MOI.get(model, MOI.VariablePrimal(), x) ) - end + @test_throws( + MOI.OptimizeInProgress(MOI.ObjectiveValue()), + MOI.get(model, MOI.ObjectiveValue()) + ) + @test_throws( + MOI.OptimizeInProgress(MOI.ObjectiveBound()), + MOI.get(model, MOI.ObjectiveBound()) + ) + end) + MOI.optimize!(model) end -@testset "UserCutCallback" begin - @testset "UserCut" begin - model, x, item_weights = callback_knapsack_model() - user_cut_submitted = false - MOI.set(model, MOI.UserCutCallback(), cb_data -> begin - terms = MOI.ScalarAffineTerm{Float64}[] - accumulated = 0.0 - for (i, xi) in enumerate(x) - if MOI.get(model, MOI.CallbackVariablePrimal(cb_data), xi) > 0.0 - push!(terms, MOI.ScalarAffineTerm(1.0, xi)) - accumulated += item_weights[i] - end - end - @test MOI.supports(model, MOI.UserCut(cb_data)) - if accumulated > 10.0 - MOI.submit( - model, - MOI.UserCut(cb_data), - MOI.ScalarAffineFunction{Float64}(terms, 0.0), - MOI.LessThan{Float64}(length(terms) - 1) - ) - user_cut_submitted = true - end - end) - @test MOI.supports(model, MOI.UserCutCallback()) +function test_LazyConstraint_UserCut() + model, x, y = callback_simple_model() + cb = nothing + MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin + cb = cb_data + MOI.submit( + model, + MOI.UserCut(cb_data), + MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(1.0, x)], 0.0), + MOI.LessThan(2.0) + ) + end) + @test_throws( + MOI.InvalidCallbackUsage( + MOI.LazyConstraintCallback(), + MOI.UserCut(cb) + ), MOI.optimize!(model) - @test user_cut_submitted - end - @testset "LazyConstraint" begin - model, x, item_weights = callback_knapsack_model() - cb = nothing - MOI.set(model, MOI.UserCutCallback(), cb_data -> begin - cb = cb_data - MOI.submit( - model, - MOI.LazyConstraint(cb_data), - MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(1.0, x), 0.0), - MOI.LessThan(5.0) - ) - end) - @test_throws( - MOI.InvalidCallbackUsage( - MOI.UserCutCallback(), - MOI.LazyConstraint(cb) - ), - MOI.optimize!(model) + ) +end + +function test_LazyConstraint_HeuristicSolution() + model, x, y = callback_simple_model() + cb = nothing + MOI.set(model, MOI.LazyConstraintCallback(), cb_data -> begin + cb = cb_data + MOI.submit( + model, + MOI.HeuristicSolution(cb_data), + [x], + [2.0] ) - end - @testset "HeuristicSolution" begin - model, x, item_weights = callback_knapsack_model() - cb = nothing - MOI.set(model, MOI.UserCutCallback(), cb_data -> begin - cb = cb_data + end) + @test_throws( + MOI.InvalidCallbackUsage( + MOI.LazyConstraintCallback(), + MOI.HeuristicSolution(cb) + ), + MOI.optimize!(model) + ) +end + +function test_UserCut() + model, x, item_weights = callback_knapsack_model() + user_cut_submitted = false + MOI.set(model, MOI.UserCutCallback(), cb_data -> begin + terms = MOI.ScalarAffineTerm{Float64}[] + accumulated = 0.0 + for (i, xi) in enumerate(x) + if MOI.get(model, MOI.CallbackVariablePrimal(cb_data), xi) > 0.0 + push!(terms, MOI.ScalarAffineTerm(1.0, xi)) + accumulated += item_weights[i] + end + end + @test MOI.supports(model, MOI.UserCut(cb_data)) + if accumulated > 10.0 MOI.submit( model, - MOI.HeuristicSolution(cb_data), - [x[1]], - [0.0] + MOI.UserCut(cb_data), + MOI.ScalarAffineFunction{Float64}(terms, 0.0), + MOI.LessThan{Float64}(length(terms) - 1) ) - end) - @test_throws( - MOI.InvalidCallbackUsage( - MOI.UserCutCallback(), - MOI.HeuristicSolution(cb) - ), - MOI.optimize!(model) + user_cut_submitted = true + end + end) + @test MOI.supports(model, MOI.UserCutCallback()) + MOI.optimize!(model) + @test user_cut_submitted +end + +function test_UserCut_LazyConstraint() + model, x, item_weights = callback_knapsack_model() + cb = nothing + MOI.set(model, MOI.UserCutCallback(), cb_data -> begin + cb = cb_data + MOI.submit( + model, + MOI.LazyConstraint(cb_data), + MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(1.0, x), 0.0), + MOI.LessThan(5.0) ) - end + end) + @test_throws( + MOI.InvalidCallbackUsage( + MOI.UserCutCallback(), + MOI.LazyConstraint(cb) + ), + MOI.optimize!(model) + ) end -@testset "HeuristicCallback" begin - @testset "HeuristicSolution" begin - model, x, item_weights = callback_knapsack_model() - callback_called = false - MOI.set(model, MOI.HeuristicCallback(), cb_data -> begin - x_vals = MOI.get.(model, MOI.CallbackVariablePrimal(cb_data), x) - @test MOI.supports(model, MOI.HeuristicSolution(cb_data)) - @test MOI.submit( - model, - MOI.HeuristicSolution(cb_data), - x, - floor.(x_vals) - ) == MOI.HEURISTIC_SOLUTION_UNKNOWN - callback_called = true - end) - @test MOI.supports(model, MOI.HeuristicCallback()) +function test_UserCut_HeuristicSolution() + model, x, item_weights = callback_knapsack_model() + cb = nothing + MOI.set(model, MOI.UserCutCallback(), cb_data -> begin + cb = cb_data + MOI.submit( + model, + MOI.HeuristicSolution(cb_data), + [x[1]], + [0.0] + ) + end) + @test_throws( + MOI.InvalidCallbackUsage( + MOI.UserCutCallback(), + MOI.HeuristicSolution(cb) + ), MOI.optimize!(model) - @test callback_called - end - @testset "LazyConstraint" begin - model, x, item_weights = callback_knapsack_model() - cb = nothing - MOI.set(model, MOI.HeuristicCallback(), cb_data -> begin - cb = cb_data - MOI.submit( - model, - MOI.LazyConstraint(cb_data), - MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(1.0, x), 0.0), - MOI.LessThan(5.0) - ) - end) + ) +end + +function test_Heuristic() + model, x, item_weights = callback_knapsack_model() + callback_called = false + MOI.set(model, MOI.HeuristicCallback(), cb_data -> begin + x_vals = MOI.get.(model, MOI.CallbackVariablePrimal(cb_data), x) + @test MOI.supports(model, MOI.HeuristicSolution(cb_data)) + @test MOI.submit( + model, + MOI.HeuristicSolution(cb_data), + x, + floor.(x_vals) + ) == MOI.HEURISTIC_SOLUTION_UNKNOWN + callback_called = true + end) + @test MOI.supports(model, MOI.HeuristicCallback()) + MOI.optimize!(model) + @test callback_called +end + +function test_Heuristic_LazyConstraint() + model, x, item_weights = callback_knapsack_model() + cb = nothing + MOI.set(model, MOI.HeuristicCallback(), cb_data -> begin + cb = cb_data + MOI.submit( + model, + MOI.LazyConstraint(cb_data), + MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(1.0, x), 0.0), + MOI.LessThan(5.0) + ) + end) + @test_throws( + MOI.InvalidCallbackUsage( + MOI.HeuristicCallback(), + MOI.LazyConstraint(cb) + ), + MOI.optimize!(model) + ) +end + +function test_Heuristic_UserCut() + model, x, item_weights = callback_knapsack_model() + cb = nothing + MOI.set(model, MOI.HeuristicCallback(), cb_data -> begin + cb = cb_data + MOI.submit( + model, + MOI.UserCut(cb_data), + MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(1.0, x), 0.0), + MOI.LessThan(5.0) + ) + end) + @test_throws( + MOI.InvalidCallbackUsage( + MOI.HeuristicCallback(), + MOI.UserCut(cb) + ), + MOI.optimize!(model) + ) +end + +function test_CallbackFunction_OptimizeInProgress() + model, x, y = callback_simple_model() + MOI.set(model, CPLEX.CallbackFunction(), (cb_data, cb_context) -> begin @test_throws( - MOI.InvalidCallbackUsage( - MOI.HeuristicCallback(), - MOI.LazyConstraint(cb) - ), - MOI.optimize!(model) + MOI.OptimizeInProgress(MOI.VariablePrimal()), + MOI.get(model, MOI.VariablePrimal(), x) ) - end - @testset "UserCut" begin - model, x, item_weights = callback_knapsack_model() - cb = nothing - MOI.set(model, MOI.HeuristicCallback(), cb_data -> begin - cb = cb_data - MOI.submit( - model, - MOI.UserCut(cb_data), - MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(1.0, x), 0.0), - MOI.LessThan(5.0) - ) - end) @test_throws( - MOI.InvalidCallbackUsage( - MOI.HeuristicCallback(), - MOI.UserCut(cb) - ), - MOI.optimize!(model) + MOI.OptimizeInProgress(MOI.ObjectiveValue()), + MOI.get(model, MOI.ObjectiveValue()) ) - end + @test_throws( + MOI.OptimizeInProgress(MOI.ObjectiveBound()), + MOI.get(model, MOI.ObjectiveBound()) + ) + end) + @test MOI.supports(model, CPLEX.CallbackFunction()) + MOI.optimize!(model) end -@testset "CPLEX.CallbackFunction" begin - @testset "OptimizeInProgress" begin - model, x, y = callback_simple_model() - MOI.set(model, CPLEX.CallbackFunction(), (cb_data, cb_where) -> begin - @test_throws( - MOI.OptimizeInProgress(MOI.VariablePrimal()), - MOI.get(model, MOI.VariablePrimal(), x) - ) - @test_throws( - MOI.OptimizeInProgress(MOI.ObjectiveValue()), - MOI.get(model, MOI.ObjectiveValue()) +function test_CallbackFunction_LazyConstraint() + model, x, y = callback_simple_model() + cb_calls = Clong[] + function callback_function( + cb_data::CPLEX.CallbackContext, cb_context::Clong + ) + push!(cb_calls, cb_context) + if cb_context != CPX_CALLBACKCONTEXT_CANDIDATE + return + end + CPLEX.load_callback_variable_primal(cb_data, cb_context) + x_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), x) + y_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), y) + if y_val - x_val > 1 + 1e-6 + MOI.submit(model, MOI.LazyConstraint(cb_data), + MOI.ScalarAffineFunction{Float64}( + MOI.ScalarAffineTerm.([-1.0, 1.0], [x, y]), + 0.0 + ), + MOI.LessThan{Float64}(1.0) ) - @test_throws( - MOI.OptimizeInProgress(MOI.ObjectiveBound()), - MOI.get(model, MOI.ObjectiveBound()) + elseif y_val + x_val > 3 + 1e-6 + MOI.submit(model, MOI.LazyConstraint(cb_data), + MOI.ScalarAffineFunction{Float64}( + MOI.ScalarAffineTerm.([1.0, 1.0], [x, y]), + 0.0 + ), + MOI.LessThan{Float64}(3.0) ) - end) - @test MOI.supports(model, CPLEX.CallbackFunction()) - MOI.optimize!(model) - end - @testset "LazyConstraint" begin - model, x, y = callback_simple_model() - cb_calls = Int32[] - function callback_function(cb_data::CPLEX.CallbackContext, cb_where) - push!(cb_calls, cb_where) - if cb_where != CPLEX.CPX_CALLBACKCONTEXT_CANDIDATE - return - end - CPLEX.callbackgetcandidatepoint(model, cb_data, cb_where) - x_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), x) - y_val = MOI.get(model, MOI.CallbackVariablePrimal(cb_data), y) - if y_val - x_val > 1 + 1e-6 - MOI.submit(model, MOI.LazyConstraint(cb_data), - MOI.ScalarAffineFunction{Float64}( - MOI.ScalarAffineTerm.([-1.0, 1.0], [x, y]), - 0.0 - ), - MOI.LessThan{Float64}(1.0) - ) - elseif y_val + x_val > 3 + 1e-6 - MOI.submit(model, MOI.LazyConstraint(cb_data), - MOI.ScalarAffineFunction{Float64}( - MOI.ScalarAffineTerm.([1.0, 1.0], [x, y]), - 0.0 - ), - MOI.LessThan{Float64}(3.0) - ) - end end - MOI.set(model, CPLEX.CallbackFunction(), callback_function) - MOI.optimize!(model) - @test MOI.get(model, MOI.VariablePrimal(), x) == 1 - @test MOI.get(model, MOI.VariablePrimal(), y) == 2 - @test length(cb_calls) > 0 - end - @testset "UserCut" begin - model, x, item_weights = callback_knapsack_model() - user_cut_submitted = false - cb_calls = Int32[] - MOI.set(model, CPLEX.CallbackFunction(), (cb_data, cb_where) -> begin - push!(cb_calls, cb_where) - if cb_where != CPLEX.CPX_CALLBACKCONTEXT_RELAXATION - return - end - CPLEX.callbackgetrelaxationpoint(model, cb_data, cb_where) - terms = MOI.ScalarAffineTerm{Float64}[] - accumulated = 0.0 - for (i, xi) in enumerate(x) - if MOI.get(model, MOI.CallbackVariablePrimal(cb_data), xi) > 0.0 - push!(terms, MOI.ScalarAffineTerm(1.0, xi)) - accumulated += item_weights[i] - end - end - if accumulated > 10.0 - MOI.submit( - model, - MOI.UserCut(cb_data), - MOI.ScalarAffineFunction{Float64}(terms, 0.0), - MOI.LessThan{Float64}(length(terms) - 1) - ) - user_cut_submitted = true - end - end) - MOI.optimize!(model) - @test user_cut_submitted end - @testset "HeuristicSolution" begin - model, x, item_weights = callback_knapsack_model() - callback_called = false - cb_calls = Int32[] - MOI.set(model, CPLEX.CallbackFunction(), (cb_data, cb_where) -> begin - push!(cb_calls, cb_where) - if cb_where != CPLEX.CPX_CALLBACKCONTEXT_RELAXATION - return + MOI.set(model, CPLEX.CallbackFunction(), callback_function) + MOI.optimize!(model) + @test MOI.get(model, MOI.VariablePrimal(), x) == 1 + @test MOI.get(model, MOI.VariablePrimal(), y) == 2 + @test length(cb_calls) > 0 +end + +function test_CallbackFunction_UserCut() + model, x, item_weights = callback_knapsack_model() + user_cut_submitted = false + cb_calls = Clong[] + MOI.set(model, CPLEX.CallbackFunction(), (cb_data, cb_context) -> begin + push!(cb_calls, cb_context) + if cb_context != CPX_CALLBACKCONTEXT_RELAXATION + return + end + CPLEX.load_callback_variable_primal(cb_data, cb_context) + terms = MOI.ScalarAffineTerm{Float64}[] + accumulated = 0.0 + for (i, xi) in enumerate(x) + if MOI.get(model, MOI.CallbackVariablePrimal(cb_data), xi) > 0.0 + push!(terms, MOI.ScalarAffineTerm(1.0, xi)) + accumulated += item_weights[i] end - CPLEX.callbackgetrelaxationpoint(model, cb_data, cb_where) - x_vals = MOI.get.(model, MOI.CallbackVariablePrimal(cb_data), x) - @test MOI.submit( + end + if accumulated > 10.0 + MOI.submit( model, - MOI.HeuristicSolution(cb_data), - x, - floor.(x_vals) - ) == MOI.HEURISTIC_SOLUTION_UNKNOWN - callback_called = true - end) - MOI.optimize!(model) - @test callback_called + MOI.UserCut(cb_data), + MOI.ScalarAffineFunction{Float64}(terms, 0.0), + MOI.LessThan{Float64}(length(terms) - 1) + ) + user_cut_submitted = true + end + end) + MOI.optimize!(model) + @test user_cut_submitted +end + +function test_CallbackFunction_HeuristicSolution() + model, x, item_weights = callback_knapsack_model() + callback_called = false + cb_calls = Clong[] + MOI.set(model, CPLEX.CallbackFunction(), (cb_data, cb_context) -> begin + push!(cb_calls, cb_context) + if cb_context != CPX_CALLBACKCONTEXT_RELAXATION + return + end + CPLEX.load_callback_variable_primal(cb_data, cb_context) + x_vals = MOI.get.(model, MOI.CallbackVariablePrimal(cb_data), x) + @test MOI.submit( + model, + MOI.HeuristicSolution(cb_data), + x, + floor.(x_vals) + ) == MOI.HEURISTIC_SOLUTION_UNKNOWN + callback_called = true + end) + MOI.optimize!(model) + @test callback_called +end + +function runtests() + for name in names(@__MODULE__; all = true) + if !startswith("$(name)", "test_") + continue + end + @testset "$(name)" begin + getfield(@__MODULE__, name)() + end end end + +end # module TestCallbacks + +TestCallbacks.runtests() diff --git a/test/MathOptInterface/MOI_wrapper.jl b/test/MathOptInterface/MOI_wrapper.jl index f7f865a7..21ae15fe 100644 --- a/test/MathOptInterface/MOI_wrapper.jl +++ b/test/MathOptInterface/MOI_wrapper.jl @@ -207,36 +207,45 @@ end @testset "User-provided" begin env = CPLEX.Env() model_1 = CPLEX.Optimizer(env) - @test model_1.inner.env === env + @test model_1.env === env model_2 = CPLEX.Optimizer(env) - @test model_2.inner.env === env + @test model_2.env === env # Check that finalizer doesn't touch env when manually provided. - finalize(model_1.inner) - @test CPLEX.is_valid(env) + finalize(model_1) + @test env.ptr != C_NULL end @testset "Automatic" begin model_1 = CPLEX.Optimizer() model_2 = CPLEX.Optimizer() - @test model_1.inner.env !== model_2.inner.env + @test model_1.env.ptr !== model_2.env.ptr end @testset "Env when emptied" begin @testset "User-provided" begin env = CPLEX.Env() model = CPLEX.Optimizer(env) - @test model.inner.env === env - @test CPLEX.is_valid(env) + @test model.env === env + @test env.ptr != C_NULL MOI.empty!(model) - @test model.inner.env === env - @test CPLEX.is_valid(env) + @test model.env === env + @test env.ptr != C_NULL end @testset "Automatic" begin model = CPLEX.Optimizer() - env = model.inner.env + env = model.env MOI.empty!(model) - @test model.inner.env === env - @test CPLEX.is_valid(model.inner.env) + @test model.env === env + @test env.ptr != C_NULL end end + @testset "Manually finalize env and model" begin + env = CPLEX.Env() + model = CPLEX.Optimizer(env) + finalize(env) + @test env.finalize_called + finalize(model) + @test env.ptr == C_NULL + end + end @testset "Continuous -> Integer -> Continuous" begin diff --git a/test/MathProgBase/env.jl b/test/MathProgBase/env.jl deleted file mode 100644 index 55ee9dc1..00000000 --- a/test/MathProgBase/env.jl +++ /dev/null @@ -1,12 +0,0 @@ -@testset "Use loadproblem! twice" begin - solver = CplexSolver() - # Check that the env for each model is the same - m = MathProgBase.LinearQuadraticModel(solver) - env = m.inner.env - MathProgBase.loadproblem!(m, [1 0], [1, 1], [1, Inf], [1, 0], [0], [Inf], :Min) - @test m.inner.env === env - @test CPLEX.is_valid(env) - MathProgBase.loadproblem!(m, [0 1], [-Inf, 1], [1, 1], [0, 1], [-Inf], [0], :Min) - @test m.inner.env === env - @test CPLEX.is_valid(env) -end diff --git a/test/MathProgBase/mathprog.jl b/test/MathProgBase/mathprog.jl deleted file mode 100644 index 4194a1c8..00000000 --- a/test/MathProgBase/mathprog.jl +++ /dev/null @@ -1,24 +0,0 @@ -import MathProgBase - -math_prog_base_test_dir = joinpath(dirname(pathof(MathProgBase)), "..", "test") - -include(joinpath(math_prog_base_test_dir, "linprog.jl")) -linprogtest(CplexSolver(CPX_PARAM_PREIND=0, CPX_PARAM_LPMETHOD=2, CPX_PARAM_SCRIND=0)) - -include(joinpath(math_prog_base_test_dir, "mixintprog.jl")) -mixintprogtest(CplexSolver(CPX_PARAM_SCRIND=0)) - -include(joinpath(math_prog_base_test_dir, "quadprog.jl")) -quadprogtest(CplexSolver(CPX_PARAM_SCRIND=0)) -socptest(CplexSolver(CPX_PARAM_SCRIND=0)) - -solver = CplexSolver(CPX_PARAM_SCRIND=0) -CPLEX.setparameters!(solver, Silent=true, TimeLimit=100.0) -include(joinpath(math_prog_base_test_dir, "linproginterface.jl")) -linprogsolvertest(solver) - -include(joinpath(math_prog_base_test_dir, "conicinterface.jl")) -coniclineartest(CplexSolver(CPX_PARAM_SCRIND=0)) -conicSOCtest(CplexSolver(CPX_PARAM_SCRIND=0)) -conicSOCRotatedtest(CplexSolver(CPX_PARAM_SCRIND=0)) -conicSOCINTtest(CplexSolver(CPX_PARAM_SCRIND=0)) diff --git a/test/MathProgBase/miqcp.jl b/test/MathProgBase/miqcp.jl deleted file mode 100644 index 7185c00e..00000000 --- a/test/MathProgBase/miqcp.jl +++ /dev/null @@ -1,44 +0,0 @@ -# QCP example -# minimize x^2 -# -# s.t. x >= 0.1 -# x ∈ {0, 1} -# -# solution: (0.1) objv = 0.01 - -@testset "MIQCP" begin - @testset "MIQCP 01" begin - m = CPLEX.CplexMathProgModel(CPX_PARAM_SCRIND=0) - CPLEX.loadproblem!(m, Matrix{Float64}(undef, 0,1), [0.1], [Inf], [0], - Float64[], Float64[], :Min) - @test CPLEX.get_prob_type(m.inner) == :LP - MathProgBase.setquadobj!(m, reshape([2],(1,1))) - @test CPLEX.get_prob_type(m.inner) == :QP - MathProgBase.optimize!(m) - @test isapprox(CPLEX.getobjval(m), 0.5*0.1*2*0.1) - end - - @testset "MIQCP 02" begin - m = CPLEX.CplexMathProgModel(CPX_PARAM_SCRIND=0) - CPLEX.loadproblem!(m, Matrix{Float64}(undef, 0,1), [0.1], [Inf], [0], Float64[], Float64[], :Min) - @test CPLEX.get_prob_type(m.inner) == :LP - CPLEX.setvartype!(m, [:Bin]) - @test CPLEX.get_prob_type(m.inner) == :MILP - MathProgBase.setquadobj!(m, reshape([2],(1,1))) - @test CPLEX.get_prob_type(m.inner) == :MIQP - MathProgBase.optimize!(m) - @test isapprox(CPLEX.getobjval(m), 0.5*1*2*1) - end - - @testset "MIQCP 03" begin - m = CPLEX.CplexMathProgModel(CPX_PARAM_SCRIND=0) - CPLEX.loadproblem!(m, Matrix{Float64}(undef, 0,1), [0.1], [Inf], [0], Float64[], Float64[], :Min) - @test CPLEX.get_prob_type(m.inner) == :LP - MathProgBase.setquadobj!(m, reshape([2],(1,1))) - @test CPLEX.get_prob_type(m.inner) == :QP - CPLEX.setvartype!(m, [:Bin]) - @test CPLEX.get_prob_type(m.inner) == :MIQP - MathProgBase.optimize!(m) - @test isapprox(CPLEX.getobjval(m), 0.5*1*2*1) - end -end diff --git a/test/MathProgBase/problemtype.jl b/test/MathProgBase/problemtype.jl deleted file mode 100644 index 49c8bf00..00000000 --- a/test/MathProgBase/problemtype.jl +++ /dev/null @@ -1,22 +0,0 @@ - -@testset "Changing variable type" begin - # linear -> mixed integer -> linear - m = CPLEX.CplexMathProgModel(CPX_PARAM_SCRIND=0) - CPLEX.loadproblem!(m, [1 1; 1 0], [0, 0], [Inf, 1], [1, 2], [1.33, -Inf], [Inf, 0.5], :Min) - - @test CPLEX.get_prob_type(m.inner) == :LP - MathProgBase.optimize!(m) - @test CPLEX.getsolution(m) ≈ [0.5, 0.83] - - CPLEX.setvartype!(m, [:Cont, :Bin]) - - @test CPLEX.get_prob_type(m.inner) == :MILP - MathProgBase.optimize!(m) - @test CPLEX.getsolution(m) ≈ [0.33, 1] - - CPLEX.setvartype!(m, [:Cont, :Cont]) - - @test CPLEX.get_prob_type(m.inner) == :LP - MathProgBase.optimize!(m) - @test CPLEX.getsolution(m) ≈ [0.5, 0.83] -end diff --git a/test/MathProgBase/sos.jl b/test/MathProgBase/sos.jl deleted file mode 100644 index 80a3f3c9..00000000 --- a/test/MathProgBase/sos.jl +++ /dev/null @@ -1,52 +0,0 @@ -@testset "SOS" begin - @testset "SOS 01" begin - m = CPLEX.CplexMathProgModel(CPX_PARAM_SCRIND=0) - CPLEX.loadproblem!(m, - [1 2 3 0 0 0 0 0 -1 0; 0 0 0 5 4 7 2 1 0 -1], # constraint matrix - [0, 0, 0, 0, 0, 0, 0, 0, -Inf, -Inf], # variable lb - [2, 2, 2, 2, 2, 2, 2, 2, Inf, Inf], # variable ub - vcat(zeros(8), ones(2)), # objective vector - [0, 0], # constraint lb - [0, 0], # constraint ub - :Max) - @test CPLEX.get_prob_type(m.inner) == :LP - - CPLEX.setvartype!(m, vcat(fill(:Bin, 8), fill(:Cont, 2))) - @test CPLEX.get_prob_type(m.inner) == :MILP - - CPLEX.addsos1!(m, [1,2,3], [1.0,2.0,3.0]) - CPLEX.addsos2!(m, [4,5,6,7,8], [5.0, 4.0, 7.0, 2.0, 1.0]) - @test CPLEX.get_prob_type(m.inner) == :MILP - - MathProgBase.optimize!(m) - - @test CPLEX.getobjval(m) ≈ 15.0 - sol = CPLEX.getsolution(m) - @test sol[9] ≈ 3.0 - @test sol[10] ≈ 12.0 - - CPLEX.setvartype!(m, fill(:Cont, 10)) - @test CPLEX.get_prob_type(m.inner) == :MILP - - MathProgBase.optimize!(m) - - @test CPLEX.getobjval(m) ≈ 30.0 - sol = CPLEX.getsolution(m) - @test sol[9] ≈ 6.0 - @test sol[10] ≈ 24.0 - end - - @testset "SOS 02" begin - m = CPLEX.CplexMathProgModel(CPX_PARAM_SCRIND=0) - CPLEX.loadproblem!(m, Matrix{Float64}(undef, 0,3), [-Inf, -Inf, -Inf], - [1,1,2], [2,1,1], Float64[], Float64[], :Max) - @test CPLEX.get_prob_type(m.inner) == :LP - - CPLEX.addsos1!(m, [1,2], [1.0,2.0]) - CPLEX.addsos1!(m, [1,3], [1.0,2.0]) - @test CPLEX.get_prob_type(m.inner) == :MILP - - MathProgBase.optimize!(m) - @test CPLEX.getobjval(m) ≈ 3.0 - end -end diff --git a/test/runtests.jl b/test/runtests.jl index 2d461403..a5f645f7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,10 +1,14 @@ using Test -import Pkg -using MathProgBase -using CPLEX -@testset "$folder" for folder in ["C_API", "MathProgBase", "MathOptInterface"] - @testset "$(file)" for file in readdir(folder) - include(joinpath(folder, file)) - end +include("MathOptInterface/MOI_wrapper.jl") +include("MathOptInterface/MOI_callbacks.jl") + +using CPLEX +@testset "Deprecated functions" begin + err = ErrorException(CPLEX._DEPRECATED_ERROR_MESSAGE) + @test_throws err newlongannotation() + @test_throws err CPLEX.get_status() + model = CPLEX.Optimizer() + @test_throws err model.inner + @test model.lp isa Ptr{Cvoid} end