Skip to content

Commit 0063973

Browse files
authored
compat fixes for julia 1.0 (#54)
1 parent fdad2fb commit 0063973

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/GLPKInterfaceMIP.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ function Base.copy(m::GLPKMathProgModelMIP)
4141
m2.param = deepcopy(m.param)
4242
m2.smplxparam = deepcopy(m.smplxparam)
4343

44-
m.lazycb == nothing || Base.warn_once("Callbacks can't be copied, lazy callback ignored")
45-
m.cutcb == nothing || Base.warn_once("Callbacks can't be copied, cut callback ignored")
46-
m.heuristiccb == nothing || Base.warn_once("Callbacks can't be copied, heuristic callback ignored")
47-
m.infocb == nothing || Base.warn_once("Callbacks can't be copied, info callback ignored")
44+
m.lazycb == nothing || @Compat.warn "Callbacks can't be copied, lazy callback ignored"
45+
m.cutcb == nothing || @Compat.warn "Callbacks can't be copied, cut callback ignored"
46+
m.heuristiccb == nothing || @Compat.warn "Callbacks can't be copied, heuristic callback ignored"
47+
m.infocb == nothing || @Compat.warn "Callbacks can't be copied, info callback ignored"
4848

4949
m2.objbound = m.objbound
5050

51-
m.cbdata == nothing || Base.warn_once("Callbacks can't be copied, callbackdata ignored")
51+
m.cbdata == nothing || @Compat.warn "Callbacks can't be copied, callbackdata ignored"
5252

5353
m2.binaries = deepcopy(m.binaries)
5454
m2.userlimit = m.userlimit
@@ -243,7 +243,7 @@ function MPB.cbgetlpsolution(d::GLPKCallbackData)
243243
_check_tree(d, "cbgetlpsolution")
244244
lp = GLPK.ios_get_prob(d.tree)
245245
n = GLPK.get_num_cols(lp)
246-
output = Vector{Float64}(n)
246+
output = Vector{Float64}(undef, n)
247247

248248
for c = 1:n
249249
output[c] = GLPK.get_col_prim(lp, c)

0 commit comments

Comments
 (0)