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

scalene

Scalene Function


Description

The elementwise weighted sum of the positive and negative portions of an expression, α\max(x_i,0) - β\min(x_i,0). This is equivalent to alpha*pos(x) + beta*neg(x).

Usage

scalene(x, alpha, beta)

Arguments

x

An Expression, vector, or matrix.

alpha

The weight on the positive portion of x.

beta

The weight on othe negative portion of x.

Value

An Expression representing the scalene function evaluated at the input.

Examples

## Not run: 
A <- Variable(2,2)
val <- cbind(c(-5,2), c(-3,1))
prob <- Problem(Minimize(scalene(A,2,3)[1,1]), list(A == val))
result <- solve(prob)
result$value
result$getValue(scalene(A, 0.7, 0.3))

## End(Not run)

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.