From f4a9604c7d65d3112bd331b59d01c9936067a241 Mon Sep 17 00:00:00 2001 From: Carlo Baldassi Date: Mon, 24 Apr 2017 16:27:53 +0200 Subject: [PATCH] Fix deprecation warnings on Julia 0.6 --- REQUIRE | 1 + src/GLPKInterfaceBase.jl | 7 ++++--- src/GLPKInterfaceLP.jl | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/REQUIRE b/REQUIRE index 34c747d..6fe9c54 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,3 +1,4 @@ julia 0.5 GLPK 0.2.8 MathProgBase 0.5 0.7 +Compat 0.17.0 diff --git a/src/GLPKInterfaceBase.jl b/src/GLPKInterfaceBase.jl index 8786aff..0252be6 100644 --- a/src/GLPKInterfaceBase.jl +++ b/src/GLPKInterfaceBase.jl @@ -1,5 +1,6 @@ module GLPKInterfaceBase +using Compat import GLPK importall MathProgBase.SolverInterface @@ -28,7 +29,7 @@ export getrawsolver -abstract GLPKMathProgModel <: AbstractLinearQuadraticModel +@compat abstract type GLPKMathProgModel <: AbstractLinearQuadraticModel end function loadproblem!(lpm::GLPKMathProgModel, filename::AbstractString) if endswith(filename, ".mps") || endswith(filename, ".mps.gz") @@ -393,7 +394,7 @@ function addvar!(lpm::GLPKMathProgModel, rowidx::Vector, rowcoef::Vector, collb: return end -function delvars!(lpm::GLPKMathProgModel, idx::Vector) +function delvars!(lpm::GLPKMathProgModel, idx::Vector) GLPK.std_basis(lpm.inner) GLPK.del_cols(lpm.inner, length(idx), idx) end @@ -423,7 +424,7 @@ function addconstr!(lpm::GLPKMathProgModel, colidx::Vector, colcoef::Vector, row return end -function delconstrs!(lpm::GLPKMathProgModel, idx::Vector) +function delconstrs!(lpm::GLPKMathProgModel, idx::Vector) GLPK.std_basis(lpm.inner) GLPK.del_rows(lpm.inner, length(idx), idx) end diff --git a/src/GLPKInterfaceLP.jl b/src/GLPKInterfaceLP.jl index cee0f35..87dec2e 100644 --- a/src/GLPKInterfaceLP.jl +++ b/src/GLPKInterfaceLP.jl @@ -1,5 +1,7 @@ module GLPKInterfaceLP +using Compat + import GLPK importall MathProgBase.SolverInterface importall ..GLPKInterfaceBase @@ -394,7 +396,7 @@ function getunboundedray(lpm::GLPKMathProgModelLP) ri > m && (ray[ri - m] = rv) end - if (GLPK.get_obj_dir(lp) == GLPK.MAX) $ (get_dual(lp, k) > 0) + if (GLPK.get_obj_dir(lp) == GLPK.MAX) ⊻ (get_dual(lp, k) > 0) scale!(ray, -1.0) end else