Skip to content

Document constraint primal better - #358

Merged
odow merged 4 commits into
masterfrom
odow/docconstrprimal
May 15, 2018
Merged

odow merged 4 commits into
masterfrom
odow/docconstrprimal

Conversation

@odow

@odow odow commented May 13, 2018

Copy link
Copy Markdown
Member

Closes #220

@odow odow added the Type: Documentation This issue requires changes to the documentation label May 13, 2018
@codecov-io

codecov-io commented May 13, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #358 into master will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/attributes.jl 93.61% <ø> (ø) ⬆️
src/indextypes.jl 62.5% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e85ea35...f5dd70f. Read the comment docs.

Comment thread 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

Copy link
Copy Markdown
Member

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).

Comment thread 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

Copy link
Copy Markdown
Member

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.

Comment thread 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

Copy link
Copy Markdown
Member

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).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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.

@odow odow mentioned this pull request May 14, 2018
8 of 11 tasks
@odow
odow merged commit 258f4f3 into master May 15, 2018
@odow
odow deleted the odow/docconstrprimal branch May 15, 2018 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Documentation This issue requires changes to the documentation

Development

Successfully merging this pull request may close these issues.

4 participants