Skip to content

Commit

Permalink
[docs] move manual section on Semicontinuous and Semiinteger variables
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 6, 2023
1 parent ec3c779 commit ee544c9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
28 changes: 0 additions & 28 deletions docs/src/manual/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -1296,34 +1296,6 @@ julia> @constraint(model, [t; u; x] in RotatedSecondOrderCone())
[t, u, x[1], x[2]] ∈ MathOptInterface.RotatedSecondOrderCone(4)
```

## Semi-integer and semi-continuous variables

Semi-continuous variables are constrained to the set
``x \in \{0\} \cup [l, u]``.

Create a semi-continuous variable using the [`Semicontinuous`](@ref) set:
```jldoctest
julia> model = Model();
julia> @variable(model, x);
julia> @constraint(model, x in Semicontinuous(1.5, 3.5))
x in MathOptInterface.Semicontinuous{Float64}(1.5, 3.5)
```

Semi-integer variables are constrained to the set
``x \in \{0\} \cup \{l, l+1, \dots, u\}``.

Create a semi-integer variable using the [`Semiinteger`](@ref) set:
```jldoctest
julia> model = Model();
julia> @variable(model, x);
julia> @constraint(model, x in Semiinteger(1.0, 3.0))
x in MathOptInterface.Semiinteger{Float64}(1.0, 3.0)
```

## Special Ordered Sets of Type 1

In a Special Ordered Set of Type 1 (often denoted SOS-I or SOS1), at most one
Expand Down
24 changes: 24 additions & 0 deletions docs/src/manual/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,30 @@ julia> set_integer(x)
in the model, returning a function that can be called to undo the operation
later on.

## Semi-integer and semi-continuous variables

Semi-continuous variables are constrained to the set
``x \in \{0\} \cup [l, u]``.

Create a semi-continuous variable using the [`Semicontinuous`](@ref) set:
```jldoctest
julia> model = Model();
julia> @variable(model, x in Semicontinuous(1.5, 3.5))
x
```

Semi-integer variables are constrained to the set
``x \in \{0\} \cup \{l, l+1, \dots, u\}``.

Create a semi-integer variable using the [`Semiinteger`](@ref) set:
```jldoctest
julia> model = Model();
julia> @variable(model, x in Semiinteger(1.0, 3.0))
x
```

## Start values

There are two ways to provide a primal starting solution (also called MIP-start
Expand Down

0 comments on commit ee544c9

Please sign in to comment.