-
Notifications
You must be signed in to change notification settings - Fork 87
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
isapprox for a VectorNonlinearFunction after simple bridge modifications #2553
Labels
Submodule: Bridges
About the Bridges submodule
Comments
Yeah I hit a bunch of these with KNITRO, but MINLP solvers are pretty rare so I haven't spent much time on them 😄 Just exclude: |
odow
changed the title
VectorNonlinearFunction Tests
Various issues with bridges and VectorNonlinearFunction
Oct 8, 2024
Fair enough, I'll exclude those for now. Thanks! |
The remaining issues are due to test_basic_VectorNonlinearFunction_HyperRectangle: Test Failed at /home/blegat/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:262
Expression: isapprox(MOI.Utilities.canonical(f), constraint_function, config)
Evaluated: isapprox(┌ ┐
│+(-(+(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))), 0.0), 0.0)│
│+(-(+(MOI.VariableIndex(1)), 0.0), 0.0) │
│+(-(+(MOI.VariableIndex(2)), 0.0), 0.0) │
└ ┘, ┌ ┐
│+(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))│
│+(MOI.VariableIndex(1)) │
│+(MOI.VariableIndex(2)) │
│+(MOI.VariableIndex(3)) │
└ ┘, MathOptInterface.Test.Config{Float64}(0.001, 0.001, MathOptInterface.OPTIMAL, MathOptInterface.INFEASIBLE, Any[MathOptInterface.DualObjectiveValue, MathOptInterface.ConstraintBasisStatus, MathOptInterface.VariableBasisStatus, MathOptInterface.ConstraintDual]))
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.11.0+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:679 [inlined]
[2] _basic_constraint_test_helper(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64}, ::Type{MathOptInterface.VectorNonlinearFunction}, ::Type{MathOptInterface.HyperRectangle})
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:262
[3] test_basic_VectorNonlinearFunction_HyperRectangle(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64})
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:396
[4] macro expansion
@ ~/.julia/dev/MathOptInterface/src/Test/Test.jl:272 [inlined]
[5] macro expansion
@ ~/.julia/juliaup/julia-1.11.0+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:1700 [inlined]
[6] runtests(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64}; include::Vector{String}, exclude::Vector{String}, warn_unsupported::Bool, verbose::Bool, exclude_tests_after::VersionNumber)
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/Test.jl:267
test_basic_VectorNonlinearFunction_HyperRectangle: Test Failed at /home/blegat/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:263
Expression: isapprox(MOI.get(model, MOI.CanonicalConstraintFunction(), c), constraint_function, config)
Evaluated: isapprox(┌ ┐
│+(-(+(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))), 0.0), 0.0)│
│+(-(+(MOI.VariableIndex(1)), 0.0), 0.0) │
│+(-(+(MOI.VariableIndex(2)), 0.0), 0.0) │
└ ┘, ┌ ┐
│+(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))│
│+(MOI.VariableIndex(1)) │
│+(MOI.VariableIndex(2)) │
│+(MOI.VariableIndex(3)) │
└ ┘, MathOptInterface.Test.Config{Float64}(0.001, 0.001, MathOptInterface.OPTIMAL, MathOptInterface.INFEASIBLE, Any[MathOptInterface.DualObjectiveValue, MathOptInterface.ConstraintBasisStatus, MathOptInterface.VariableBasisStatus, MathOptInterface.ConstraintDual]))
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.11.0+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:679 [inlined]
[2] _basic_constraint_test_helper(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64}, ::Type{MathOptInterface.VectorNonlinearFunction}, ::Type{MathOptInterface.HyperRectangle})
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:263
[3] test_basic_VectorNonlinearFunction_HyperRectangle(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64})
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:396
[4] macro expansion
@ ~/.julia/dev/MathOptInterface/src/Test/Test.jl:272 [inlined]
[5] macro expansion
@ ~/.julia/juliaup/julia-1.11.0+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:1700 [inlined]
[6] runtests(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64}; include::Vector{String}, exclude::Vector{String}, warn_unsupported::Bool, verbose::Bool, exclude_tests_after::VersionNumber)
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/Test.jl:267
test_basic_VectorNonlinearFunction_NormInfinityCone: Test Failed at /home/blegat/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:262
Expression: isapprox(MOI.Utilities.canonical(f), constraint_function, config)
Evaluated: isapprox(┌ ┐
│/(+(+(-(+(MOI.VariableIndex(1), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(-(+(MOI.VariableIndex(2), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(-(+(MOI.VariableIndex(3), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(MOI.VariableIndex(1), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(MOI.VariableIndex(2), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(MOI.VariableIndex(3), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), 6.0)│
│/(-(+(MOI.VariableIndex(1), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(-(+(MOI.VariableIndex(1), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), 2.0) │
│/(-(+(MOI.VariableIndex(2), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(-(+(MOI.VariableIndex(2), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), 2.0) │
│/(-(+(MOI.VariableIndex(3), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2)))), +(-(+(MOI.VariableIndex(3), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))), 2.0) │
└ ┘, ┌ ┐
│+(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))) │
│+(MOI.VariableIndex(1), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))│
│+(MOI.VariableIndex(2), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))│
│+(MOI.VariableIndex(3), +(^(MOI.VariableIndex(1), (2)), ^(MOI.VariableIndex(2), (2)), ^(MOI.VariableIndex(3), (2))))│
└ ┘, MathOptInterface.Test.Config{Float64}(0.001, 0.001, MathOptInterface.OPTIMAL, MathOptInterface.INFEASIBLE, Any[MathOptInterface.DualObjectiveValue, MathOptInterface.ConstraintBasisStatus, MathOptInterface.VariableBasisStatus, MathOptInterface.ConstraintDual]))
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.11.0+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:679 [inlined]
[2] _basic_constraint_test_helper(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64}, ::Type{MathOptInterface.VectorNonlinearFunction}, ::Type{MathOptInterface.NormInfinityCone})
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:262
[3] test_basic_VectorNonlinearFunction_NormInfinityCone(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64})
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/test_basic_constraint.jl:396
[4] macro expansion
@ ~/.julia/dev/MathOptInterface/src/Test/Test.jl:272 [inlined]
[5] macro expansion
@ ~/.julia/juliaup/julia-1.11.0+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:1700 [inlined]
[6] runtests(model::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{EAGO.Optimizer{EAGO.Incremental{Cbc.Optimizer}, EAGO.Incremental{Ipopt.Optimizer}, EAGO.DefaultExt}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, config::MathOptInterface.Test.Config{Float64}; include::Vector{String}, exclude::Vector{String}, warn_unsupported::Bool, verbose::Bool, exclude_tests_after::VersionNumber)
@ MathOptInterface.Test ~/.julia/dev/MathOptInterface/src/Test/Test.jl:267 |
blegat
changed the title
Various issues with bridges and VectorNonlinearFunction
isapprox for a VectorNonlinearFunction after simple bridge modifications
Oct 9, 2024
Yeah I think this is where I got stuck and gave up with Xpress... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am working on adding support for
MOI.ScalarNonlinearFunction
to EAGO and I am running into a particular error with some tests.I cannot provide a MWE since I have not pushed any of my changes yet, but this is how I am running my tests.
I have excluded the other tests (which are all
test_basic_VectorNonlinearFunction_
) in this example, but they all return the same error.The way I implemented
MOI.ScalarNonlinearFunction
is similar to Optim.jl https://github.com/JuliaNLSolvers/Optim.jl/blob/658c39a316bda911cddf442702b11bf086f1b5ba/ext/OptimMOIExt.jlwhere the functions are added to a
MOI.Nonlinear.Model
and then used to create aMOI.Nonlinear.Evaluator
andMOI.NLPBlockData
to continue using the old nonlinear interface.I am not sure if this issue is because I am not directly storing the functions or something else, but I figured I would check here first for insight before moving forward.
Thanks in advance.
The text was updated successfully, but these errors were encountered: