Problem-class {CVXR}R Documentation

The Problem class.

Description

This class represents a convex optimization problem.

Usage

Problem(objective, constraints = list())

## S4 method for signature 'Problem'
objective(object)

## S4 replacement method for signature 'Problem'
objective(object) <- value

## S4 method for signature 'Problem'
constraints(object)

## S4 replacement method for signature 'Problem'
constraints(object) <- value

## S4 method for signature 'Problem'
value(object)

## S4 replacement method for signature 'Problem'
value(object) <- value

## S4 method for signature 'Problem'
status(object)

## S4 method for signature 'Problem'
is_dcp(object)

## S4 method for signature 'Problem'
is_dgp(object)

## S4 method for signature 'Problem'
is_qp(object)

## S4 method for signature 'Problem'
canonicalize(object)

## S4 method for signature 'Problem'
is_mixed_integer(object)

## S4 method for signature 'Problem'
variables(object)

## S4 method for signature 'Problem'
parameters(object)

## S4 method for signature 'Problem'
constants(object)

## S4 method for signature 'Problem'
atoms(object)

## S4 method for signature 'Problem'
size_metrics(object)

## S4 method for signature 'Problem'
solver_stats(object)

## S4 replacement method for signature 'Problem'
solver_stats(object) <- value

## S4 method for signature 'Problem,character,logical'
get_problem_data(object, solver, gp)

## S4 method for signature 'Problem,character,missing'
get_problem_data(object, solver, gp)

## S4 method for signature 'Problem'
unpack_results(object, solution, chain, inverse_data)

Arguments

objective

A Minimize or Maximize object representing the optimization objective.

constraints

(Optional) A list of Constraint objects representing constraints on the optimization variables.

object

A Problem class.

value

A Minimize or Maximize object (objective), list of Constraint objects (constraints), or numeric scalar (value).

solver

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

gp

Is the problem a geometric problem?

solution

A Solution object.

chain

The corresponding solving Chain.

inverse_data

A InverseData object or list containing data necessary for the inversion.

Methods (by generic)

Slots

objective

A Minimize or Maximize object representing the optimization objective.

constraints

(Optional) A list of constraints on the optimization variables.

value

(Internal) Used internally to hold the value of the optimization objective at the solution.

status

(Internal) Used internally to hold the status of the problem solution.

.cached_data

(Internal) Used internally to hold cached matrix data.

.separable_problems

(Internal) Used internally to hold separable problem data.

.size_metrics

(Internal) Used internally to hold size metrics.

.solver_stats

(Internal) Used internally to hold solver statistics.

Examples

x <- Variable(2)
p <- Problem(Minimize(p_norm(x, 2)), list(x >= 0))
is_dcp(p)
x <- Variable(2)
A <- matrix(c(1,-1,-1, 1), nrow = 2)
p <- Problem(Minimize(quad_form(x, A)), list(x >= 0))
is_qp(p)

[Package CVXR version 1.0-14 Index]