Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Manifest.toml
*.json
perf/Project.toml
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name = "GLPK"
uuid = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
repo = "https://github.com/JuliaOpt/GLPK.jl.git"
version = "0.10.0"
version = "0.11.0"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinQuadOptInterface = "f8899e07-120b-5979-ab1d-7b97bb9e1a48"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
BinaryProvider = "≥ 0.3.0"
LinQuadOptInterface = "0.6"
MathOptInterface = "0.9"
julia = "1"

[extras]
Expand Down
50 changes: 29 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
Julia GLPK module
=================
# GLPK.jl


| **Documentation** | **Build Status** |
|:-------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------:|
| [![][docs-stable-img]][docs-stable-url] [![][docs-latest-img]][docs-latest-url] | [![][travis-img]][travis-url] [![][appveyor-img]][appveyor-url] [![][coveralls-img]][coveralls-url] |
| **Build Status** |
|:---------------------------------------------------------------------------------------------------:|
| [![][travis-img]][travis-url] [![][appveyor-img]][appveyor-url] [![][coveralls-img]][coveralls-url] |


GLPK.jl is a wrapper for the [GNU Linear Programming Kit library](http://www.gnu.org/software/glpk).
It makes it possible to access nearly all of GLPK functionality from within Julia programs.

See also the [GLPKMathProgInterface.jl](https://github.com/JuliaOpt/GLPKMathProgInterface.jl) package for using it with
[MathProgBase.jl](https://github.com/JuliaOpt/MathProgBase.jl) and [JuMP.jl](https://github.com/JuliaOpt/JuMP.jl).

This package is part of [the JuliaOpt project](http://www.juliaopt.org/).

## Installation
Expand All @@ -39,16 +34,34 @@ in GLPK's source folder.

Note that the custom binaries will not be overwritten by subsequent builds of the currently installed version of GLPK.jl. However, if GLPK.jl is updated and the update includes new BinaryProvider versions of the GLPK binaries, then the custom binaries will be overwritten by the new BinaryProvider versions.

## Documentation
## `GLPK.Optimizer`

Use `GLPK.Optimizer` to create a new optimizer object:
```julia
using GLPK
model = GLPK.Optimizer(tm_lim = 60.0, msg_lev = GLPK.OFF)
```
For JuMP, use:
```julia
using JuMP, GLPK
model = Model(
with_optimizer(GLPK.Optimizer, tm_lim = 60.0, msg_lev = GLPK.OFF)
)
```

- [**STABLE**][docs-stable-url] — **most recently tagged version of the documentation.**
- [**LATEST**][docs-latest-url] — *in-development version of the documentation.*
**Note: previous versions of `GLPK.jl` required you to choose either `GLPKSolverLP` or `GLPKSolverMIP`. This is no longer needed; just use `GLPK.Optimizer`.**

[docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg
[docs-latest-url]: https://gplkjl.readthedocs.org/en/latest/glpk.html
## Pre-emptive checks

[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-stable-url]: https://gplkjl.readthedocs.org/en/stable/glpk.html
`GLPK.jl` has a lot of pre-emptive checks to catch cases where the C API might
throw an uninformative error. However, in benchmarks, this takes a
non-negligible amount of time (e.g. 20% in add_constraints). At the risk of
possibly running into an uninformative error, you can run the following after
importing GLPK to disable these checks:
```julia
using GLPK
GLPK.jl_set_preemptive_check(false)
```

[travis-img]: https://api.travis-ci.org/JuliaOpt/GLPK.jl.svg?branch=master
[travis-url]: https://travis-ci.org/JuliaOpt/GLPK.jl
Expand All @@ -58,8 +71,3 @@ Note that the custom binaries will not be overwritten by subsequent builds of th

[coveralls-img]: https://img.shields.io/coveralls/JuliaOpt/GLPK.jl.svg
[coveralls-url]: https://coveralls.io/r/JuliaOpt/GLPK.jl

[pkg-0.6-img]: http://pkg.julialang.org/badges/GLPK_0.6.svg
[pkg-0.6-url]: http://pkg.julialang.org/?pkg=GLPK
[pkg-0.7-img]: http://pkg.julialang.org/badges/GLPK_0.7.svg
[pkg-0.7-url]: http://pkg.julialang.org/?pkg=GLPK
41 changes: 41 additions & 0 deletions perf/perf.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using GLPK

function print_help()
println("""
Usage
perf.jl [arg] [name]

[arg]
--new Begin a new benchmark comparison
--compare Run another benchmark and compare to existing

[name] A name for the benchmark test

Examples
git checkout master
julia perf.jl --new master
git checkout approach_1
julia perf.jl --new approach_1
git checkout approach_2
julia perf.jl --compare master
julia perf.jl --compare approach_1
""")
end

if length(ARGS) != 2
print_help()
else
const Benchmarks = GLPK.MOI.Benchmarks
const suite = Benchmarks.suite(() -> GLPK.Optimizer())
if ARGS[1] == "--new"
Benchmarks.create_baseline(
suite, ARGS[2]; directory = @__DIR__, verbose = true
)
elseif ARGS[1] == "--compare"
Benchmarks.compare_against_baseline(
suite, ARGS[2]; directory = @__DIR__, verbose = true
)
else
print_help()
end
end
Loading