Learn R Programming

CVXR (version 0.99-7)

<=,Expression,Expression-method: The LeqConstraint class.

Description

This class represents a \(\leq\) inequality constraint.

Usage

# S4 method for Expression,Expression
<=(e1, e2)

# S4 method for Expression,ConstVal <=(e1, e2)

# S4 method for ConstVal,Expression <=(e1, e2)

# S4 method for Expression,Expression <(e1, e2)

# S4 method for Expression,ConstVal <(e1, e2)

# S4 method for ConstVal,Expression <(e1, e2)

# S4 method for Expression,Expression >=(e1, e2)

# S4 method for Expression,ConstVal >=(e1, e2)

# S4 method for ConstVal,Expression >=(e1, e2)

# S4 method for Expression,Expression >(e1, e2)

# S4 method for Expression,ConstVal >(e1, e2)

# S4 method for ConstVal,Expression >(e1, e2)

LeqConstraint(lh_exp, rh_exp)

# S4 method for LeqConstraint as.character(x)

# S4 method for LeqConstraint id(object)

# S4 method for LeqConstraint size(object)

# S4 method for LeqConstraint is_dcp(object)

# S4 method for LeqConstraint canonicalize(object)

# S4 method for LeqConstraint variables(object)

# S4 method for LeqConstraint parameters(object)

# S4 method for LeqConstraint constants(object)

# S4 method for LeqConstraint residual(object)

# S4 method for LeqConstraint value(object)

# S4 method for LeqConstraint violation(object)

Arguments

e1, e2

The '>Expression objects or numeric constants to compare.

lh_exp

An '>Expression, numeric element, vector, or matrix representing the left-hand side of the inequality.

rh_exp

An '>Expression, numeric element, vector, or matrix representing the right-hand side of the inequality.

x, object

A '>LeqConstraint object.

Methods (by generic)

  • id: The constr_id of the constraint.

  • size: The size of the left-hand expression minus the right-hand expression.

  • is_dcp: The constraint is DCP if the left-hand expression is convex and the right-hand expression is concave.

  • canonicalize: The graph implementation of the object. Marks the top level constraint as the dual_holder so the dual value will be saved to the '>LeqConstraint.

  • variables: List of '>Variable objects in the constraint.

  • parameters: List of '>Parameter objects in the constraint.

  • constants: List of '>Constant objects in the constraint.

  • residual: The elementwise maximum of the left-hand expression minus the right-hand expression, i.e. max_elemwise(lh_exp - rh_exp, 0).

  • value: A logical value indicating whether the constraint holds. Tolerance is currently set at 1e-4.

  • violation: A matrix representing the amount by which the constraint is off, i.e. the numeric value of the residual expression.

Slots

constr_id

(Internal) A unique integer identification number used internally.

lh_exp

An '>Expression, numeric element, vector, or matrix representing the left-hand side of the inequality.

rh_exp

An '>Expression, numeric element, vector, or matrix representing the right-hand side of the inequality.

args

(Internal) A list that holds lh_exp and rh_exp for internal use.

.expr

(Internal) An '>Expression representing lh_exp - rh_exp for internal use.

dual_variable

(Internal) A '>Variable representing the dual variable associated with the constraint.