Skip to content

Commit

Permalink
Move documenter to run on v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Sep 2, 2018
1 parent 25d71a9 commit c1866e7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ addons:
- libblas-dev
after_success:
- echo $TRAVIS_JULIA_VERSION
- julia -e 'Pkg.add("Coverage"); cd(Pkg.dir("JuMP")); using Coverage; Coveralls.submit(process_folder()); Codecov.submit(process_folder())'
- julia -e 'Pkg.add("Documenter")'
- julia -e 'cd(Pkg.dir("JuMP")); include(joinpath("docs", "make.jl"))'
- julia -e '(VERSION >= v"0.7" && using Pkg); Pkg.add("Coverage"); cd(Pkg.dir("JuMP")); using Coverage; Coveralls.submit(process_folder()); Codecov.submit(process_folder())'
- julia -e '(VERSION >= v"0.7" && using Pkg); Pkg.add("Documenter")'
- julia -e 'VERSION == v"1.0" && (using Pkg; cd(Pkg.dir("JuMP")); include(joinpath("docs", "make.jl")))'
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ deploydocs(
repo = "github.com/JuliaOpt/JuMP.jl.git",
target = "build",
osname = "linux",
julia = "0.6",
julia = "1.0",
deps = nothing,
make = nothing
)
6 changes: 3 additions & 3 deletions docs/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ to a setting such as a time limit. We can ask the solver why it stopped using
the `JuMP.termination_status` function:
```jldoctest quickstart_example
julia> JuMP.termination_status(model)
Success::MathOptInterface.TerminationStatusCode = 0
Success::TerminationStatusCode = 0
```
In this case, `GLPK` returned `Success`. This does not mean that it has found
the optimal solution. Instead, it indicates that GLPK has finished running and
Expand All @@ -125,14 +125,14 @@ To understand the reason for termination in more detail, we need to query
`JuMP.primalstatus`:
```jldoctest quickstart_example
julia> JuMP.primal_status(model)
FeasiblePoint::MathOptInterface.ResultStatusCode = 0
FeasiblePoint::ResultStatusCode = 0
```
This indicates that GLPK has found a `FeasiblePoint` to the primal problem.
Coupled with the `Success` from `JuMP.termination_status`, we can infer that GLPK
has indeed found the optimal solution. We can also query `JuMP.dual_status`:
```jldoctest quickstart_example
julia> JuMP.dual_status(model)
FeasiblePoint::MathOptInterface.ResultStatusCode = 0
FeasiblePoint::ResultStatusCode = 0
```
Like the `primal_status`, GLPK indicates that it has found a `FeasiblePoint` to
the dual problem.
Expand Down
51 changes: 25 additions & 26 deletions docs/src/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ julia> model = Model()
A JuMP Model
julia> @variable(model, x[1:2])
2-element Array{JuMP.VariableRef,1}:
2-element Array{VariableRef,1}:
x[1]
x[2]
```
Expand Down Expand Up @@ -226,7 +226,7 @@ We have already seen the creation of an array of JuMP variables with the
arrays of JuMP variables. For example:
```jldoctest variables_arrays; setup=:(model=Model())
julia> @variable(model, x[1:2, 1:2])
2×2 Array{JuMP.VariableRef,2}:
2×2 Array{VariableRef,2}:
x[1,1] x[1,2]
x[2,1] x[2,2]
```
Expand All @@ -237,15 +237,15 @@ julia> x[1, 2]
x[1,2]
julia> x[2, :]
2-element Array{JuMP.VariableRef,1}:
2-element Array{VariableRef,1}:
x[2,1]
x[2,2]
```

