-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document constraint primal better #358
Conversation
Codecov Report
@@ Coverage Diff @@
## master #358 +/- ##
==========================================
- Coverage 96.27% 96.21% -0.06%
==========================================
Files 36 36
Lines 4723 4731 +8
==========================================
+ Hits 4547 4552 +5
- Misses 176 179 +3
Continue to review full report at Codecov.
|
src/attributes.jl
Outdated
|
||
Given a constraint `function-in-set`, the `ConstraintPrimal` is the value of the | ||
function evaluated at the primal solution of the variables. For example, given | ||
the constraint `2x + y <= 1`, and a primal solution of `(x,y) = (1,2)`, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple ways to encode this constraint in MOI, could help to be more precise (ScalarAffineFunction).
src/attributes.jl
Outdated
|
||
Given a constraint `function-in-set`, the `ConstraintPrimal` is the value of the | ||
function evaluated at the primal solution of the variables. For example, given | ||
the constraint `ScalarAffineFunction([x,y], [1, 2], 3)`-in-`LessThan(0)` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an example with LessThan(4)
would be better to show that this value is not used in the constraint primal.
src/attributes.jl
Outdated
|
||
Given a constraint `function-in-set`, the `ConstraintPrimal` is the value of the | ||
function evaluated at the primal solution of the variables. For example, given | ||
the constraint `ScalarAffineFunction([x,y], [1, 2], 3)`-in-`LessThan(4)` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm. Now this is a bit weird because ScalarAffineFunction([x,y], [1, 2], 3)
-in-LessThan(4)
is not idomatic MOI. We expect these constraints to be normalized so the left-hand side has zero in the constant (i.e., solvers aren't expected to support otherwise).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://www.juliaopt.org/MathOptInterface.jl/stable/apimanual.html#JuMP-mapping-1
That said, from the perspective of JuMP, solvers can safely choose to not support the following constraints:
- ScalarAffineFunction in GreaterThan, LessThan, or EqualTo with a nonzero constant in the function. Constants in the affine function should instead be moved into the parameters of the corresponding sets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using zero in the function instead of 3 seems to be the way to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to the Interval set instead.
Closes #220