Skip to content

Commit 26f7557

Browse files
authored
update to 1.0 (#61)
* update to 1.0 * update julia versions
1 parent e5a6d32 commit 26f7557

File tree

10 files changed

+72
-30
lines changed

10 files changed

+72
-30
lines changed

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/julia
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=julia
4+
5+
### Julia ###
6+
# Files generated by invoking Julia with --code-coverage
7+
*.jl.cov
8+
*.jl.*.cov
9+
10+
# Files generated by invoking Julia with --track-allocation
11+
*.jl.mem
12+
13+
# System-specific files and directories generated by the BinaryProvider and BinDeps packages
14+
# They contain absolute paths specific to the host computer, and so should not be committed
15+
deps/deps.jl
16+
deps/build.log
17+
deps/downloads/
18+
deps/usr/
19+
deps/src/
20+
21+
# Build artifacts for creating documentation generated by the Documenter package
22+
docs/build/
23+
docs/site/
24+
25+
# File generated by Pkg, the package manager, based on a corresponding Project.toml
26+
# It records a fixed state of all packages used by the project. As such, it should not be
27+
# committed for packages, but should be committed for applications that require a static
28+
# environment.
29+
Manifest.toml
30+
31+
# End of https://www.toptal.com/developers/gitignore/api/julia

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 0.6
7-
- 0.7
86
- 1.0
7+
- 1
98
notifications:
109
email: false
1110
sudo: false # use a docker worker

Project.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name = "GLPKMathProgInterface"
2+
uuid = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
3+
version = "0.5.0"
4+
5+
[deps]
6+
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8+
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
9+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
10+
11+
[compat]
12+
GLPK = "0.6,0.7,0.8,0.9,0.10,0.11,0.12,0.13"
13+
MathProgBase = "0.5,0.7,0.8"
14+
julia = "1"
15+
16+
[extras]
17+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
18+
19+
[targets]
20+
test = ["Test"]

REQUIRE

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/GLPKInterfaceBase.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module GLPKInterfaceBase
22

3-
using Compat
4-
using Compat.SparseArrays
5-
using Compat.LinearAlgebra
3+
using SparseArrays
4+
using LinearAlgebra
65
import GLPK
76

87
import MathProgBase

src/GLPKInterfaceLP.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module GLPKInterfaceLP
22

3-
using Compat
4-
using Compat.SparseArrays
5-
using Compat.LinearAlgebra
3+
using SparseArrays
4+
using LinearAlgebra
65

76
import GLPK
87
import MathProgBase
@@ -52,7 +51,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverLP)
5251
elseif s.method == :InteriorPoint
5352
param = GLPK.InteriorParam()
5453
if s.presolve
55-
Compat.@warn("Ignored option: presolve")
54+
@warn "Ignored option: presolve"
5655
end
5756
else
5857
error("This is a bug")
@@ -64,7 +63,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverLP)
6463
t = typeof(param).types[i]
6564
setfield!(param, i, convert(t, v))
6665
else
67-
Compat.@warn("Ignored option: $(string(k))")
66+
@warn "Ignored option: $(string(k))"
6867
end
6968
end
7069
lpm = GLPKMathProgModelLP(GLPK.Prob(), s.method, param, false)

src/GLPKInterfaceMIP.jl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import GLPK
44
import MathProgBase
55
const MPB = MathProgBase
66
using ..GLPKInterfaceBase
7-
using Compat
8-
using Compat.SparseArrays
9-
using Compat.LinearAlgebra
7+
using SparseArrays
8+
using LinearAlgebra
109

1110
export GLPKSolverMIP, GLPKCallbackData
1211

@@ -41,14 +40,14 @@ function Base.copy(m::GLPKMathProgModelMIP)
4140
m2.param = deepcopy(m.param)
4241
m2.smplxparam = deepcopy(m.smplxparam)
4342

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"
43+
m.lazycb == nothing || @warn "Callbacks can't be copied, lazy callback ignored"
44+
m.cutcb == nothing || @warn "Callbacks can't be copied, cut callback ignored"
45+
m.heuristiccb == nothing || @warn "Callbacks can't be copied, heuristic callback ignored"
46+
m.infocb == nothing || @warn "Callbacks can't be copied, info callback ignored"
4847

4948
m2.objbound = m.objbound
5049

51-
m.cbdata == nothing || @Compat.warn "Callbacks can't be copied, callbackdata ignored"
50+
m.cbdata == nothing || @warn "Callbacks can't be copied, callbackdata ignored"
5251

5352
m2.binaries = deepcopy(m.binaries)
5453
m2.userlimit = m.userlimit
@@ -165,7 +164,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverMIP)
165164

166165
for (k,v) in s.opts
167166
if k in [:cb_func, :cb_info]
168-
Compat.@warn("ignored option: $(string(k)); use the MathProgBase callback interface instead")
167+
@warn "ignored option: $(string(k)); use the MathProgBase callback interface instead"
169168
continue
170169
end
171170
i = findfirst(x->x==k, fieldnames(typeof(lpm.param)))
@@ -177,7 +176,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverMIP)
177176
t = typeof(lpm.smplxparam).types[s]
178177
setfield!(lpm.smplxparam, s, convert(t, v))
179178
else
180-
Compat.@warn("Ignored option: $(string(k))")
179+
@warn "Ignored option: $(string(k))"
181180
continue
182181
end
183182
end
@@ -364,7 +363,7 @@ function MPB.cbaddsolution!(d::GLPKCallbackData)
364363
u = MPB.getvarUB(d.model)
365364
for i in 1:length(l)
366365
if d.sol[i] < l[i] - 1e-6 || d.sol[i] > u[i] + 1e-6
367-
Compat.@warn("Ignoring infeasible solution from heuristic callback")
366+
@warn "Ignoring infeasible solution from heuristic callback"
368367
return
369368
end
370369
end
@@ -374,7 +373,7 @@ function MPB.cbaddsolution!(d::GLPKCallbackData)
374373
y = A*d.sol
375374
for i in 1:length(lb)
376375
if y[i] < lb[i] - 1e-6 || y[i] > ub[i] + 1e-6
377-
Compat.@warn("Ignoring infeasible solution from heuristic callback")
376+
@warn "Ignoring infeasible solution from heuristic callback"
378377
return
379378
end
380379
end

test/mathprog.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import Compat.Pkg
1+
const mathprogbase_test = joinpath(dirname(pathof(MathProgBase)), "..", "test")
22

33
@testset "MathProgBase tests" begin
4-
mathprogbase_test = joinpath(Pkg.dir("MathProgBase"), "test")
54

65
include(joinpath(mathprogbase_test, "linprog.jl"))
76
linprogtest(GLPKSolverLP())

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using GLPKMathProgInterface, GLPK
22
using MathProgBase
3-
using Compat.Test
3+
using Test
44

55
include("params.jl")
66
include("setbounds.jl")

test/setbounds.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using GLPKMathProgInterface, MathProgBase
2-
using Compat.Test
2+
using Test
33

44
@testset "Invalid bounds" begin
55
solver = GLPKSolverLP()

0 commit comments

Comments
 (0)