R/071_atoms_elementwise_neg.R

Defines functions neg

Documented in neg

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

## CVXPY SOURCE: atoms/elementwise/neg.py
## Neg -- negative part -min(x, 0)

#' Negative part: -min(x, 0)
#'
#' @param x An Expression
#' @returns A negated Minimum atom
#' @export
neg <- function(x) {
  -Minimum(x, 0)
}

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.