Learn R Programming

CVXR (version 1.0)

abs,Expression-method: Absolute Value

Description

The elementwise absolute value.

Usage

# S4 method for Expression
abs(x)

Arguments

x

An '>Expression.

Value

An '>Expression representing the absolute value of the input.

Examples

Run this code
# NOT RUN {
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