Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented May 15, 2019

Close #170

@coveralls
Copy link

coveralls commented May 15, 2019

Coverage Status

Coverage remained the same at 82.305% when pulling fef7019 on oyamad:patch-1 into 3b289dd on JuliaPolyhedra:master.

@codecov
Copy link

codecov bot commented May 15, 2019

Codecov Report

Merging #171 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

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

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

1 similar comment
@codecov
Copy link

codecov bot commented May 15, 2019

Codecov Report

Merging #171 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

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

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

@codecov
Copy link

codecov bot commented May 15, 2019

Codecov Report

Merging #171 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

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

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

docs/src/optimization.md Outdated Show resolved Hide resolved
docs/src/optimization.md Outdated Show resolved Hide resolved
docs/src/optimization.md Outdated Show resolved Hide resolved
@oyamad
Copy link
Member Author

oyamad commented May 16, 2019

@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).
Copy link
Member

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:

Copy link
Member

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:

Copy link
Member

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)
```
Copy link
Member

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

Copy link
Member

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.

@blegat blegat force-pushed the master branch 2 times, most recently from 4dda979 to 687831d Compare February 15, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Support MOI.VectorAffineFunction
3 participants