-
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.
Fairly straightforward as the implementation is the same as for the 1-norm. However, we are starting to see small differences in results in some tests. For now, the parameters were chosen to get a similar solution with and without this library but changing them a little bit makes the backfill test start to fail. Part of #23
- Loading branch information
1 parent
89da4e4
commit d189eb7
Showing
25 changed files
with
625 additions
and
77 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
CVXPY | ||
Minimize | ||
Pnorm(x, 2) + Pnorm([ 1. -1.], 2) | ||
Subject To | ||
Bounds | ||
x free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
x_0 | ||
Subject To | ||
R0: - x_0 + soc_t_0 = 0 | ||
R1: - x_1 + soc_x_1 = 0 | ||
R2: - x_2 + soc_x_2 = 0 | ||
qc0: [ - soc_t_0 ^2 + soc_x_1 ^2 + soc_x_2 ^2 ] <= 0 | ||
Bounds | ||
x_0 free | ||
x_1 free | ||
x_2 free | ||
soc_x_1 free | ||
soc_x_2 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Minimize | ||
0 x[0] + 0 x[1] + norm2_1 + 1.414213562373095 Constant | ||
Subject To | ||
Bounds | ||
x[0] free | ||
x[1] free | ||
Constant = 1 | ||
General Constraints | ||
GC0: norm2_1 = NORM ( 2 ) ( x[0] , x[1] ) | ||
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,37 @@ | ||
CVXPY | ||
Maximize | ||
Sum(x @ [ 1. -1.], None, False) | ||
Subject To | ||
40: Pnorm(x, 2) <= 1.4142135623730951 | ||
Bounds | ||
x free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
- x_0 + x_1 | ||
Subject To | ||
R0: x_2 <= 1.414213562373095 | ||
R1: - x_2 + soc_t_1 = 0 | ||
R2: - x_0 + soc_x_2 = 0 | ||
R3: - x_1 + soc_x_3 = 0 | ||
qc0: [ - soc_t_1 ^2 + soc_x_2 ^2 + soc_x_3 ^2 ] <= 0 | ||
Bounds | ||
x_0 free | ||
x_1 free | ||
x_2 free | ||
soc_x_2 free | ||
soc_x_3 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Maximize | ||
x[0] - x[1] | ||
Subject To | ||
40: norm2_1 <= 1.414213562373095 | ||
Bounds | ||
x[0] free | ||
x[1] free | ||
General Constraints | ||
GC0: norm2_1 = NORM ( 2 ) ( x[0] , x[1] ) | ||
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,43 @@ | ||
CVXPY | ||
Minimize | ||
Pnorm(X, 2) | ||
Subject To | ||
Bounds | ||
X free | ||
End | ||
---------------------------------------- | ||
AFTER COMPILATION | ||
Minimize | ||
x_0 | ||
Subject To | ||
R0: - x_0 + soc_t_0 = 0 | ||
R1: - x_1 + soc_x_1 = 0 | ||
R2: - x_2 + soc_x_2 = 0 | ||
R3: - x_3 + soc_x_3 = 0 | ||
R4: - x_4 + soc_x_4 = 0 | ||
qc0: [ - soc_t_0 ^2 + soc_x_1 ^2 + soc_x_2 ^2 + soc_x_3 ^2 + soc_x_4 ^2 ] | ||
<= 0 | ||
Bounds | ||
x_0 free | ||
x_1 free | ||
x_2 free | ||
x_3 free | ||
x_4 free | ||
soc_x_1 free | ||
soc_x_2 free | ||
soc_x_3 free | ||
soc_x_4 free | ||
End | ||
---------------------------------------- | ||
GUROBI | ||
Minimize | ||
0 X[0,0] + 0 X[0,1] + 0 X[1,0] + 0 X[1,1] + norm2_1 | ||
Subject To | ||
Bounds | ||
X[0,0] free | ||
X[0,1] free | ||
X[1,0] free | ||
X[1,1] free | ||
General Constraints | ||
GC0: norm2_1 = NORM ( 2 ) ( X[0,0] , X[0,1] , X[1,0] , X[1,1] ) | ||
End |
Oops, something went wrong.