R/073_atoms_elementwise_scalene.R

Defines functions scalene

Documented in scalene

#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/atoms/elementwise/scalene.R
#####

## CVXPY SOURCE: atoms/elementwise/scalene.py
## Scalene penalty: alpha * pos(x) + beta * neg(x)

#' Scalene penalty: alpha * pos(x) + beta * neg(x)
#'
#' @param x An Expression
#' @param alpha Coefficient for the positive part
#' @param beta Coefficient for the negative part
#' @returns An Expression representing the scalene penalty
#' @export
scalene <- function(x, alpha, beta) {
  alpha * pos(x) + beta * neg(x)
}

Try the CVXR package in your browser

Any scripts or data that you put into this service are public.

CVXR documentation built on March 6, 2026, 9:10 a.m.