Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dnlp2smooth/canonicalizers/div_canon.R
#####
## CVXPY SOURCE: reductions/dnlp2smooth/canonicalizers/div_canon.py
## Canonicalize div(f(x), g(x)) as f(x) * power(z, -1), z = g(x), z >= 0.
.dnlp_div_MIN_INIT <- 1e-3
.smooth_div_canon <- function(expr, args) {
if (!is_nonneg(args[[2L]])) {
cli_warn(c(
"CVXPY (DNLP) could not verify that the denominator of a division",
"i" = "appearing in your problem is nonnegative. The solver will proceed",
"i" = "under the assumption that the denominator is nonnegative. If this",
"i" = "assumption is incorrect, the solution may be invalid."
))
}
z <- Variable(.shape(args[[2L]]), nonneg = TRUE)
v <- value(args[[2L]])
if (!is.null(v)) value(z) <- pmax(v, .dnlp_div_MIN_INIT)
list(args[[1L]] * power(z, -1), list(z == args[[2L]]))
}
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.