-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Variables with shape (1,) are not treated as scalars during translation, even though they are equivalent in cvxpy. In gurobipy however, using them as optimization objective generates warnings from numpy. Also, merge all `abs` tests in the same function. Otherwise, the scalar, vector and matrix containers will grow very large as more genexprs are added.
- Loading branch information
1 parent
9983b5f
commit e1e8cac
Showing
23 changed files
with
174 additions
and
31 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,28 @@ | ||
CVXPY | ||
Minimize | ||
abs(X) | ||
Subject To | ||
Bounds | ||
X free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
C0 | ||
Subject To | ||
R0: - C0 + C1 <= 0 | ||
R1: - C0 - C1 <= 0 | ||
Bounds | ||
C0 free | ||
C1 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Minimize | ||
0 X[0] + abs_1 | ||
Subject To | ||
Bounds | ||
X[0] free | ||
General Constraints | ||
GC0: abs_1 = ABS ( X[0] ) | ||
End |
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,29 @@ | ||
CVXPY | ||
Minimize | ||
abs(X) + 1.0 | ||
Subject To | ||
Bounds | ||
X free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
C0 | ||
Subject To | ||
R0: - C0 + C1 <= 0 | ||
R1: - C0 - C1 <= 0 | ||
Bounds | ||
C0 free | ||
C1 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Minimize | ||
0 X[0] + abs_1 + Constant | ||
Subject To | ||
Bounds | ||
X[0] free | ||
Constant = 1 | ||
General Constraints | ||
GC0: abs_1 = ABS ( X[0] ) | ||
End |
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,35 @@ | ||
CVXPY | ||
Minimize | ||
abs(X) + abs(Y) | ||
Subject To | ||
Bounds | ||
X free | ||
Y free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
C0 + C1 | ||
Subject To | ||
R0: - C0 + C2 <= 0 | ||
R1: - C0 - C2 <= 0 | ||
R2: - C1 + C3 <= 0 | ||
R3: - C1 - C3 <= 0 | ||
Bounds | ||
C0 free | ||
C1 free | ||
C2 free | ||
C3 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Minimize | ||
0 X[0] + abs_1 + 0 Y + abs_2 | ||
Subject To | ||
Bounds | ||
X[0] free | ||
Y free | ||
General Constraints | ||
GC0: abs_1 = ABS ( X[0] ) | ||
GC1: abs_2 = ABS ( Y ) | ||
End |
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,33 @@ | ||
CVXPY | ||
Minimize | ||
abs(X + Y) | ||
Subject To | ||
Bounds | ||
X free | ||
Y free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
C0 | ||
Subject To | ||
R0: - C0 + C1 + C2 <= 0 | ||
R1: - C0 - C1 - C2 <= 0 | ||
Bounds | ||
C0 free | ||
C1 free | ||
C2 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Minimize | ||
abs_2 | ||
Subject To | ||
R0: - X[0] - Y + index_1 = 0 | ||
Bounds | ||
X[0] free | ||
Y free | ||
index_1 free | ||
General Constraints | ||
GC0: abs_2 = ABS ( index_1 ) | ||
End |
File renamed without changes.
File renamed without changes.
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