Get the problem data used in the call to the solver.

get_problem_data(object, solver, gp)

Arguments

object

A Problem object.

solver

A string indicating the solver that the problem data is for. Call installed_solvers() to see all available.

gp

(Optional) A logical value indicating whether the problem is a geometric program.

Value

A list containing the data for the solver, the solving chain for the problem, and the inverse data needed to invert the solution.

Examples

a <- Variable(name = "a")
data <- get_problem_data(Problem(Minimize(exp(a) + 2)), "SCS")[[1]]
data[["dims"]]
#> An object of class "ConeDims"
#> Slot "constr_map":
#> list()
#> 
#> Slot "zero":
#> [1] 0
#> 
#> Slot "nonpos":
#> [1] 0
#> 
#> Slot "exp":
#> [1] 1
#> 
#> Slot "soc":
#> list()
#> 
#> Slot "psd":
#> list()
#> 
data[["c"]]
#> [1] 1 0
data[["A"]]
#> 3 x 2 sparse Matrix of class "dgCMatrix"
#>           
#> [1,]  . -1
#> [2,]  .  .
#> [3,] -1  .

x <- Variable(2, name = "x")
data <- get_problem_data(Problem(Minimize(p_norm(x) + 3)), "ECOS")[[1]]
data[["dims"]]
#> An object of class "ConeDims"
#> Slot "constr_map":
#> list()
#> 
#> Slot "zero":
#> [1] 0
#> 
#> Slot "nonpos":
#> [1] 0
#> 
#> Slot "exp":
#> [1] 0
#> 
#> Slot "soc":
#> [[1]]
#> [1] 3
#> 
#> 
#> Slot "psd":
#> list()
#> 
data[["c"]]
#> [1] 1 0 0
data[["A"]]
#> 0 x 0 diagonal matrix of class "ddiMatrix"
#> <0 x 0 matrix>
data[["G"]]
#> 3 x 3 sparse Matrix of class "dgCMatrix"
#>              
#> [1,] -1  .  .
#> [2,]  . -1  .
#> [3,]  .  . -1