Skip to content

Commit

Permalink
Merge pull request #76 from hdavid16/fix_documenter
Browse files Browse the repository at this point in the history
fix documenter task
  • Loading branch information
hdavid16 authored Oct 13, 2023
2 parents 4463d0c + c146725 commit eb98eff
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 36 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ Prior to `v0.4.0`, the package did not leverage the JuMP extension capabilities
The example below is from the [Cornell University Computational Optimization Open Textbook](https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Big-M_Reformulation[1][2]).

```julia
using JuMP
using DisjunctiveProgramming
m = GDPModel()
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[deps]
DisjunctiveProgramming = "0d27d021-0159-4c7d-b4a7-9ccb5d9366cf"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
13 changes: 7 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
push!(LOAD_PATH,"../src/")
using DisjunctiveProgramming
using Documenter
makedocs(
sitename = "DisjunctiveProgramming.jl",
modules = [DisjunctiveProgramming],
pages=[
"Home" => "index.md"
])
sitename = "DisjunctiveProgramming.jl",
modules = [DisjunctiveProgramming],
pages=[
"Home" => "index.md"
],
checkdocs = :none
)
deploydocs(;
repo="github.com/hdavid16/DisjunctiveProgramming.jl",
)
1 change: 0 additions & 1 deletion examples/ex1.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using JuMP
using DisjunctiveProgramming
using HiGHS

Expand Down
1 change: 0 additions & 1 deletion examples/ex2.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Big-M_Reformulation[1][2]
using JuMP
using DisjunctiveProgramming
using HiGHS

Expand Down
1 change: 0 additions & 1 deletion examples/ex3.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using JuMP
using DisjunctiveProgramming

m = GDPModel()
Expand Down
1 change: 0 additions & 1 deletion examples/ex4.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using JuMP
using DisjunctiveProgramming

# Example with proposition reformulation
Expand Down
2 changes: 0 additions & 2 deletions examples/ex5.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# https://arxiv.org/pdf/2303.04375.pdf

using JuMP
using DisjunctiveProgramming

##
Expand Down
1 change: 0 additions & 1 deletion examples/ex6.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using JuMP
using DisjunctiveProgramming

##
Expand Down
9 changes: 5 additions & 4 deletions src/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,11 @@ cardinality sets: `AtLeast(n)`, `AtMost(n)`, or `Exactly(n)`.
To select exactly 1 logical variable `Y` to be `true`, do
(the same can be done with `AtLeast(n)` and `AtMost(n)`):
```jldoctest
julia> model = GDPModel();
julia> @variable(model, Y[i = 1:2], Logical);
julia> @constraint(model, [Y[1], Y[2]] in Exactly(1));
```julia
using DisjunctiveProgramming
model = GDPModel();
@variable(model, Y[i = 1:2], LogicalVariable);
@constraint(model, [Y[1], Y[2]] in Exactly(1));
```
JuMP.build_constraint(
Expand Down
28 changes: 11 additions & 17 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,23 +285,17 @@ The macro returns a tuple containing the disjunctions that were defined.
## Example
```jldoctest
julia> model = GDPModel();
julia> @variable(model, w);
julia> @variable(model, x);
julia> @variable(model, Y[1:4], Logical);
julia> @constraint(model, [i=1:2], w == i, DisjunctConstraint(Y[i]));
julia> @constraint(model, [i=3:4], x == i, DisjunctConstraint(Y[i]));
julia> @disjunctions(model, begin
[Y[1], Y[2]]
[Y[3], Y[4]]
end);
```julia
model = GDPModel();
@variable(model, w);
@variable(model, x);
@variable(model, Y[1:4], LogicalVariable);
@constraint(model, [i=1:2], w == i, DisjunctConstraint(Y[i]));
@constraint(model, [i=3:4], x == i, DisjunctConstraint(Y[i]));
@disjunctions(model, begin
[Y[1], Y[2]]
[Y[3], Y[4]]
end);
````
"""
macro disjunctions(m, x)
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DisjunctiveProgramming
using JuMP
using Test

const DP = DisjunctiveProgramming
Expand Down

0 comments on commit eb98eff

Please sign in to comment.