Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dcp2cone/canonicalizers/lambda_max_canon.R
#####
## CVXPY SOURCE: reductions/dcp2cone/canonicalizers/lambda_max_canon.py
## lambda_max(A) -> t subject to PSD(t*I - A), symmetry check
lambda_max_canon <- function(expr, args, solver_context = NULL) {
A <- args[[1L]]
n <- A@shape[1L]
t <- Variable()
## promote scalar t to (n,1) vector, then create diagonal matrix
prom_t <- cvxr_promote(t, c(n, 1L))
## t*I_n - A must be PSD
tmp_expr <- DiagVec(prom_t) - A
constr <- list(PSD(tmp_expr))
## Enforce symmetry if A is not known to be symmetric
if (!is_symmetric(A)) {
ut <- upper_tri(A)
lt <- upper_tri(t(A))
constr <- c(constr, list(ut == lt))
}
list(t, constr)
}
method(dcp_canonicalize, LambdaMax) <- lambda_max_canon
method(has_dcp_canon, LambdaMax) <- 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.