Constant-class {CVXR}R Documentation

The Constant class.

Description

This class represents a constant.

Coerce an R object or expression into the Constant class.

Usage

Constant(value)

## S4 method for signature 'Constant'
show(object)

## S4 method for signature 'Constant'
name(x)

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

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

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

## S4 method for signature 'Constant'
grad(object)

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

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

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

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

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

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

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

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

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

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

as.Constant(expr)

Arguments

value

A numeric element, vector, matrix, or data.frame. Vectors are automatically cast into a matrix column.

x, object

A Constant object.

expr

An Expression, numeric element, vector, matrix, or data.frame.

Value

A Constant representing the input as a constant.

Methods (by generic)

Slots

value

A numeric element, vector, matrix, or data.frame. Vectors are automatically cast into a matrix column.

sparse

(Internal) A logical value indicating whether the value is a sparse matrix.

is_pos

(Internal) A logical value indicating whether all elements are non-negative.

is_neg

(Internal) A logical value indicating whether all elements are non-positive.

Examples

x <- Constant(5)
y <- Constant(diag(3))
get_data(y)
value(y)
is_nonneg(y)
size(y)
as.Constant(y)

[Package CVXR version 1.0-12 Index]