Skip to content

Commit

Permalink
Merge pull request #203 from JuliaOpt/fbot/deps
Browse files Browse the repository at this point in the history
Fix deprecations
  • Loading branch information
mlubin authored Nov 12, 2017
2 parents 56e0524 + e3b5c24 commit af57074
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/HighLevelInterface/linprog.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type LinprogSolution
mutable struct LinprogSolution
status
objval
sol
Expand Down
2 changes: 1 addition & 1 deletion src/HighLevelInterface/mixintprog.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

type MixintprogSolution
mutable struct MixintprogSolution
status
objval
sol
Expand Down
2 changes: 1 addition & 1 deletion src/HighLevelInterface/quadprog.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

type QuadprogSolution
mutable struct QuadprogSolution
status
objval
sol
Expand Down
6 changes: 3 additions & 3 deletions src/SolverInterface/conic_to_lpqp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To enable LPQP support from a Conic solver, define, e.g.,
# LinearQuadraticModel(s::ECOSSolver) = ConicToLPQPBridge(ConicModel(s))

type ConicToLPQPBridge <: AbstractLinearQuadraticModel
mutable struct ConicToLPQPBridge <: AbstractLinearQuadraticModel
m::AbstractConicModel
A::SparseMatrixCSC{Float64,Int}
collb::Vector{Float64}
Expand Down Expand Up @@ -303,13 +303,13 @@ end
function setsense!(wrap::ConicToLPQPBridge, sense)
wrap.sense = sense
end
function addvar!{T<:Integer}(wrap::ConicToLPQPBridge, constridx::AbstractArray{T}, constrcoef, l, u, objcoef)
function addvar!(wrap::ConicToLPQPBridge, constridx::AbstractArray{T}, constrcoef, l, u, objcoef) where T<:Integer
wrap.A = [wrap.A sparsevec(constridx, constrcoef, size(wrap.A, 1))]
push!(wrap.collb, l)
push!(wrap.colub, u)
push!(wrap.obj, objcoef)
end
function addconstr!{T<:Integer}(wrap::ConicToLPQPBridge, varidx::AbstractArray{T}, coef, lb, ub)
function addconstr!(wrap::ConicToLPQPBridge, varidx::AbstractArray{T}, coef, lb, ub) where T<:Integer
wrap.A = [wrap.A; sparsevec(varidx, coef, size(wrap.A, 2))']
push!(wrap.rowlb, lb)
push!(wrap.rowub, ub)
Expand Down
4 changes: 2 additions & 2 deletions src/SolverInterface/lpqp_to_conic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Must also implement supportedcones(). List SOC as a supported cone if it can
# be passed as a quadratic constraint.

type LPQPtoConicBridge <: AbstractConicModel
mutable struct LPQPtoConicBridge <: AbstractConicModel
lpqpmodel::AbstractLinearQuadraticModel
qcp::Bool
c
Expand Down Expand Up @@ -276,7 +276,7 @@ for f in methods_by_tag[:rewrap]
@eval $f(model::LPQPtoConicBridge) = $f(model.lpqpmodel)
end

type LPQPWrapperCallbackData <: MathProgCallbackData
mutable struct LPQPWrapperCallbackData <: MathProgCallbackData
lpqpcb::MathProgCallbackData
model::LPQPtoConicBridge
solvec::Vector{Float64}
Expand Down
6 changes: 3 additions & 3 deletions src/SolverInterface/nonlinear_to_lpqp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To enable LPQP support from a Nonlinear solver, define, e.g.,
# LinearQuadraticModel(s::IpoptSolver) = NonlinearToLPQPBridge(NonlinearModel(s))

type QuadConstr
mutable struct QuadConstr
linearidx::Vector{Int}
linearval::Vector{Float64}
quadrowidx::Vector{Int}
Expand All @@ -14,7 +14,7 @@ type QuadConstr
end
getdata(q::QuadConstr) = q.linearidx, q.linearval, q.quadrowidx, q.quadcolidx, q.quadval

type NonlinearToLPQPBridge <: AbstractLinearQuadraticModel
mutable struct NonlinearToLPQPBridge <: AbstractLinearQuadraticModel
nlpmodel::AbstractNonlinearModel
LPdata
Qobj::Tuple{Vector{Int},Vector{Int},Vector{Float64}}
Expand Down Expand Up @@ -105,7 +105,7 @@ function getquadconstrduals(model::NonlinearToLPQPBridge)
return du[(numlinconstr(model)+1):end]
end

type LPQPEvaluator <: AbstractNLPEvaluator
mutable struct LPQPEvaluator <: AbstractNLPEvaluator
A::SparseMatrixCSC{Float64,Int}
c::Vector{Float64}
Qi::Vector{Int} # quadratic objective terms
Expand Down
8 changes: 4 additions & 4 deletions test/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using MathProgBase

# Here the type represents the complete instance, but it
# could also store instance data.
type HS071 <: MathProgBase.AbstractNLPEvaluator
mutable struct HS071 <: MathProgBase.AbstractNLPEvaluator
end

# hs071
Expand Down Expand Up @@ -121,7 +121,7 @@ function nlptest(solver)
end

# Same as above but no hessian callback
type HS071_2 <: MathProgBase.AbstractNLPEvaluator
mutable struct HS071_2 <: MathProgBase.AbstractNLPEvaluator
end

# hs071
Expand Down Expand Up @@ -188,7 +188,7 @@ end

# a test for convex nonlinear solvers

type QCQP <: MathProgBase.AbstractNLPEvaluator
mutable struct QCQP <: MathProgBase.AbstractNLPEvaluator
end

# min x - y
Expand Down Expand Up @@ -271,7 +271,7 @@ end

# a test for unconstrained nonlinear solvers

type Rosenbrock <: MathProgBase.AbstractNLPEvaluator
mutable struct Rosenbrock <: MathProgBase.AbstractNLPEvaluator
end

# min (1-x)^2 + 100*(y-x^2)^2
Expand Down

0 comments on commit af57074

Please sign in to comment.