Skip to content

Commit cce23b4

Browse files
committed
Improve docstring
1 parent bc9773a commit cce23b4

2 files changed

Lines changed: 24 additions & 19 deletions

File tree

src/structures.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,23 @@ variables and their dual counterparts.
4141
this is the position in that vector.
4242
4343
* `dual_constraint::Union{Nothing,MOI.ConstraintIndex}`: dual constraint
44-
associated with the variable. If the variable is not constrained then the
45-
set is EqualTo{T}(zero(T)). If the variable is a constrained variable then
46-
the set is the dual set of the constrained variable set. If the dual set is
47-
`Reals` then the field is kept as `nothing` as teh constraint is not added.
48-
49-
* `dual_function::Union{Nothing,MOI.ScalarAffineFunction{T}}`: if the
44+
associated with the variable. If this is a variable constrained in
45+
`MOI.Zeros` or `MOI.EqualTo`, then this is `nothing`. Otherwise, this is
46+
a constraint with set corresponding to the dual set this variable is
47+
constrained to. If the variable is not constrained then this an equality
48+
constrained, so the set is `MOI.EqualTo` even if strictly speaking, the dual
49+
set of `MOI.Reals` is `MOI.Zeros`. If the variable is a constrained variable
50+
in a given set `S`, this is a constraint on the dual set `MOI.dual_set(S)`.
51+
52+
* `dual_function::Union{Nothing,MOI.ScalarAffineFunction{T}}`: if it is a
5053
constrained variable is `VectorOfVariables`-in-`Zeros` or
5154
`VariableIndex`-in-`EqualTo(zero(T))` then the dual is `func`-in-`Reals`,
52-
which is "irrelevant" to the model. But this information is cached for
53-
completeness of the `DualOptimizer` for `get`ting `ConstraintDuals`.
55+
which is "irrelevant" to the model. So the no constrained is added (hence
56+
`dual_constraint` is `nothing` but the function is cached in this field for
57+
completeness of the `DualOptimizer` for `get`ting `ConstraintDual`s.
58+
Otherwise, `dual_function` is `nothing`.
5459
55-
To got from the constrained variable constraint to the primal variable, use the
60+
To go from the constrained variable constraint to the primal variable, use the
5661
`primal_constrained_variables` field of `PrimalDualMap`.
5762
5863
See also `PrimalDualMap` and `PrimalConstraintData`.

test/Tests/test_MOI_wrapper.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
linear_config,
2121
include = ["test_linear_"],
2222
exclude = [
23-
"test_linear_FEASIBILITY_SENSE",
24-
"test_linear_INFEASIBLE_2",
25-
"test_linear_Interval_inactive",
26-
"test_linear_add_constraints",
27-
"test_linear_inactive_bounds",
28-
"test_linear_integration_2",
29-
"test_linear_integration_Interval",
30-
"test_linear_integration_delete_variables",
31-
"test_linear_complex_Zeros",
32-
"test_linear_complex_Zeros_duplicate",
23+
r"^test_linear_FEASIBILITY_SENSE$",
24+
r"^test_linear_INFEASIBLE_2$",
25+
r"^test_linear_Interval_inactive$",
26+
r"^test_linear_add_constraints$",
27+
r"^test_linear_inactive_bounds$",
28+
r"^test_linear_integration_2$",
29+
r"^test_linear_integration_Interval$",
30+
r"^test_linear_integration_delete_variables$",
31+
r"^test_linear_complex_Zeros$",
32+
r"^test_linear_complex_Zeros_duplicate$",
3333
],
3434
)
3535
end

0 commit comments

Comments
 (0)