psolve: Solve a Convex Optimization Problem

View source: R/132_problems_problem.R

psolveR Documentation

Solve a Convex Optimization Problem

Description

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,
  ...
)

Arguments

problem

A Problem object.

solver

Character string naming the solver to use (e.g., "CLARABEL", "SCS", "OSQP", "HIGHS"), or NULL for 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.

...

Solver options passed to solver_opts(). Includes chain-construction options (use_quad_obj), standard tolerances (feastol, reltol, abstol, num_iter), and solver-specific parameters (e.g., eps_abs, scip_params). See solver_opts for details. For DQCP problems (qcp = TRUE), additional arguments include low, high, eps, max_iters, and max_iters_interval_search.

Value

The optimal objective value (numeric scalar), or Inf / -Inf for infeasible / unbounded problems.

See Also

Problem, status, solver_stats, solver_default_param

Examples

x <- Variable()
prob <- Problem(Minimize(x), list(x >= 5))
result <- psolve(prob, solver = "CLARABEL")


CVXR documentation built on April 4, 2026, 9:08 a.m.