-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't represent (var|const) >= abs(...) as SOCP #192
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -698,6 +698,7 @@ class Constraints2Expr { | |
ck.ConvertConstraint(ie.GetIndex()); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
|
||
|
This file contains 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
This file contains 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
17 changes: 17 additions & 0 deletions
17
test/end2end/cases/categorized/fast/conic/socp_13_abs_stdcone.mod
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#################################### | ||
# Test that we don't convert abs(x) <= 5 into a cone | ||
# TODO Also perform the actual test, now it's just for solving | ||
#################################### | ||
|
||
var b1 binary; | ||
var b2 binary; | ||
var x >=-19 <=32; | ||
var y >= -12 <= 5; | ||
|
||
minimize Obj: b1 - b2 - x + 3*y; | ||
|
||
var charge_diff = abs(x-y); | ||
|
||
s.t. Con: b1 && b2 ==> x<=y; | ||
|
||
s.t. Cone: charge_diff <= if b1>=1 then 5 else 15; |