Pnorm-class {CVXR}R Documentation

The Pnorm class.

Description

This class represents the vector p-norm.

Usage

Pnorm(x, p = 2, axis = NA_real_, keepdims = FALSE, max_denom = 1024)

## S4 method for signature 'Pnorm'
allow_complex(object)

## S4 method for signature 'Pnorm'
to_numeric(object, values)

## S4 method for signature 'Pnorm'
validate_args(object)

## S4 method for signature 'Pnorm'
sign_from_args(object)

## S4 method for signature 'Pnorm'
is_atom_convex(object)

## S4 method for signature 'Pnorm'
is_atom_concave(object)

## S4 method for signature 'Pnorm'
is_atom_log_log_convex(object)

## S4 method for signature 'Pnorm'
is_atom_log_log_concave(object)

## S4 method for signature 'Pnorm'
is_incr(object, idx)

## S4 method for signature 'Pnorm'
is_decr(object, idx)

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

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

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

## S4 method for signature 'Pnorm'
.domain(object)

## S4 method for signature 'Pnorm'
.grad(object, values)

## S4 method for signature 'Pnorm'
.column_grad(object, value)

Arguments

x

An Expression representing a vector or matrix.

p

A number greater than or equal to 1, or equal to positive infinity.

axis

(Optional) The dimension across which to apply the function: 1 indicates rows, 2 indicates columns, and NA indicates rows and columns. The default is NA.

keepdims

(Optional) Should dimensions be maintained when applying the atom along an axis? If FALSE, result will be collapsed into an n x 1 column vector. The default is FALSE.

max_denom

(Optional) The maximum denominator considered in forming a rational approximation for p. The default is 1024.

object

A Pnorm object.

values

A list of numeric values for the arguments

idx

An index into the atom.

value

A numeric value

Details

If given a matrix variable, Pnorm will treat it as a vector and compute the p-norm of the concatenated columns.

For p \geq 1, the p-norm is given by

\|x\|_p = \left(\sum_{i=1}^n |x_i|^p\right)^{1/p}

with domain x \in \mathbf{R}^n. For p < 1, p\neq 0, the p-norm is given by

\|x\|_p = \left(\sum_{i=1}^n x_i^p\right)^{1/p}

with domain x \in \mathbf{R}^n_+.

Methods (by generic)

Slots

x

An Expression representing a vector or matrix.

p

A number greater than or equal to 1, or equal to positive infinity.

max_denom

The maximum denominator considered in forming a rational approximation for p.

axis

(Optional) The dimension across which to apply the function: 1 indicates rows, 2 indicates columns, and NA indicates rows and columns. The default is NA.

keepdims

(Optional) Should dimensions be maintained when applying the atom along an axis? If FALSE, result will be collapsed into an n x 1 column vector. The default is FALSE.

.approx_error

(Internal) The absolute difference between p and its rational approximation.

.original_p

(Internal) The original input p.


[Package CVXR version 1.0-12 Index]