Product of Entries
The product of entries in a vector or matrix.
prod_entries(..., axis = NA_real_, keepdims = FALSE) ## S3 method for class 'Expression' prod(..., na.rm = FALSE)
... |
Numeric scalar, vector, matrix, or Expression objects. |
axis |
(Optional) The dimension across which to apply the function: |
keepdims |
(Optional) Should dimensions be maintained when applying the atom along an axis? If |
na.rm |
(Unimplemented) A logical value indicating whether missing values should be removed. |
This atom is log-log affine, but it is neither convex nor concave.
An Expression representing the product of the entries of the input.
n <- 2 X <- Variable(n, n, pos=TRUE) obj <- sum(X) constraints <- list(prod_entries(X) == 4) prob <- Problem(Minimize(obj), constraints) result <- solve(prob, gp=TRUE) result$value result$getValue(X) n <- 2 X <- Variable(n, n, pos=TRUE) obj <- sum(X) constraints <- list(prod(X) == 4) prob <- Problem(Minimize(obj), constraints) result <- solve(prob, gp=TRUE) result$value
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.