Learn R Programming

CVXR (version 0.99-7)

NonNegative-class: The NonNegative class.

Description

This class represents a variable constrained to be non-negative.

Usage

NonNegative(rows = 1, cols = 1, name = NA_character_)

# S4 method for NonNegative as.character(x)

# S4 method for NonNegative canonicalize(object)

# S4 method for NonNegative is_positive(object)

# S4 method for NonNegative is_negative(object)

Arguments

rows

The number of rows in the variable.

cols

The number of columns in the variable.

name

(Optional) A character string representing the name of the variable.

x, object

A '>NonNegative object.

Methods (by generic)

  • canonicalize: Enforce that the variable be non-negative.

  • is_positive: Always true since the variable is non-negative.

  • is_negative: Always false since the variable is non-negative.

Slots

id

(Internal) A unique identification number used internally.

rows

The number of rows in the variable.

cols

The number of columns in the variable.

name

(Optional) A character string representing the name of the variable.

primal_value

(Internal) The primal value of the variable stored internally.

Examples

Run this code
# NOT RUN {
x <- NonNegative(3, 3)
as.character(x)
canonicalize(x)
is_positive(x)
is_negative(x)
# }

Run the code above in your browser using DataLab