Skip to content

Commit

Permalink
Merge pull request #41 from JuliaOpt/cb/fixdepwarns
Browse files Browse the repository at this point in the history
Fix deprecation warnings on Julia 0.6
  • Loading branch information
mlubin authored Apr 24, 2017
2 parents ae65225 + f4a9604 commit 13677a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
julia 0.5
GLPK 0.2.8
MathProgBase 0.5 0.7
Compat 0.17.0
7 changes: 4 additions & 3 deletions src/GLPKInterfaceBase.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module GLPKInterfaceBase

using Compat
import GLPK

importall MathProgBase.SolverInterface
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/GLPKInterfaceLP.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module GLPKInterfaceLP

using Compat

import GLPK
importall MathProgBase.SolverInterface
importall ..GLPKInterfaceBase
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 13677a1

Please sign in to comment.