-
Notifications
You must be signed in to change notification settings - Fork 27
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 how to use MOI.VectorAffineFunction
#171
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #171 +/- ##
=======================================
Coverage 83.37% 83.37%
=======================================
Files 32 32
Lines 1720 1720
=======================================
Hits 1434 1434
Misses 286 286 Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #171 +/- ##
=======================================
Coverage 83.37% 83.37%
=======================================
Files 32 32
Lines 1720 1720
=======================================
Hits 1434 1434
Misses 286 286 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #171 +/- ##
=======================================
Coverage 83.37% 83.37%
=======================================
Files 32 32
Lines 1720 1720
=======================================
Hits 1434 1434
Misses 286 286 Continue to review full report at Codecov.
|
@blegat Thanks. Fixed the typo and removed the empty lines as pointed out, and also modified the example (and made a force push). |
|
||
## Using a Polyhedra Optimizer with MathOptInterface | ||
|
||
Polyhedra Optimizers by dafault support only a few constraint types in MathOptInterface (MOI). |
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.
dafault -> default
|
||
Let us solve this program with `CDDLib.Optimizer` in exact arithmetic. | ||
To set up: | ||
|
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.
remove empty line
``` | ||
|
||
To solve: | ||
|
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.
Remove empty line
```julia | ||
MOI.optimize!(optimizer) | ||
MOI.get(optimizer, MOI.VariablePrimal(), x) | ||
``` |
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.
The standard way is to add the output in the same code block after an #output
comment like https://juliadocs.github.io/Documenter.jl/stable/man/doctests/#%22Script%22-Examples-1
We could turn it into a doctest later by using a MOIU.MockOptimizer so that we don't require CDDLib (that's what we do for JuMP's doctests).
@@ -126,3 +126,66 @@ m = Model() | |||
|
|||
poly = polyhedron(m, CDDLib.Library(:exact)) | |||
``` | |||
|
|||
## Using a Polyhedra Optimizer with MathOptInterface | |||
|
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.
Explain why one would use MOI directly instead of with JuMP (which is recommended) which is simply Model(with_optimizer(CDDLib.Optimizer))
. The reason could be that JuMP only does Float64
arithmetic while CDD allows rational arithmetic.
4dda979
to
687831d
Compare
Close #170