1
- Julia GLPK module
2
- =================
1
+ # GLPK.jl
3
2
4
-
5
- | ** Documentation** | ** Build Status** |
6
- | :-------------------------------------------------------------------------------:| :---------------------------------------------------------------------------------------------------:|
7
- | [ ![ ] [ docs-stable-img ]] [ docs-stable-url ] [ ![ ] [ docs-latest-img ]] [ docs-latest-url ] | [ ![ ] [ travis-img ]] [ travis-url ] [ ![ ] [ appveyor-img ]] [ appveyor-url ] [ ![ ] [ coveralls-img ]] [ coveralls-url ] |
3
+ | ** Build Status** |
4
+ | :---------------------------------------------------------------------------------------------------:|
5
+ | [ ![ ] [ travis-img ]] [ travis-url ] [ ![ ] [ appveyor-img ]] [ appveyor-url ] [ ![ ] [ coveralls-img ]] [ coveralls-url ] |
8
6
9
7
10
8
GLPK.jl is a wrapper for the [ GNU Linear Programming Kit library] ( http://www.gnu.org/software/glpk ) .
11
9
It makes it possible to access nearly all of GLPK functionality from within Julia programs.
12
10
13
- See also the [ GLPKMathProgInterface.jl] ( https://github.com/JuliaOpt/GLPKMathProgInterface.jl ) package for using it with
14
- [ MathProgBase.jl] ( https://github.com/JuliaOpt/MathProgBase.jl ) and [ JuMP.jl] ( https://github.com/JuliaOpt/JuMP.jl ) .
15
-
16
11
This package is part of [ the JuliaOpt project] ( http://www.juliaopt.org/ ) .
17
12
18
13
## Installation
@@ -39,16 +34,34 @@ If you do not want BinaryProvider to download the default binaries on install se
39
34
40
35
To switch back to the default binaries clear ` JULIA_GLPK_LIBRARY_PATH ` and call ` import Pkg; Pkg.build("GLPK") ` .
41
36
42
- ## Documentation
37
+ ## ` GLPK.Optimizer `
38
+
39
+ Use ` GLPK.Optimizer ` to create a new optimizer object:
40
+ ``` julia
41
+ using GLPK
42
+ model = GLPK. Optimizer (tm_lim = 60.0 , msg_lev = GLPK. OFF)
43
+ ```
44
+ For JuMP, use:
45
+ ``` julia
46
+ using JuMP, GLPK
47
+ model = Model (
48
+ with_optimizer (GLPK. Optimizer, tm_lim = 60.0 , msg_lev = GLPK. OFF)
49
+ )
50
+ ```
43
51
44
- - [ ** STABLE** ] [ docs-stable-url ] &mdash ; ** most recently tagged version of the documentation.**
45
- - [ ** LATEST** ] [ docs-latest-url ] &mdash ; * in-development version of the documentation.*
52
+ ** Note: previous versions of ` GLPK.jl ` required you to choose either ` GLPKSolverLP ` or ` GLPKSolverMIP ` . This is no longer needed; just use ` GLPK.Optimizer ` .**
46
53
47
- [ docs-latest-img ] : https://img.shields.io/badge/docs-latest-blue.svg
48
- [ docs-latest-url ] : https://gplkjl.readthedocs.org/en/latest/glpk.html
54
+ ## Pre-emptive checks
49
55
50
- [ docs-stable-img ] : https://img.shields.io/badge/docs-stable-blue.svg
51
- [ docs-stable-url ] : https://gplkjl.readthedocs.org/en/stable/glpk.html
56
+ ` GLPK.jl ` has a lot of pre-emptive checks to catch cases where the C API might
57
+ throw an uninformative error. However, in benchmarks, this takes a
58
+ non-negligible amount of time (e.g. 20% in add_constraints). At the risk of
59
+ possibly running into an uninformative error, you can run the following after
60
+ importing GLPK to disable these checks:
61
+ ``` julia
62
+ using GLPK
63
+ GLPK. jl_set_preemptive_check (false )
64
+ ```
52
65
53
66
[ travis-img ] : https://api.travis-ci.org/JuliaOpt/GLPK.jl.svg?branch=master
54
67
[ travis-url ] : https://travis-ci.org/JuliaOpt/GLPK.jl
@@ -58,8 +71,3 @@ To switch back to the default binaries clear `JULIA_GLPK_LIBRARY_PATH` and call
58
71
59
72
[ coveralls-img ] : https://img.shields.io/coveralls/JuliaOpt/GLPK.jl.svg
60
73
[ coveralls-url ] : https://coveralls.io/r/JuliaOpt/GLPK.jl
61
-
62
- [ pkg-0.6-img ] : http://pkg.julialang.org/badges/GLPK_0.6.svg
63
- [ pkg-0.6-url ] : http://pkg.julialang.org/?pkg=GLPK
64
- [ pkg-0.7-img ] : http://pkg.julialang.org/badges/GLPK_0.7.svg
65
- [ pkg-0.7-url ] : http://pkg.julialang.org/?pkg=GLPK
0 commit comments