abs: Absolute Value

abs,Expression-methodR Documentation

Absolute Value

Description

The elementwise absolute value.

Usage

## S4 method for signature 'Expression'
abs(x)

Arguments

x

An Expression.

Value

An Expression representing the absolute value of the input.

Examples

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

CVXR documentation built on June 27, 2024, 5:11 p.m.