Solves the problem and returns the optimal objective value. After solving,
variable values can be retrieved with value, constraint
dual values with dual_value, and solver information with
solver_stats.
Usage
psolve(
problem,
solver = NULL,
gp = FALSE,
qcp = FALSE,
verbose = FALSE,
warm_start = FALSE,
feastol = NULL,
reltol = NULL,
abstol = NULL,
num_iter = NULL,
...
)Arguments
- problem
A
Problemobject.- solver
Character string naming the solver to use (e.g.,
"CLARABEL","SCS","OSQP","HIGHS"), orNULLfor automatic selection.- gp
Logical; if
TRUE, solve as a geometric program (DGP).- qcp
Logical; if
TRUE, solve as a quasiconvex program (DQCP) via bisection. Only needed for non-DCP DQCP problems.- verbose
Logical; if
TRUE, print solver output.- warm_start
Logical; if
TRUE, use the current variable values as a warm-start point for the solver.- feastol
Numeric or
NULL; feasibility tolerance. Mapped to the solver-specific parameter name (e.g.,tol_feasfor Clarabel,eps_prim_inffor OSQP). IfNULL(default), the solver's own default is used.- reltol
Numeric or
NULL; relative tolerance. Mapped to the solver-specific parameter name (e.g.,tol_gap_relfor Clarabel,eps_relfor OSQP/SCS). IfNULL(default), the solver's own default is used.- abstol
Numeric or
NULL; absolute tolerance. Mapped to the solver-specific parameter name (e.g.,tol_gap_absfor Clarabel,eps_absfor OSQP/SCS). IfNULL(default), the solver's own default is used.- num_iter
Integer or
NULL; maximum number of solver iterations. Mapped to the solver-specific parameter name (e.g.,max_iterfor Clarabel/OSQP,max_itersfor SCS). IfNULL(default), the solver's own default is used.- ...
Additional solver-specific options passed directly to the solver. If a solver-native parameter name conflicts with a standard parameter (e.g., both
feastol = 1e-3andtol_feas = 1e-6are given), the solver-native name in...takes priority. For DQCP problems (qcp = TRUE), additional arguments includelow,high,eps,max_iters, andmax_iters_interval_search.
Value
The optimal objective value (numeric scalar), or Inf /
-Inf for infeasible / unbounded problems.
