Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Leaf-class

The Leaf class.


Description

This class represents a leaf node, i.e. a Variable, Constant, or Parameter.

Usage

## S4 method for signature 'Leaf'
get_data(object)

## S4 method for signature 'Leaf'
dim(x)

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

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

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

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

## S4 method for signature 'Leaf'
is_convex(object)

## S4 method for signature 'Leaf'
is_concave(object)

## S4 method for signature 'Leaf'
is_log_log_convex(object)

## S4 method for signature 'Leaf'
is_log_log_concave(object)

## S4 method for signature 'Leaf'
is_nonneg(object)

## S4 method for signature 'Leaf'
is_nonpos(object)

## S4 method for signature 'Leaf'
is_pos(object)

## S4 method for signature 'Leaf'
is_neg(object)

## S4 method for signature 'Leaf'
is_hermitian(object)

## S4 method for signature 'Leaf'
is_symmetric(object)

## S4 method for signature 'Leaf'
is_imag(object)

## S4 method for signature 'Leaf'
is_complex(object)

## S4 method for signature 'Leaf'
domain(object)

## S4 method for signature 'Leaf'
project(object, value)

## S4 method for signature 'Leaf'
project_and_assign(object, value)

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

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

## S4 method for signature 'Leaf'
validate_val(object, val)

## S4 method for signature 'Leaf'
is_psd(object)

## S4 method for signature 'Leaf'
is_nsd(object)

## S4 method for signature 'Leaf'
is_quadratic(object)

## S4 method for signature 'Leaf'
is_pwl(object)

Arguments

object, x

A Leaf object.

value

A numeric scalar, vector, or matrix.

val

The assigned value.

Methods (by generic)

  • get_data: Leaves are not copied.

  • dim: The dimensions of the leaf node.

  • variables: List of Variable objects in the leaf node.

  • parameters: List of Parameter objects in the leaf node.

  • constants: List of Constant objects in the leaf node.

  • atoms: List of Atom objects in the leaf node.

  • is_convex: A logical value indicating whether the leaf node is convex.

  • is_concave: A logical value indicating whether the leaf node is concave.

  • is_log_log_convex: Is the expression log-log convex?

  • is_log_log_concave: Is the expression log-log concave?

  • is_nonneg: A logical value indicating whether the leaf node is nonnegative.

  • is_nonpos: A logical value indicating whether the leaf node is nonpositive.

  • is_pos: Is the expression positive?

  • is_neg: Is the expression negative?

  • is_hermitian: A logical value indicating whether the leaf node is hermitian.

  • is_symmetric: A logical value indicating whether the leaf node is symmetric.

  • is_imag: A logical value indicating whether the leaf node is imaginary.

  • is_complex: A logical value indicating whether the leaf node is complex.

  • domain: A list of constraints describing the closure of the region where the leaf node is finite. Default is the full domain.

  • project: Project value onto the attribute set of the leaf.

  • project_and_assign: Project and assign a value to the leaf.

  • value: Get the value of the leaf.

  • value<-: Set the value of the leaf.

  • validate_val: Check that val satisfies symbolic attributes of leaf.

  • is_psd: A logical value indicating whether the leaf node is a positive semidefinite matrix.

  • is_nsd: A logical value indicating whether the leaf node is a negative semidefinite matrix.

  • is_quadratic: Leaf nodes are always quadratic.

  • is_pwl: Leaf nodes are always piecewise linear.

Slots

id

(Internal) A unique integer identification number used internally.

dim

The dimensions of the leaf.

value

The numeric value of the leaf.

nonneg

Is the leaf nonnegative?

nonpos

Is the leaf nonpositive?

complex

Is the leaf a complex number?

imag

Is the leaf imaginary?

symmetric

Is the leaf a symmetric matrix?

diag

Is the leaf a diagonal matrix?

PSD

Is the leaf positive semidefinite?

NSD

Is the leaf negative semidefinite?

hermitian

Is the leaf hermitian?

boolean

Is the leaf boolean? Is the variable boolean? May be TRUE = entire leaf is boolean, FALSE = entire leaf is not boolean, or a vector of indices which should be constrained as boolean, where each index is a vector of length exactly equal to the length of dim.

integer

Is the leaf integer? The semantics are the same as the boolean argument.

sparsity

A matrix representing the fixed sparsity pattern of the leaf.

pos

Is the leaf strictly positive?

neg

Is the leaf strictly negative?


CVXR

Disciplined Convex Optimization

v1.0-10
Apache License 2.0 | file LICENSE
Authors
Anqi Fu [aut, cre], Balasubramanian Narasimhan [aut], David W Kang [aut], Steven Diamond [aut], John Miller [aut], Stephen Boyd [ctb], Paul Kunsberg Rosenfield [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.