Comments (6)
ConstraintDualStart
for VariableIndex
are handled here:
Lines 339 to 425 in 4ae7ae9
Do you have an example where you can show they aren't being copied?
from ipopt.jl.
In general, setting dual starts works. It is just that the information is lost during copy_to, since MOI.supports() from Ipopt.jl returns the default false if a constraint of type VariableIndex-in-S is passed.
Here is a very ugly example, but it shows the problem
using MathOptInterface,Ipopt
MOIU = MathOptInterface.Utilities
MOI = MathOptInterface
model = MOIU.CachingOptimizer(MOIU.UniversalFallback(MOIU.Model{Float64}()), MOIU.AUTOMATIC)
varidx = MOI.add_variable(model)
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(),varidx)
MOI.set(model, MOI.ObjectiveSense(),MOI.MIN_SENSE)
ctridx = MOI.add_constraint(model, varidx, MOI.GreaterThan(0.0))
MOI.set(model, MOI.ConstraintDualStart(), ctridx, 2.0)
@assert MOI.get(model, MOI.ConstraintDualStart(), ctridx)==2
solver = MOI.instantiate(Ipopt.Optimizer)
idxmap = MOI.copy_to(solver,model)
@assert MOI.get(solver, MOI.ConstraintDualStart(), idxmap[ctridx])==nothing
# That duals to bounds are not correctly set is visible from the log
MOI.set(solver, MOI.RawOptimizerAttribute("warm_start_init_point"), "yes")
MOI.set(solver, MOI.RawOptimizerAttribute("print_level"), 8)
MOI.optimize!(solver)
# But setting the constraint dual start in general works:
MOI.set(solver, MOI.ConstraintDualStart(), idxmap[ctridx], 2)
@assert MOI.get(solver, MOI.ConstraintDualStart(), idxmap[ctridx]) == 2
MOI.optimize!(solver)
The only attributes that can get ignored during copy without an error/warning are MOI.ConstraintName(), MOI.ConstraintPrimalStart() and MOI.ConstraintDualStart() (as defined by pass_attributes) .
Setting these in the Ipopt.copy_to() function after the default_copy_to() call might be an easy workaround.
from ipopt.jl.
Ooops. We need ::Type{<:MOI.ConstraintIndex{MOI.VariableIndex,<:_SETS}}
. I'll make a PR.
from ipopt.jl.
This should fix it: #334
from ipopt.jl.
Thanks for the quick action. I tried that as well, but (on my end), it resulted in different problems. Please see the following slightly edited example from above:
using MathOptInterface, Ipopt
MOIU = MathOptInterface.Utilities
MOI = MathOptInterface
model = MOIU.CachingOptimizer(MOIU.UniversalFallback(MOIU.Model{Float64}()), MOIU.AUTOMATIC)
varidx = MOI.add_variable(model)
MOI.set(model, MOI.ObjectiveFunction{MOI.VariableIndex}(),varidx)
MOI.set(model, MOI.ObjectiveSense(),MOI.MIN_SENSE)
ctridx = MOI.add_constraint(model, varidx, MOI.GreaterThan(0.0))
MOI.set(model, MOI.ConstraintDualStart(), ctridx, 2.0)
@assert MOI.get(model, MOI.ConstraintDualStart(), ctridx)==2
solver = MathOptInterface.instantiate(Ipopt.Optimizer; with_bridge_type=Float64)
idxmap = MOI.copy_to(solver,model)
This was working fine prior to fixing the type issue, but threw an error after (at least on my end :D)
Edit: If I'm not mistaken, #334 should break for example BilevelJuMP
from ipopt.jl.
Hmm. I'll take a deeper look.
from ipopt.jl.
Related Issues (20)
- Segfault julia with unavailable linear solvers HOT 9
- Tests failing on M1 HOT 5
- Failed to precompile Ipopt HOT 5
- add `MathOptInterface.Name()` attribute HOT 1
- `max_wall_time` is still not working HOT 5
- Allow user to specify the Ipopt binary HOT 2
- Only evaluate QP callbacks if needed HOT 1
- Problem with HSL solvers since updating to MacOS 13.0 HOT 3
- double free or corruption (out) error HOT 20
- Linking full hsl library to Ipopt.jl on ubuntu HOT 19
- julia 0.6.0 install Ipopt cannot connect to mumps dependency HOT 2
- Add support for GetIpoptCurrentViolations
- Incorrect number of Hessian structure (nonzero entries) HOT 10
- Does Ipopt.jl support giving hessian matrix in JuMP directly, without using the C_wrapper? HOT 2
- pointer being freed was not allocated HOT 33
- Invalid number in NLP function or derivative detected. HOT 8
- Issue with non-negative variable tolerance. HOT 2
- does not allow Ipopt_jll current version HOT 2
- Add some pre-built "debugging" callbacks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipopt.jl.