-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update NLPModelsJuMP for MathOptInterface #37
Conversation
docs/src/tutorial.md
Outdated
|
||
```@example jumpnlp | ||
```julia |
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.
Does this work? @example jumpnlp
was supposed to keep the previous environment.
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.
Yes, but the code is not run. It's what I wanted because OptimizationProblems.jl is not working with JuMP 0.20.
I tested locally with an updated version of OptimizationProblems.jl and it works.
amontoison/OptimizationProblems.jl@cf02b59
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 modified problems such that we have only @NLconstraint, @NLobjective and @NLexpression, it's why I didn't open a pull request.
Otherwise all models work without modifications on JuMP 0.20, we only need to replace setvalue
by set_start_value
to remove warnings.
return Jtv | ||
end | ||
|
||
# Uncomment when :JacVec becomes available in 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.
Is this still an issue?
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.
Yes, JacVec is still an unsupported feature...
I noticed you removed |
I think it can be remade but at which cost.... They completely changed how linear / quadratic terms are treated inside MOI. If we find a way to parse them, we should build ourself the jacobian , hessian... With MPB everything was accessible through an MPB.NLPEvaluator (linear or non linear objective / constraints) and a quadratic term was a non linear term. With MOI they made a distinction between a quadratic term a non linear term and only restrictive non linear objective / constraints are accessible through MOI.NLPEvaluator. I update the Project.toml to use the last release of NLPModels. I didn't test with previous version. |
You can't get the expressions anymore? MPBNLS was essentially creating constraints for an internal model using expressions. |
I meant the |
No It doesn't need the |
module NLPModelsJuMP | ||
|
||
include("nlsmpb_model.jl") |
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.
Let's comment this out instead of deleting it.
src/moi_nlp_model.jl
Outdated
|
||
nvar = num_variables(jmodel) | ||
x0 = zeros(nvar) | ||
lvar = [] |
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 initialize this to a Float64 array of -Inf for consistency with x0. Same for uvar.
src/moi_nlp_model.jl
Outdated
|
||
# Uncomment when :JacVec becomes available in MOI. | ||
# | ||
# function NLPModels.jprod(nlp :: MathOptNLPModel, x :: AbstractVector, v :: AbstractVector) |
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.
Should disappear.
src/moi_nlp_model.jl
Outdated
# return jv | ||
# end | ||
|
||
# function NLPModels.jtprod(nlp :: MathOptNLPModel, x :: AbstractVector, v :: AbstractVector) |
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.
Should go.
test/problems/hs10.jl
Outdated
setvalue(x[1], -10) | ||
setvalue(x[2], 10) | ||
set_start_value(x[1], -10.0) | ||
set_start_value(x[2], 10.0) |
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.
At other places, you left Ints as initial value. If they are accepted, I think 10 is clearer than 10.0.
I didn't removed The main reason is that |
.travis.yml
Outdated
addons: | ||
apt_packages: | ||
- gfortran # For Ipopt | ||
|
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.
This shouldn't be part of this PR.
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 see that you just add it in #32. It should disappear after a rebase.
appveyor.yml
Outdated
@@ -2,6 +2,8 @@ environment: | |||
matrix: | |||
- julia_version: 1.0 | |||
- julia_version: 1.1 | |||
- julia_version: 1.2 | |||
- julia_version: 1.3 |
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.
This is already in #32.
I close this pull request, #38 includes |
Interface between JuMP models (only composed of @NLobjective and @NLconstraint) and NLPModels.
#22