Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dgp2dcp/canonicalizers/sum_canon.R
#####
## CVXPY SOURCE: reductions/dgp2dcp/canonicalizers/sum_canon.py
## DGP canonicalizer for SumEntries: sum -> explicit_sum -> add_canon
.dgp_sum_canon <- function(expr, args) {
X <- args[[1L]]
if (is.null(expr@axis)) {
## Sum all elements
summation <- .dgp_explicit_sum(X)
result <- .dgp_add_canon(summation, summation@args)
canon <- result[[1L]]
return(list(reshape_expr(canon, expr@shape), list()))
}
## Axis-wise sum
if (expr@axis == 2L) {
X <- t(X)
}
row_canons <- list()
for (i in seq_len(X@shape[1L])) {
summation <- .dgp_explicit_sum(X[i, ])
result <- .dgp_add_canon(summation, summation@args)
row_canons <- c(row_canons, list(result[[1L]]))
}
canon <- do.call(hstack, row_canons)
list(reshape_expr(canon, expr@shape), list())
}
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.