We can also name each index, and variable bounds can depend upon the indices:
```jldoctest; setup=:(model=Model())
julia> @variable(model, x[i=1:2, j=1:2] >= 2i + j)
2×2 Array{JuMP.VariableRef,2}:
2×2 Array{VariableRef,2}:
x[1,1] x[1,2]
x[2,1] x[2,2]
Expand All @@ -269,10 +269,10 @@ difference is that instead of returning an `Array` of JuMP variables, JuMP will
return a `JuMPArray`. For example:
```jldoctest variables_jump_arrays; setup=:(model=Model())
julia> @variable(model, x[1:2, [:A,:B]])
2-dimensional JuMPArray{JuMP.VariableRef,2,...} with index sets:
2-dimensional JuMPArray{VariableRef,2,...} with index sets:
Dimension 1, 1:2
Dimension 2, Symbol[:A, :B]
And data, a 2×2 Array{JuMP.VariableRef,2}:
And data, a 2×2 Array{VariableRef,2}:
x[1,A] x[1,B]
x[2,A] x[2,B]
```
Expand All @@ -283,9 +283,9 @@ julia> x[1, :A]
x[1,A]
julia> x[2, :]
1-dimensional JuMPArray{JuMP.VariableRef,1,...} with index sets:
1-dimensional JuMPArray{VariableRef,1,...} with index sets:
Dimension 1, Symbol[:A, :B]
And data, a 2-element Array{JuMP.VariableRef,1}:
And data, a 2-element Array{VariableRef,1}:
x[2,A]
x[2,B]
```
Expand All @@ -294,10 +294,10 @@ Similarly to the `Array` case, the indices in a `JuMPArray` can be named, and
the bounds can depend upon these names. For example:
```jldoctest; setup=:(model=Model())
julia> @variable(model, x[i=2:3, j=1:2:3] >= 0.5i + j)
2-dimensional JuMPArray{JuMP.VariableRef,2,...} with index sets:
2-dimensional JuMPArray{VariableRef,2,...} with index sets:
Dimension 1, 2:3
Dimension 2, 1:2:3
And data, a 2×2 Array{JuMP.VariableRef,2}:
And data, a 2×2 Array{VariableRef,2}:
x[2,1] x[2,3]
x[3,1] x[3,3]
Expand All @@ -318,7 +318,7 @@ rectangular set. One example is when indices have a dependence upon previous
indices (called *triangular indexing*). JuMP supports this as follows:
```jldoctest; setup=:(model=Model())
julia> @variable(model, x[i=1:2, j=i:2])
Dict{Any,JuMP.VariableRef} with 3 entries:
Dict{Any,VariableRef} with 3 entries:
(1, 2) => x[1,2]
(2, 2) => x[2,2]
(1, 1) => x[1,1]
Expand All @@ -330,7 +330,7 @@ sytax appends a comparison check that depends upon the named indices and is
separated from the indices by a semi-colon (`;`). For example:
```jldoctest; setup=:(model=Model())
julia> @variable(model, x[i=1:4; mod(i, 2)==0])
Dict{Any,JuMP.VariableRef} with 2 entries:
Dict{Any,VariableRef} with 2 entries:
4 => x[4]
2 => x[2]
```
Expand All @@ -347,9 +347,9 @@ julia> A = 1:2
1:2
julia> @variable(model, x[A])
1-dimensional JuMPArray{JuMP.VariableRef,1,...} with index sets:
1-dimensional JuMPArray{VariableRef,1,...} with index sets:
Dimension 1, 1:2
And data, a 2-element Array{JuMP.VariableRef,1}:
And data, a 2-element Array{VariableRef,1}:
x[1]
x[2]
```
Expand All @@ -362,7 +362,7 @@ We can share our knowledge that it is possible to store these JuMP variables as
an array by setting the `container` keyword:
```jldoctest variable_force_container
julia> @variable(model, y[A], container=Array)
2-element Array{JuMP.VariableRef,1}:
2-element Array{VariableRef,1}:
y[1]
y[2]
```
Expand Down Expand Up @@ -426,7 +426,7 @@ matrix ``X`` is positive semidefinite if all eigenvalues are nonnegative. We can
declare a matrix of JuMP variables to be positive semidefinite as follows:
```jldoctest; setup=:(model=Model())
julia> @variable(model, x[1:2, 1:2], PSD)
2×2 Symmetric{JuMP.VariableRef,Array{JuMP.VariableRef,2}}:
2×2 LinearAlgebra.Symmetric{VariableRef,Array{VariableRef,2}}:
x[1,1] x[1,2]
x[1,2] x[2,2]
```
Expand All @@ -439,7 +439,7 @@ You can also impose a slightly weaker constraint that the square matrix is only
symmetric (instead of positive semidefinite) as follows:
```jldoctest; setup=:(model=Model())
julia> @variable(model, x[1:2, 1:2], Symmetric)
2×2 Symmetric{JuMP.VariableRef,Array{JuMP.VariableRef,2}}:
2×2 LinearAlgebra.Symmetric{VariableRef,Array{VariableRef,2}}:
x[1,1] x[1,2]
x[1,2] x[2,2]
```
Expand All @@ -463,7 +463,7 @@ x
An `Array` of anonymous JuMP variables can be created as follows:
```jldoctest; setup=:(model=Model())
julia> y = @variable(model, [i=1:2])
2-element Array{JuMP.VariableRef,1}:
2-element Array{VariableRef,1}:
noname
noname
```
Expand All @@ -480,7 +480,7 @@ use the `binary` and `integer` keywords.
Thus, the anonymous variant of `@variable(model, x[i=1:2] >= i, Int)` is:
```jldoctest; setup=:(model=Model())
julia> x = @variable(model, [i=1:2], basename="x", lower_bound=i, integer=true)
2-element Array{JuMP.VariableRef,1}:
2-element Array{VariableRef,1}:
x[1]
x[2]
```
Expand All @@ -493,18 +493,17 @@ containers. However, users are also free to create collections of JuMP variables
in their own datastructures. For example, the following code creates a
dictionary with symmetric matrices as the values:
```jldoctest; setup=:(model=Model())
julia> variables = Dict{Symbol, Symmetric{JuMP.VariableRef,
Array{JuMP.VariableRef,2}}}()
Dict{Symbol,Symmetric{JuMP.VariableRef,Array{JuMP.VariableRef,2}}} with 0 entries
julia> variables = Dict{Symbol, Array{VariableRef,2}}()
Dict{Symbol,Array{VariableRef,2}} with 0 entries
julia> for key in [:A, :B]
variables[key] = @variable(model, [1:2, 1:2], Symmetric)
global variables[key] = @variable(model, [1:2, 1:2])
end
julia> variables
Dict{Symbol,Symmetric{JuMP.VariableRef,Array{JuMP.VariableRef,2}}} with 2 entries:
:A => JuMP.VariableRef[noname noname; noname noname]
:B => JuMP.VariableRef[noname noname; noname noname]
Dict{Symbol,Array{VariableRef,2}} with 2 entries:
:A => VariableRef[noname noname; noname noname]
:B => VariableRef[noname noname; noname noname]
```

## Deleting variables
Expand Down

0 comments on commit c1866e7

Please sign in to comment.