Learn R Programming

CVXR (version 0.99-7)

Reshape-class: The Reshape class.

Description

This class represents the reshaping of an expression. The operator vectorizes the expression, then unvectorizes it into the new shape. Entries are stored in column-major order.

Usage

Reshape(expr, rows, cols)

# S4 method for Reshape validate_args(object)

# S4 method for Reshape to_numeric(object, values)

# S4 method for Reshape size_from_args(object)

# S4 method for Reshape get_data(object)

# S4 method for Reshape graph_implementation(object, arg_objs, size, data = NA_real_)

Arguments

expr

An '>Expression or numeric matrix.

rows

The new number of rows.

cols

The new number of columns.

object

A '>Reshape object.

values

A list of arguments to the atom.

arg_objs

A list of linear expressions for each argument.

size

A vector with two elements representing the size of the resulting expression.

data

A list of additional data required by the atom.

Methods (by generic)

  • validate_args: Check the new shape has the same number of entries as the old.

  • to_numeric: Reshape the value into the specified dimensions.

  • size_from_args: The c(rows, cols) of the new expression.

  • get_data: Returns list(rows, cols).

  • graph_implementation: The graph implementation of the atom.

Slots

expr

An '>Expression or numeric matrix.

rows

The new number of rows.

cols

The new number of columns.