Conversation
Member
Author
|
Motivated by jump-dev/Dualization.jl#232 julia> using LinearAlgebra
julia> using Hypatia
julia> using Dualization
julia> using JuMP
julia> function test_dual()
model = Model()
@variable(model, M[1:2, 1:2], Symmetric)
@constraint(model, [1, M[1, 1], sqrt(2) * M[1, 2], M[2, 2]] in Hypatia.EpiNormSpectralTriCone{Float64,Float64}(1 + 3))
@objective(model, Max, real(tr(M)))
#set_optimizer(model, Hypatia.Optimizer)
set_optimizer(model, Dualization.dual_optimizer(Hypatia.Optimizer))
optimize!(model)
return value(M)
end
test_dual (generic function with 1 method)
julia> test_dual()
ERROR: UnsupportedConstraint{
MathOptInterface.VectorAffineFunction{Float64},
EpiNormSpectralTriCone{Float64, Float64},
}
This constraint type is not supported by the solver.
To fix this error you must choose a different solver.
## More information
Bridges are enabled, but there are none that can rewrite the constraint into a form supported by the solver.
The model that we were unable to add the constraint to is:
MOIB.LazyBridgeOptimizer{MOIU.CachingOptimizer{DualOptimizer{Float64, MOIB.LazyBridgeOptimizer{MOIU.CachingOptimizer{Hypatia.Optimizer{Float64}, MOIU.UniversalFallback{MOIU.Model{Float64}}}}}, MOIU.UniversalFallback{MOIU.Model{Float64}}}}
├ Variable bridges: none
├ Constraint bridges: none
├ Objective bridges: none
└ model: MOIU.CachingOptimizer
├ state: EMPTY_OPTIMIZER
├ mode: AUTOMATIC
├ model_cache: MOIU.UniversalFallback{MOIU.Model{Float64}}
│ ├ ObjectiveSense: MAX_SENSE
│ ├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64}
│ ├ NumberOfVariables: 3
│ └ NumberOfConstraints: 0
└ optimizer: DualOptimizer{Float64, MOIB.LazyBridgeOptimizer{MOIU.CachingOptimizer{Hypatia.Optimizer{Float64}, MOIU.UniversalFallback{MOIU.Model{Float64}}}}}
├ ObjectiveSense: unknown
├ ObjectiveFunctionType: unknown
├ NumberOfVariables: unknown
└ NumberOfConstraints: unknown
Stacktrace: |
Member
Author
|
cc @araujoms |
araujoms
reviewed
Jul 29, 2026
Comment on lines
+554
to
+558
| constraint into a form supported by the solver. | ||
|
|
||
| The model that we were unable to add the constraint to is: | ||
|
|
||
| $(sprint(show, model)) |
Contributor
There was a problem hiding this comment.
Suggested change
| constraint into a form supported by the solver. | |
| The model that we were unable to add the constraint to is: | |
| $(sprint(show, model)) | |
| constraint into a form supported by the solver $(sprint(show, MOI.get(model, MOI.SolverName()))) |
I'd just print the solver name instead of the whole model, since the solver is what makes the constraint unsupported.
Member
Author
There was a problem hiding this comment.
So this isn't print(model), but it's show(model). Which is the high level summary.
Contributor
There was a problem hiding this comment.
Which still has a lot of irrelevant information.
Member
Author
There was a problem hiding this comment.
SolverName drops a lot of relevant information.
julia> MOI.get(b, MOI.SolverName())
"Dual model with Hypatia attached"It looks through the bridging layer and the cache.
Contributor
There was a problem hiding this comment.
I know this is the result, it's exactly the information I wanted to have, which is why I suggested it.
It's just a suggestion, feel free to ignore it.
odow
commented
Jul 29, 2026
| ├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64} | ||
| ├ NumberOfVariables: 1 | ||
| └ NumberOfConstraints: 0 | ||
| """ |
Member
Author
This comment was marked as outdated.
This comment was marked as outdated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I might break out the UnsupportedConstraint into a separate PR, but I'll see the damage here first.