powered by
The elementwise absolute value.
# S4 method for Expression abs(x)
An Expression representing the absolute value of the input.
An Expression.
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