Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/reductions/dgp2dcp/util.R
#####
## CVXPY SOURCE: reductions/dgp2dcp/util.py
## Utility functions for DGP-to-DCP canonicalization
## explicit_sum: builds x[1] + x[2] + ... + x[n] as an AddExpression tree.
## This is NOT the same as SumEntries (which is a single atom).
## The distinction matters because add_canon expects AddExpression nodes.
## CVXPY SOURCE: util.py lines 19-24
.dgp_explicit_sum <- function(expr) {
x <- vec(expr) # (n, 1) column vector
n <- expr_size(x)
if (n == 0L) cli_abort("Cannot compute explicit sum of zero-size expression.")
summation <- x[1]
if (n > 1L) {
for (i in 2L:n) {
summation <- summation + x[i]
}
}
summation
}
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.