Learn R Programming

CVXR (version 1.0-14)

abs,Expression-method: Absolute Value

Description

The elementwise absolute value.

Usage

# S4 method for Expression
abs(x)

Value

An Expression representing the absolute value of the input.

Arguments

x

An Expression.

Examples

Run this code
A <- Variable(2,2)
prob <- Problem(Minimize(sum(abs(A))), list(A <= -2))
result <- solve(prob)
result$value
result$getValue(A)

Run the code above in your browser using DataLab