Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dcp2cone/canonicalizers/abs_canon.R
#####
## CVXPY SOURCE: reductions/eliminate_pwl/canonicalizers/abs_canon.py
## |x| -> t where t >= x, t >= -x
abs_canon <- function(expr, args, solver_context = NULL) {
x <- args[[1L]]
bounds <- get_expr_bounds_if_supported(expr, solver_context)
t <- Variable(shape = .shape(expr), bounds = bounds)
constraints <- list(t >= x, t >= -x)
## CVXPY abs_canon: initialize the epigraph variable so a DNLP that uses abs
## has every variable initialized (t = |x| at the incumbent point).
if (!is.null(value(expr))) value(t) <- value(expr)
list(t, constraints)
}
method(dcp_canonicalize, Abs) <- abs_canon
method(has_dcp_canon, Abs) <- function(expr) TRUE
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.