Skip to content

Commit af57074

Browse files
authored
Merge pull request #203 from JuliaOpt/fbot/deps
Fix deprecations
2 parents 56e0524 + e3b5c24 commit af57074

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/HighLevelInterface/linprog.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type LinprogSolution
1+
mutable struct LinprogSolution
22
status
33
objval
44
sol

src/HighLevelInterface/mixintprog.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
type MixintprogSolution
2+
mutable struct MixintprogSolution
33
status
44
objval
55
sol

src/HighLevelInterface/quadprog.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
type QuadprogSolution
2+
mutable struct QuadprogSolution
33
status
44
objval
55
sol

src/SolverInterface/conic_to_lpqp.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# To enable LPQP support from a Conic solver, define, e.g.,
44
# LinearQuadraticModel(s::ECOSSolver) = ConicToLPQPBridge(ConicModel(s))
55

6-
type ConicToLPQPBridge <: AbstractLinearQuadraticModel
6+
mutable struct ConicToLPQPBridge <: AbstractLinearQuadraticModel
77
m::AbstractConicModel
88
A::SparseMatrixCSC{Float64,Int}
99
collb::Vector{Float64}
@@ -303,13 +303,13 @@ end
303303
function setsense!(wrap::ConicToLPQPBridge, sense)
304304
wrap.sense = sense
305305
end
306-
function addvar!{T<:Integer}(wrap::ConicToLPQPBridge, constridx::AbstractArray{T}, constrcoef, l, u, objcoef)
306+
function addvar!(wrap::ConicToLPQPBridge, constridx::AbstractArray{T}, constrcoef, l, u, objcoef) where T<:Integer
307307
wrap.A = [wrap.A sparsevec(constridx, constrcoef, size(wrap.A, 1))]
308308
push!(wrap.collb, l)
309309
push!(wrap.colub, u)
310310
push!(wrap.obj, objcoef)
311311
end
312-
function addconstr!{T<:Integer}(wrap::ConicToLPQPBridge, varidx::AbstractArray{T}, coef, lb, ub)
312+
function addconstr!(wrap::ConicToLPQPBridge, varidx::AbstractArray{T}, coef, lb, ub) where T<:Integer
313313
wrap.A = [wrap.A; sparsevec(varidx, coef, size(wrap.A, 2))']
314314
push!(wrap.rowlb, lb)
315315
push!(wrap.rowub, ub)

src/SolverInterface/lpqp_to_conic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Must also implement supportedcones(). List SOC as a supported cone if it can
66
# be passed as a quadratic constraint.
77

8-
type LPQPtoConicBridge <: AbstractConicModel
8+
mutable struct LPQPtoConicBridge <: AbstractConicModel
99
lpqpmodel::AbstractLinearQuadraticModel
1010
qcp::Bool
1111
c
@@ -276,7 +276,7 @@ for f in methods_by_tag[:rewrap]
276276
@eval $f(model::LPQPtoConicBridge) = $f(model.lpqpmodel)
277277
end
278278

279-
type LPQPWrapperCallbackData <: MathProgCallbackData
279+
mutable struct LPQPWrapperCallbackData <: MathProgCallbackData
280280
lpqpcb::MathProgCallbackData
281281
model::LPQPtoConicBridge
282282
solvec::Vector{Float64}

src/SolverInterface/nonlinear_to_lpqp.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# To enable LPQP support from a Nonlinear solver, define, e.g.,
44
# LinearQuadraticModel(s::IpoptSolver) = NonlinearToLPQPBridge(NonlinearModel(s))
55

6-
type QuadConstr
6+
mutable struct QuadConstr
77
linearidx::Vector{Int}
88
linearval::Vector{Float64}
99
quadrowidx::Vector{Int}
@@ -14,7 +14,7 @@ type QuadConstr
1414
end
1515
getdata(q::QuadConstr) = q.linearidx, q.linearval, q.quadrowidx, q.quadcolidx, q.quadval
1616

17-
type NonlinearToLPQPBridge <: AbstractLinearQuadraticModel
17+
mutable struct NonlinearToLPQPBridge <: AbstractLinearQuadraticModel
1818
nlpmodel::AbstractNonlinearModel
1919
LPdata
2020
Qobj::Tuple{Vector{Int},Vector{Int},Vector{Float64}}
@@ -105,7 +105,7 @@ function getquadconstrduals(model::NonlinearToLPQPBridge)
105105
return du[(numlinconstr(model)+1):end]
106106
end
107107

108-
type LPQPEvaluator <: AbstractNLPEvaluator
108+
mutable struct LPQPEvaluator <: AbstractNLPEvaluator
109109
A::SparseMatrixCSC{Float64,Int}
110110
c::Vector{Float64}
111111
Qi::Vector{Int} # quadratic objective terms

test/nlp.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using MathProgBase
33

44
# Here the type represents the complete instance, but it
55
# could also store instance data.
6-
type HS071 <: MathProgBase.AbstractNLPEvaluator
6+
mutable struct HS071 <: MathProgBase.AbstractNLPEvaluator
77
end
88

99
# hs071
@@ -121,7 +121,7 @@ function nlptest(solver)
121121
end
122122

123123
# Same as above but no hessian callback
124-
type HS071_2 <: MathProgBase.AbstractNLPEvaluator
124+
mutable struct HS071_2 <: MathProgBase.AbstractNLPEvaluator
125125
end
126126

127127
# hs071
@@ -188,7 +188,7 @@ end
188188

189189
# a test for convex nonlinear solvers
190190

191-
type QCQP <: MathProgBase.AbstractNLPEvaluator
191+
mutable struct QCQP <: MathProgBase.AbstractNLPEvaluator
192192
end
193193

194194
# min x - y
@@ -271,7 +271,7 @@ end
271271

272272
# a test for unconstrained nonlinear solvers
273273

274-
type Rosenbrock <: MathProgBase.AbstractNLPEvaluator
274+
mutable struct Rosenbrock <: MathProgBase.AbstractNLPEvaluator
275275
end
276276

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

0 commit comments

Comments
 (0)