Skip to content

Commit

Permalink
Merge 63e3a7d into 68793fb
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Dec 17, 2018
2 parents 68793fb + 63e3a7d commit eb9c3c6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/JuMP.jl
Expand Up @@ -43,6 +43,16 @@ export
@objective, @NLobjective,
@NLparameter, @constraintref

# Deprecations for JuMP v0.18 -> JuMP v0.19 transition
Base.@deprecate(getobjectivevalue, JuMP.objective_value)
Base.@deprecate(getobjectivebound, JuMP.objective_bound)
Base.@deprecate(getvalue, JuMP.value)
Base.@deprecate(getdual, JuMP.dual)
Base.@deprecate(numvar, JuMP.num_variables)
Base.@deprecate(numnlconstr, JuMP.num_nl_constraints)
Base.@deprecate(setlowerbound, JuMP.set_lower_bound)
Base.@deprecate(setupperbound, JuMP.set_upper_bound)
Base.@deprecate(linearterms, JuMP.linear_terms)

include("utils.jl")

Expand Down
11 changes: 11 additions & 0 deletions src/optimizer_interface.jl
Expand Up @@ -53,6 +53,17 @@ function set_optimizer(model::Model, optimizer_factory::OptimizerFactory;
MOIU.resetoptimizer!(model, optimizer)
end

# Deprecation for JuMP v0.18 -> JuMP v0.19 transition
export solve
function solve(::Model)
error("`solve` has been replaced by `JuMP.optimize!`. Note that `solve` " *
"used to return a `Symbol` summarizing the solution while " *
"`JuMP.optimize!` returns nothing and the status of the solution " *
"is queried using `JuMP.termination_status`, `JuMP.primal_status` " *
"and `JuMP.dual_status`.")
end


"""
optimize!(model::Model,
optimizer_factory::Union{Nothing, OptimizerFactory}=nothing;
Expand Down
9 changes: 9 additions & 0 deletions src/sets.jl
Expand Up @@ -58,3 +58,12 @@ julia> @constraint(model, [t, x, x-1, x-2] in RotatedSecondOrderCone())
"""
struct RotatedSecondOrderCone <: AbstractVectorSet end
moi_set(::RotatedSecondOrderCone, dim::Int) = MOI.RotatedSecondOrderCone(dim)

# Deprecation for JuMP v0.18 -> JuMP v0.19 transition
function LinearAlgebra.norm(::AbstractVector{<:AbstractJuMPScalar})
error("JuMP no longer performs automatic transformation of `norm()` ",
"expressions into second-order cone constraints. They should now ",
"be expressed using the SecondOrderCone() set. For example, ",
"`@constraint(model, norm(x) <= t)` should now be written as ",
"`@constraint(model, [t; x] in SecondOrderCone())`")
end

0 comments on commit eb9c3c6

Please sign in to comment.