-
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.
Recognize std SOCs with constant lhs, by substituting a fixed variable
- Loading branch information
Showing
7 changed files
with
71 additions
and
9 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
6 changes: 6 additions & 0 deletions
6
test/end2end/cases/categorized/fast/conic/totalvar2d_4e_4.dat
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,6 @@ | ||
data; | ||
|
||
param n := 10; | ||
param m := 20; | ||
|
||
param sigmaVal := 0.004; |
35 changes: 35 additions & 0 deletions
35
test/end2end/cases/categorized/fast/conic/totalvariation2d.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,35 @@ | ||
## 2D Total Variation | ||
## This case study is based mainly on the paper by Goldfarb and Yin [GY05] | ||
## https://docs.mosek.com/latest/pythonfusion/case-studies-total-variation.html | ||
|
||
param n>1; | ||
param m>1; | ||
|
||
param f {i in 1..n, j in 1..m} default ## signal + noise | ||
1.0*(i+j-2)/(n+m) + Normal(0.0, 0.08); | ||
param sigmaVal default 0.0004; | ||
param sigma >=0.0 default sigmaVal*n*m; | ||
|
||
var u {1..n, 1..m} >=0.0, <=1.0; | ||
var delta_uf {1..n, 1..m}; | ||
var t {1..n-1, 1..m-1}; | ||
var delta_plus {1..n-1, 1..m-1, 1..2}; | ||
|
||
minimize TotalVar: | ||
sum {i in 1..n-1, j in 1..m-1} t[i, j]; | ||
|
||
s.t. DefDeltaPlusUp {i in 1..n-1, j in 1..m-1}: | ||
delta_plus[i, j, 1] == u[i+1, j] - u[i, j]; | ||
|
||
s.t. DefDeltaPlusRight {i in 1..n-1, j in 1..m-1}: | ||
delta_plus[i, j, 2] == u[i, j+1] - u[i, j]; | ||
|
||
s.t. DefDeltaUF {i in 1..n, j in 1..m}: | ||
delta_uf[i, j] == u[i, j] - f[i, j]; | ||
|
||
s.t. VariationBound {i in 1..n-1, j in 1..m-1}: | ||
-t[i, j] <= -sqrt(delta_plus[i, j, 1]^2 + delta_plus[i, j, 2]^2); | ||
|
||
s.t. Total2Norm: | ||
sigma >= sqrt( sum {i in 1..n, j in 1..m} delta_uf[i, j]^2 ); | ||
|
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