JuMP and MOI utilities

These functions act on JuMP and MathOptInterface structures to be able to implement OCTHaGOn.

Main.OCTHaGOn.bound!Function
bound!(model::JuMP.Model, bound::Pair)
bound!(model::JuMP.Model, bounds::Dict)
bound!(model::GlobalModel, bounds::Union{Pair,Dict})

Adds outer bounds to JuMP Model from Dict or Pair of data.

source
Main.OCTHaGOn.bounded_auxFunction
bounded_aux(x::Array{JuMP.VariableRef}, binary_var::JuMP.VariableRef)
bounded_aux(x::Array{JuMP.VariableRef}, y::JuMP.VariableRef, binary_var::JuMP.VariableRef)

Generates binary-bounded auxiliary variables and their bounding constraints of the same size as x + y.

source
Main.OCTHaGOn.distance_to_setFunction
distance_to_set(val::Union{Array{<:Real},<:Real}, set::MOI.AbstractSet)

Wrapper around MathOptSetDistances.distancetoset. Distance 0 if val ∈ set. Otherwise, returns Float64.

source
Main.OCTHaGOn.fetch_variableFunction
fetch_variable(model::JuMP.Model, varkey::Union{Symbol, String, VariableRef, Array})

Returns JuMP.VariableRefs that match a given Symbol, String, VariableRef, or array of these.

source
Main.OCTHaGOn.get_boundsFunction
get_bounds(var::JuMP.VariableRef})
get_bounds(vars::Array{JuMP.VariableRef})

Returns bounds of JuMP variables.

source
get_bounds(model::Union{Model, BlackBoxClassifier, BlackBoxRegressor, GlobalModel, Array{Union{BlackBoxClassifier, BlackBoxRegressor},N} where N}) -> Union{Pair{VariableRef,Array{Float64,1}}, Dict{_A,_B} where _B where _A}

Returns bounds of all variables.

source
Main.OCTHaGOn.get_unboundsFunction
get_unbounds(var::JuMP.VariableRef)
get_unbounds(vars::Array{VariableRef})
get_unbounds(gm::Union{JuMP.Model, GlobalModel})

Returns variables with no lower and/or upper bounds.

source
get_unbounds(model::Union{Model, BlackBoxClassifier, BlackBoxRegressor, GlobalModel, Array{Union{BlackBoxClassifier, BlackBoxRegressor},N} where N}) -> Union{Nothing, Dict{Any,Any}, Pair{VariableRef,Array{Float64,1}}}

Returns only unbounded variables.

source
Main.OCTHaGOn.restrict_to_setFunction
restrict_to_set(var::JuMP.VariableRef, s::Union{Set, Array})

Restricts variable to a set s. Useful for non-integer sets or when taking log of integer variables.

source
Main.OCTHaGOn.vars_from_constraintFunction
vars_from_constraint(con::JuMP.ConstraintRef)

Returns the JuMP Variables that are associated with a JuMP.ConstraintRef. Note: Currently only works for affine and quadratic constraints.

source

The following functions extend JuMP functions to act on OCTHaGOn's structs.

JuMP.all_variablesFunction
JuMP.all_variables(bbo::Union{GlobalModel, BlackBoxLearner})
JuMP.all_variables(bbls::Array{BlackBoxLearner})

Extends JuMP.all_variables to GlobalModels and BlackBoxLearners. TODO: add ability to add variables to GlobalModels.

source