Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dcp2cone/canonicalizers/xexp_canon.R
#####
## CVXPY SOURCE: reductions/dcp2cone/canonicalizers/xexp_canon.py
## x*exp(x) -> t via ExpCone + power_approx for x^2 bound
xexp_canon <- function(expr, args, solver_context = NULL) {
x <- args[[1L]]
u <- Variable(shape = expr@shape, nonneg = TRUE)
t <- Variable(shape = expr@shape, nonneg = TRUE)
power_expr <- power(x, 2)
power_result <- power_approx_canon(power_expr, power_expr@args)
power_obj <- power_result[[1L]]
constraints <- power_result[[2L]]
constraints <- c(constraints, list(ExpCone(u, x, t), u >= power_obj, x >= 0))
list(t, constraints)
}
method(dcp_canonicalize, Xexp) <- xexp_canon
method(has_dcp_canon, Xexp) <- 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.