Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dcp2cone/canonicalizers/maximum_canon.R
#####
## CVXPY SOURCE: reductions/eliminate_pwl/canonicalizers/maximum_canon.py
## max(x1, x2, ...) -> t where t >= xi for all i
maximum_canon <- function(expr, args, solver_context = NULL) {
## CVXPY wraps t with nonneg_wrap/nonpos_wrap to preserve sign.
## We achieve the same by creating t with appropriate Variable attributes.
t <- Variable(shape = expr@shape,
nonneg = is_nonneg(expr),
nonpos = is_nonpos(expr))
constraints <- lapply(args, function(elem) t >= elem)
list(t, constraints)
}
method(dcp_canonicalize, Maximum) <- maximum_canon
method(has_dcp_canon, Maximum) <- 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.