-
Notifications
You must be signed in to change notification settings - Fork 94
Add power cone unit test #768
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
Conversation
It's fixed on latest master: |
A rebase should fix the CI failures |
src/Test/contconic.jl
Outdated
rtol = config.rtol | ||
# Problem POW1 | ||
# max z | ||
# st x^0.9 * y^(0.1) >= z (i.e (x, y, z) are in the 3d power cone with a=0.9) |
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.
Would be clearer to have absolute value |z|
on the RHS
da6868f
to
754f85b
Compare
@test MOI.supports(model, MOI.ObjectiveSense()) | ||
|
||
if vecofvars | ||
@test MOI.supports_constraint(model, MOI.VectorOfVariables, MOI.PowerCone{Float64}) |
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 am not sure about this line? Should it be MOI.PowerCone
or MOI.PowerCone{Float64}
? Either way it seems to produce different errors.
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.
It should be PowerCone{typeof(a)}
so PowerCone{Float64}
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.
It seems you need to add MOI.PowerCone,
here: https://github.com/JuliaOpt/MathOptInterface.jl/blob/ef83d2381b2e26a3e6466b8bc34b6687c7c20c61/test/Bridges/lazy_bridge_optimizer.jl#L17
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 doesn't seem to solve it. There are some errors in the Bridges unit tests related to the fact that PowerCone is typed. I am not really sure, what's going on there.
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.
Can you post the errors or push the suggested fix so that I see the errors on Travis ?
6bce5ae
to
e363958
Compare
(MOI.Zeros, MOI.Nonnegatives, MOI.Nonpositives, MOI.SecondOrderCone, | ||
MOI.ExponentialCone, MOI.PositiveSemidefiniteConeTriangle), | ||
(), | ||
(MOI.PowerCone), |
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 possibly the source of the error because (MOI.PowerCone)
isn't a tuple. Try (MOI.PowerCone,)
instead.
Codecov Report
@@ Coverage Diff @@
## master #768 +/- ##
==========================================
- Coverage 94.26% 94.03% -0.23%
==========================================
Files 59 59
Lines 6481 6523 +42
==========================================
+ Hits 6109 6134 +25
- Misses 372 389 +17
Continue to review full report at Codecov.
|
I realised that currently there aren't any unit tests available for power cone problems. I added one feasible power cone problem to the
contconic
test problem set and tested with both COSMO and SCS#master.I used the following test script:
The tests pass for COSMO but with SCS I get the following error:
I am not sure whether that error is due to a mistake in