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

norm

Matrix Norm


Description

The matrix norm, which can be the 1-norm ("1"), infinity-norm ("I"), Frobenius norm ("F"), maximum modulus of all the entries ("M"), or the spectral norm ("2"), as determined by the value of type.

Usage

## S4 method for signature 'Expression,character'
norm(x, type)

Arguments

x

An Expression.

type

A character indicating the type of norm desired.

  • "O", "o" or "1" specifies the 1-norm (maximum absolute column sum).

  • "I" or "i" specifies the infinity-norm (maximum absolute row sum).

  • "F" or "f" specifies the Frobenius norm (Euclidean norm of the vectorized x).

  • "M" or "m" specifies the maximum modulus of all the elements in x.

  • "2" specifies the spectral norm, which is the largest singular value of x.

Value

An Expression representing the norm of the input.

See Also

The p_norm function calculates the vector p-norm.

Examples

C <- Variable(3,2)
val <- Constant(rbind(c(1,2), c(3,4), c(5,6)))
prob <- Problem(Minimize(norm(C, "F")), list(C == val))
result <- solve(prob, solver = "SCS")
result$value

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.