R
Setup
Once you have downloaded POGS, open R and type
| 1 | > setwd("<pogs>/interface_r/")
 | 
in the R console. The string 1
<pogs>
| 1 | > install.packages("pogs_1.0.tar.gz", repos = NULL, type="source")
 | 
Make sure to replace 1
1.0
To load the POGS library type
| 1 | > library(pogs) | 
R-specific usage
The R interface is a single R function, with signature
| 1 | solution = pogs(A, f, g, params) | 
Inputs:
- 1 - A
- 1 - f- 1 - g- 1 - h- 1 - a- 1 - b- 1 - c- 1 - d- 1 - e- 1 - f- 1 - g
Optional Inputs:
- 1 - params- 1 - rel_tol- 1 - abs_tol- 1 - rho- 1 - max_iter- 1 - quiet- 1 - adaptive_rho
Outputs:
- 1 - solution$x- 1 - solution$y- 1 - solution$x- 1 - solution$y
- 1 - solution$l
- 1 - solution$optval
For more information type
| 1 | > ?pogs | 
\(h\)-Functions
The values 1
f$h
1
g$h
| 1 2 | kAbs, kExp, kHuber, kIdentity, kIndBox01, kIndEq0, kIndGe0, kIndLe0, kLogistic, kMaxNeg0, kMaxPos0, kNegEntr, kNegLog, kRecipr, kSquare, kZero | 
For example to specify that \(g_j(x_j) = |x_j|\) for \(j = 1\ldots 4\) and \(g_5(x_5) = I(x_5 = 0)\), use the syntax
| 1 | > g$h = c(kAbs(4), kIndEq0()) | 
Example Usage
See the examples listed on the left-hand side under Examples.